1
Fork 0
mirror of https://github.com/redstrate/Astra.git synced 2025-04-23 04:57:44 +00:00

Make Steamworks API initialization failure fatal

This commit is contained in:
Joshua Goins 2023-10-11 13:08:00 -04:00
parent e2ad7e71d5
commit d1d96d5e9f
2 changed files with 5 additions and 7 deletions

View file

@ -11,12 +11,9 @@ class SteamAPI : public QObject
{ {
public: public:
explicit SteamAPI(LauncherCore &core, QObject *parent = nullptr); explicit SteamAPI(LauncherCore &core, QObject *parent = nullptr);
~SteamAPI(); ~SteamAPI() override;
void setLauncherMode(bool isLauncher); void setLauncherMode(bool isLauncher);
[[nodiscard]] bool isDeck() const; [[nodiscard]] bool isDeck() const;
private:
LauncherCore &core;
}; };

View file

@ -7,18 +7,19 @@
#include <steam/steam_api.h> #include <steam/steam_api.h>
#endif #endif
#include "astra_log.h"
#include "launchercore.h" #include "launchercore.h"
SteamAPI::SteamAPI(LauncherCore &core, QObject *parent) SteamAPI::SteamAPI(LauncherCore &core, QObject *parent)
: QObject(parent) : QObject(parent)
, core(core)
{ {
#ifdef ENABLE_STEAM #ifdef ENABLE_STEAM
qputenv("SteamAppId", "39210"); qputenv("SteamAppId", "39210");
qputenv("SteamGameId", "39210"); qputenv("SteamGameId", "39210");
if (!SteamAPI_Init()) if (!SteamAPI_Init()) {
qDebug() << "Failed to initialize steam api!"; qFatal(ASTRA_LOG) << "Failed to initialize steam api!";
}
#endif #endif
} }