From 4fe34956523ea453afec48a7c93965c2f4794e25 Mon Sep 17 00:00:00 2001 From: Alug Date: Mon, 4 May 2026 10:25:52 +0200 Subject: [PATCH] fallback to srb2back instead of hoping the map is still loaded for intermission bg timescale and replay fastforward caused stuff to crash and well this is better than a whitescreen ig --- src/d_main.c | 21 +++++---------------- src/doomstat.h | 1 + src/hardware/hw_main.cpp | 5 ++--- src/screen.c | 5 +---- src/y_inter.c | 2 ++ 5 files changed, 11 insertions(+), 23 deletions(-) diff --git a/src/d_main.c b/src/d_main.c index eb503b39f..c1e96ebc9 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -138,6 +138,7 @@ boolean devparm = false; // started game with -devparm boolean singletics = false; // timedemo boolean lastdraw = false; +boolean intermissionbginit = false; #ifdef MOTIONBLUR INT32 postimgparam[MAXSPLITSCREENPLAYERS]; @@ -370,23 +371,10 @@ static void D_MakeIntermissionBG(void) if (rendermode == render_none) { lastdraw = false; + intermissionbginit = false; return; } - // no more valid map - // shouldnt happen at this point, but better safe than sorry! - if (!numsectors) - { - lastdraw = false; - return; - } - - // need to render level again for this - // should be fine since at this point we did not unload it yet - if (cv_renderview.value) - { - D_Renderview(); - } #ifdef HWRENDER if (rendermode == render_opengl) { @@ -399,6 +387,7 @@ static void D_MakeIntermissionBG(void) } lastdraw = false; + intermissionbginit = true; } static boolean D_Display(void) @@ -558,8 +547,6 @@ static boolean D_Display(void) break; } - D_MakeIntermissionBG(); - if (gamestate == GS_LEVEL) { // draw the view directly @@ -568,6 +555,8 @@ static boolean D_Display(void) PS_START_TIMING(ps_rendercalltime); D_Renderview(); PS_STOP_TIMING(ps_rendercalltime); + + D_MakeIntermissionBG(); } PS_START_TIMING(ps_uitime); diff --git a/src/doomstat.h b/src/doomstat.h index e8eae7a4f..86d742183 100644 --- a/src/doomstat.h +++ b/src/doomstat.h @@ -113,6 +113,7 @@ extern UINT8 window_notinfocus; // are we in focus? (backend independant -- hand extern boolean nodrawers; extern boolean lastdraw; +extern boolean intermissionbginit; #ifdef MOTIONBLUR extern INT32 postimgparam[MAXSPLITSCREENPLAYERS]; diff --git a/src/hardware/hw_main.cpp b/src/hardware/hw_main.cpp index 971627477..f603b58a2 100644 --- a/src/hardware/hw_main.cpp +++ b/src/hardware/hw_main.cpp @@ -258,9 +258,7 @@ static void CV_screentextures_OnChange(void) if (cv_glframebuffer.value != 0) CV_SetValue(&cv_glframebuffer, 0); #endif - // HACK: set lastdraw so intermission bg can refresh after toggling screentextures - if (gamestate == GS_INTERMISSION) - lastdraw = true; + intermissionbginit = false; } GL_SetSpecialState(HWD_SET_SCREEN_TEXTURES, cv_glscreentextures.value); M_UpdateOGLMenu(); @@ -277,6 +275,7 @@ static void CV_glframebuffer_OnChange(void) I_DownSample(); RefreshOGLSDLSurface(); M_UpdateOGLMenu(); + intermissionbginit = false; } #endif diff --git a/src/screen.c b/src/screen.c index 84e81617a..a874ed530 100644 --- a/src/screen.c +++ b/src/screen.c @@ -277,10 +277,7 @@ void SCR_Recalc(void) // vid.recalc lasts only for the next refresh... con_recalc = true; am_recalc = true; - - // HACK: set lastdraw so intermission bg can refresh after resolution change - if (gamestate == GS_INTERMISSION) - lastdraw = true; + intermissionbginit = false; } // Check for screen cmd-line parms: to force a resolution. diff --git a/src/y_inter.c b/src/y_inter.c index 5fbd4d86e..19b696b0e 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -433,6 +433,7 @@ void Y_IntermissionDrawer(void) return; if (cv_betainterscreen.value == 1 + || !intermissionbginit #ifdef HWRENDER || (rendermode == render_opengl && cv_glscreentextures.value != 2) // use the neato kart bg for intermission on disabled screen textures #endif @@ -794,6 +795,7 @@ void Y_EndIntermission(void) endtic = -1; sorttic = -1; intertype = int_none; + intermissionbginit = false; // not sure if this is the right place to reset, but i guess it works for now.... } //