From bd61f216c8999866b283fdf70fd15dc90ed2f967 Mon Sep 17 00:00:00 2001 From: James R Date: Fri, 13 Nov 2020 17:30:23 -0800 Subject: [PATCH 1/3] Always unmute music on refocus If the game is paused, music will be resumed when unpause anyway. --- src/sdl/i_video.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/sdl/i_video.c b/src/sdl/i_video.c index 2858e9b6f..ba0f7f1df 100644 --- a/src/sdl/i_video.c +++ b/src/sdl/i_video.c @@ -624,8 +624,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(); From fe031088aed8a2eea7530513e3bdef79eb5dc9b2 Mon Sep 17 00:00:00 2001 From: James R Date: Tue, 24 Nov 2020 19:32:01 -0800 Subject: [PATCH 2/3] Lua: "defrosting" global to tell how many tics are processing in the preticker --- src/dehacked.c | 3 +++ src/lua_hook.h | 1 + src/lua_script.c | 2 ++ src/p_tick.c | 8 ++++++-- 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index 39fc94144..d509cd499 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -9687,6 +9687,9 @@ static inline int lib_getenum(lua_State *L) } 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/lua_hook.h b/src/lua_hook.h index 3f2dfd7a5..a17a7ac78 100644 --- a/src/lua_hook.h +++ b/src/lua_hook.h @@ -63,6 +63,7 @@ enum hook { extern const char *const hookNames[]; extern boolean hook_cmd_running; // This is used by PlayerCmd and lua_playerlib to prevent anything from being wirtten to player while we run PlayerCmd. +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 ee49efcc1..5aff53808 100644 --- a/src/lua_script.c +++ b/src/lua_script.c @@ -35,6 +35,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 diff --git a/src/p_tick.c b/src/p_tick.c index bf0344477..6a85027f6 100644 --- a/src/p_tick.c +++ b/src/p_tick.c @@ -807,13 +807,15 @@ 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 <= splitscreen; i++) postimgtype[i] = postimg_none; - for (framecnt = 0; framecnt < frames; ++framecnt) + hook_defrosting = frames; + + while (hook_defrosting) { P_MapStart(); @@ -860,5 +862,7 @@ void P_PreTicker(INT32 frames) #endif P_MapEnd(); + + hook_defrosting--; } } From 742a665481a8283f1b930233eeb212b07e391e51 Mon Sep 17 00:00:00 2001 From: himie Date: Tue, 14 Jul 2020 14:38:20 -0500 Subject: [PATCH 3/3] Add large address aware flag This allows the final exe to use more than 2gb of RAM in a 64-bit system which should get rid of most out of memory errors on 32-bit builds --- src/win32/Makefile.cfg | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/win32/Makefile.cfg b/src/win32/Makefile.cfg index e9e18280b..6286a18bf 100644 --- a/src/win32/Makefile.cfg +++ b/src/win32/Makefile.cfg @@ -164,3 +164,7 @@ else endif LIBS+=-ldiscord-rpc endif + +ifndef MINGW64 + LDFLAGS+=-Wl,--large-address-aware +endif