diff --git a/src/lua_hook.h b/src/lua_hook.h index 915863626..59f2ba28d 100644 --- a/src/lua_hook.h +++ b/src/lua_hook.h @@ -70,6 +70,7 @@ enum hook { extern const char *const hookNames[]; extern boolean hook_cmd_running; +extern int hook_defrosting; void LUAh_MapChange(INT16 mapnumber); // Hook for map change (before load) void LUAh_MapLoad(void); // Hook for map load diff --git a/src/lua_script.c b/src/lua_script.c index abf427e75..e76f27bd6 100644 --- a/src/lua_script.c +++ b/src/lua_script.c @@ -37,6 +37,8 @@ lua_State *gL = NULL; +int hook_defrosting; + // List of internal libraries to load from SRB2 static lua_CFunction liblist[] = { LUA_EnumLib, // global metatable for enums @@ -282,6 +284,9 @@ int LUA_PushGlobals(lua_State *L, const char *word) } else if (fastcmp(word,"leveltime")) { lua_pushinteger(L, leveltime); return 1; + } else if (fastcmp(word,"defrosting")) { + lua_pushinteger(L, hook_defrosting); + return 1; } else if (fastcmp(word,"curWeather")) { lua_pushinteger(L, curWeather); return 1; diff --git a/src/p_tick.c b/src/p_tick.c index 85ee844dd..a9a53aa7c 100644 --- a/src/p_tick.c +++ b/src/p_tick.c @@ -718,7 +718,7 @@ void P_Ticker(boolean run) // Abbreviated ticker for pre-loading, calls thinkers and assorted things void P_PreTicker(INT32 frames) { - INT32 i,framecnt; + INT32 i; ticcmd_t temptic; for (i = 0; i <= r_splitscreen; i++) @@ -727,7 +727,9 @@ void P_PreTicker(INT32 frames) if (marathonmode & MA_INGAME) marathonmode |= MA_INIT; - for (framecnt = 0; framecnt < frames; ++framecnt) + hook_defrosting = frames; + + while (hook_defrosting) { P_MapStart(); @@ -777,6 +779,8 @@ void P_PreTicker(INT32 frames) LUAh_PostThinkFrame(); P_MapEnd(); + + hook_defrosting--; } if (marathonmode & MA_INGAME) diff --git a/src/sdl/i_video.c b/src/sdl/i_video.c index 5e28e8643..04cfd4556 100644 --- a/src/sdl/i_video.c +++ b/src/sdl/i_video.c @@ -650,8 +650,7 @@ static void Impl_HandleWindowEvent(SDL_WindowEvent evt) // Tell game we got focus back, resume music if necessary window_notinfocus = false; - if (!paused) - S_InitMusicVolume(); + S_InitMusicVolume(); if (cv_gamesounds.value) S_EnableSound(); diff --git a/src/win32/Makefile.cfg b/src/win32/Makefile.cfg index 9acb65857..4a8c9ff3e 100644 --- a/src/win32/Makefile.cfg +++ b/src/win32/Makefile.cfg @@ -184,3 +184,7 @@ else endif LIBS+=-ldiscord-rpc endif + +ifndef MINGW64 + LDFLAGS+=-Wl,--large-address-aware +endif