Merge branch 'master' into dev

This commit is contained in:
Linus Probert 2018-09-18 07:52:53 +02:00
commit 3bbe9176b8
5 changed files with 25 additions and 4 deletions

View File

@ -509,16 +509,21 @@ resetGame(void)
static bool static bool
init(void) init(void)
{ {
#ifdef STEAM_BUILD
if (!steam_restart_needed()) {
steam_init();
} else {
error("%s needs to be started through Steam", GAME_TITLE);
return false;
}
#endif // STEAM_BUILD
if (!initSDL()) { if (!initSDL()) {
return false; return false;
} else if (!initGame()) { } else if (!initGame()) {
return false; return false;
} }
#ifdef STEAM_BUILD
steam_init();
#endif // STEAM_BUILD
settings_init(); settings_init();
hiscore_init(); hiscore_init();
initMainMenu(); initMainMenu();

View File

@ -58,6 +58,12 @@ leaderboard_received(Sint64 hLeaderboard, const char *name)
m_hKillsLeaderboard = hLeaderboard; m_hKillsLeaderboard = hLeaderboard;
} }
bool
steam_restart_needed()
{
return c_SteamAPI_RestartAppIfNecessary();
}
void void
steam_init() steam_init()
{ {

View File

@ -25,6 +25,8 @@ typedef struct Achievement {
int m_iIconImage; int m_iIconImage;
} Achievement; } Achievement;
bool steam_restart_needed(void);
void steam_init(void); void steam_init(void);
void steam_shutdown(void); void steam_shutdown(void);

View File

@ -47,6 +47,11 @@ c_SteamAPI_GetAppID()
return m_AppId; return m_AppId;
} }
bool c_SteamAPI_RestartAppIfNecessary()
{
return SteamAPI_RestartAppIfNecessary(931040);
}
void void
c_SteamAPI_RunCallbacks(void) c_SteamAPI_RunCallbacks(void)
{ {

View File

@ -26,6 +26,9 @@ c_SteamAPI_Init(void);
int64_t int64_t
c_SteamAPI_GetAppID(void); c_SteamAPI_GetAppID(void);
bool
c_SteamAPI_RestartAppIfNecessary(void);
void void
c_SteamAPI_RunCallbacks(void); c_SteamAPI_RunCallbacks(void);