diff --git a/src/d_main.cpp b/src/d_main.cpp index 2070f9a09..7df05d12f 100644 --- a/src/d_main.cpp +++ b/src/d_main.cpp @@ -1075,6 +1075,8 @@ void D_ClearState(void) wipegamestate = GS_NULL; } +static boolean g_deferredtitle = false; + // // D_StartTitle // @@ -1085,6 +1087,17 @@ void D_StartTitle(void) D_ClearState(); F_StartTitleScreen(); M_ClearMenus(false); + g_deferredtitle = true; +} + +void D_SetDeferredStartTitle(boolean deferred) +{ + g_deferredtitle = true; +} + +boolean D_IsDeferredStartTitle(void) +{ + return g_deferredtitle; } // diff --git a/src/d_main.h b/src/d_main.h index cdfee4e0c..fdaa1bc1c 100644 --- a/src/d_main.h +++ b/src/d_main.h @@ -59,6 +59,8 @@ const char *D_Home(void); // void D_ClearState(void); void D_StartTitle(void); +void D_SetDeferredStartTitle(boolean deferred); +boolean D_IsDeferredStartTitle(void); #ifdef __cplusplus } // extern "C" diff --git a/src/f_finale.c b/src/f_finale.c index 95fb2a53b..93d2efd1f 100644 --- a/src/f_finale.c +++ b/src/f_finale.c @@ -39,6 +39,7 @@ #include "p_setup.h" #include "st_stuff.h" // hud hiding #include "fastcmp.h" +#include "r_fps.h" #include "lua_hud.h" #include "lua_hook.h" @@ -385,6 +386,12 @@ void F_IntroTicker(void) timetonext--; + if (D_IsDeferredStartTitle()) + { + D_StartTitle(); + return; + } + if (intro_scenenum == 0) { if (timetonext <= 0) diff --git a/src/g_game.c b/src/g_game.c index 815f903ae..fbcc3adfd 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -1339,7 +1339,7 @@ boolean G_Responder(event_t *ev) { if (F_IntroResponder(ev)) { - D_StartTitle(); + D_SetDeferredStartTitle(true); return true; } } @@ -5437,7 +5437,7 @@ void G_SaveGameData(void) } } } - + WRITEUINT16(save.p, gamedata->numspraycans); // 2 // gamedata->numspraycans * (2 + 4)