From e4fc3cc5c29ed6962c377575b7f5ce4a7dee4b9c Mon Sep 17 00:00:00 2001 From: Eidolon Date: Sat, 15 Feb 2025 15:43:37 -0600 Subject: [PATCH] Fix conditionals on rendermode to allow for more modes --- src/d_main.cpp | 2 +- src/f_wipe.cpp | 6 +++--- src/g_game.c | 2 +- src/hu_stuff.c | 2 +- src/k_vote.c | 2 +- src/m_misc.cpp | 2 +- src/p_enemy.c | 2 +- src/p_setup.cpp | 2 +- src/r_data.c | 2 +- src/r_draw.cpp | 4 ++-- src/r_main.cpp | 2 +- src/r_things.cpp | 2 +- src/sdl/i_video.cpp | 4 ++-- src/v_video.cpp | 6 ++---- src/w_wad.cpp | 2 +- src/win32ce/win_vid.c | 4 ++-- src/y_inter.cpp | 2 +- 17 files changed, 23 insertions(+), 25 deletions(-) diff --git a/src/d_main.cpp b/src/d_main.cpp index 2b5a80f30..8b06c197a 100644 --- a/src/d_main.cpp +++ b/src/d_main.cpp @@ -587,7 +587,7 @@ static bool D_Display(bool world) HWR_RenderPlayerView(); else #endif - if (rendermode != render_none) + if (rendermode == render_soft) { if (i > 0) // Splitscreen-specific { diff --git a/src/f_wipe.cpp b/src/f_wipe.cpp index 7564a26c3..d583e13da 100644 --- a/src/f_wipe.cpp +++ b/src/f_wipe.cpp @@ -357,7 +357,7 @@ void F_WipeStartScreen(void) { #ifndef NOWIPE #ifdef HWRENDER - if(rendermode != render_soft) + if(rendermode == render_opengl) { HWR_StartScreenWipe(); return; @@ -393,7 +393,7 @@ void F_WipeEndScreen(void) { #ifndef NOWIPE #ifdef HWRENDER - if(rendermode != render_soft) + if(rendermode == render_opengl) { HWR_EndScreenWipe(); return; @@ -565,7 +565,7 @@ void F_RunWipe(UINT8 wipemode, UINT8 wipetype, boolean drawMenu, const char *col M_LegacySaveFrame(); else #endif - if (moviemode && rendermode != render_none) + if (moviemode && rendermode == render_soft) I_CaptureVideoFrame(); NetKeepAlive(); // Update the network so we don't cause timeouts diff --git a/src/g_game.c b/src/g_game.c index b4b673046..392d6f72b 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -1284,7 +1284,7 @@ void G_PreLevelTitleCard(void) M_LegacySaveFrame(); else #endif - if (moviemode && rendermode != render_none) + if (moviemode && rendermode == render_soft) I_CaptureVideoFrame(); while (!((nowtime = I_GetTime()) - lasttime)) diff --git a/src/hu_stuff.c b/src/hu_stuff.c index 1588090b2..04d8fdaec 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -2144,7 +2144,7 @@ void HU_Erase(void) con_hudupdate = false; // if it was set.. } #ifdef HWRENDER - else if (rendermode != render_none) + else if (rendermode == render_opengl) { // refresh just what is needed from the view borders HWR_DrawViewBorder(secondframelines); diff --git a/src/k_vote.c b/src/k_vote.c index fab4f08a2..4080a4d9c 100644 --- a/src/k_vote.c +++ b/src/k_vote.c @@ -1797,7 +1797,7 @@ static void Y_UnloadVoteData(void) vote.loaded = false; - if (rendermode != render_soft) + if (rendermode == render_opengl) { return; } diff --git a/src/m_misc.cpp b/src/m_misc.cpp index d85971f5d..b7e0df826 100644 --- a/src/m_misc.cpp +++ b/src/m_misc.cpp @@ -1462,7 +1462,7 @@ void M_LegacySaveFrame(void) #endif M_PNGFrame(apng_ptr, apng_info_ptr, (png_bytep)linear); #ifdef HWRENDER - if (rendermode != render_soft && linear) + if (rendermode == render_opengl && linear) free(linear); #endif diff --git a/src/p_enemy.c b/src/p_enemy.c index 6791963c1..8c7ec2ce1 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -3883,7 +3883,7 @@ void A_OverlayThink(mobj_t *actor) if (!actor->target) return; - if (!r_splitscreen && rendermode != render_soft) + if (!r_splitscreen && rendermode == render_opengl) { angle_t viewingangle; diff --git a/src/p_setup.cpp b/src/p_setup.cpp index 737b8b686..ef37320f5 100644 --- a/src/p_setup.cpp +++ b/src/p_setup.cpp @@ -8466,7 +8466,7 @@ boolean P_LoadLevel(boolean fromnetsave, boolean reloadinggamestate) lastwipetic = nowtime; \ if (moviemode && rendermode == render_opengl) \ M_LegacySaveFrame(); \ - else if (moviemode && rendermode != render_none) \ + else if (moviemode && rendermode == render_soft) \ I_CaptureVideoFrame(); \ NetKeepAlive(); \ } \ diff --git a/src/r_data.c b/src/r_data.c index 2e864bebf..a43c42197 100644 --- a/src/r_data.c +++ b/src/r_data.c @@ -1162,7 +1162,7 @@ void R_PrecacheLevel(void) return; // do not flush the memory, Z_Malloc twice with same user will cause error in Z_CheckHeap() - if (rendermode != render_soft) + if (rendermode == render_opengl) return; // Precache flats. diff --git a/src/r_draw.cpp b/src/r_draw.cpp index ae94e7578..75712eca1 100644 --- a/src/r_draw.cpp +++ b/src/r_draw.cpp @@ -524,7 +524,7 @@ void R_FillBackScreen(void) INT32 x, y, step, boff; // quickfix, don't cache lumps in both modes - if (rendermode != render_soft) + if (rendermode == render_opengl) return; // draw pattern around the status bar too (when hires), @@ -620,7 +620,7 @@ void R_DrawViewBorder(void) if (rendermode == render_none) return; #ifdef HWRENDER - if (rendermode != render_soft) + if (rendermode == render_opengl) { HWR_DrawViewBorder(0); return; diff --git a/src/r_main.cpp b/src/r_main.cpp index 9e18c8080..356df1e94 100644 --- a/src/r_main.cpp +++ b/src/r_main.cpp @@ -1100,7 +1100,7 @@ void R_ExecuteSetViewSize(void) // continue to do the software setviewsize as long as we use the reference software view #ifdef HWRENDER - if (rendermode != render_soft) + if (rendermode == render_opengl) HWR_SetViewSize(); #endif diff --git a/src/r_things.cpp b/src/r_things.cpp index e3b6d4291..6fca80e5f 100644 --- a/src/r_things.cpp +++ b/src/r_things.cpp @@ -2784,7 +2784,7 @@ void R_AddSprites(sector_t *sec, INT32 lightlevel) INT32 lightnum; fixed_t limit_dist; - if (rendermode != render_soft) + if (rendermode == render_opengl) return; // BSP is traversed by subsector. diff --git a/src/sdl/i_video.cpp b/src/sdl/i_video.cpp index e2422964b..91b223535 100644 --- a/src/sdl/i_video.cpp +++ b/src/sdl/i_video.cpp @@ -1220,8 +1220,8 @@ void I_UpdateNoVsync(void) // void I_ReadScreen(UINT8 *scr) { - if (rendermode != render_soft) - I_Error ("I_ReadScreen: called while in non-software mode"); + if (rendermode == render_opengl) + I_Error ("I_ReadScreen: called while in Legacy GL mode"); else VID_BlitLinearScreen(screens[0], scr, vid.width*vid.bpp, vid.height, diff --git a/src/v_video.cpp b/src/v_video.cpp index 374fb572d..43340aa52 100644 --- a/src/v_video.cpp +++ b/src/v_video.cpp @@ -797,7 +797,6 @@ void V_DrawStretchyFixedPatch(fixed_t x, fixed_t y, fixed_t pscale, fixed_t vsca return; #ifdef HWRENDER - //if (rendermode != render_soft && !con_startup) // Why? if (rendermode == render_opengl) { HWR_DrawStretchyFixedPatch(patch, x, y, pscale, vscale, scrn, colormap); @@ -1016,7 +1015,6 @@ void V_DrawFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 c) return; #ifdef HWRENDER - //if (rendermode != render_soft && !con_startup) // Not this again if (rendermode == render_opengl) { HWR_DrawFill(x, y, w, h, c); @@ -1600,7 +1598,7 @@ const UINT8 *V_OffsetIntoFadeMap(const lighttable_t *clm, UINT8 strength) void V_DrawCustomFadeScreen(const char *lump, UINT8 strength) { #ifdef HWRENDER - if (rendermode != render_soft && rendermode != render_none) + if (rendermode == render_opengl) { HWR_DrawCustomFadeScreen( (strcmp(lump, "FADEMAP1") != 0 @@ -1664,7 +1662,7 @@ void V_DrawFadeConsBack(INT32 plines) void V_EncoreInvertScreen(void) { #ifdef HWRENDER - if (rendermode != render_soft && rendermode != render_none) + if (rendermode == render_opengl) { HWR_EncoreInvertScreen(); return; diff --git a/src/w_wad.cpp b/src/w_wad.cpp index 4bc6ace5d..913ce09cc 100644 --- a/src/w_wad.cpp +++ b/src/w_wad.cpp @@ -2001,7 +2001,7 @@ void *W_CachePatchNumPwad(UINT16 wad, UINT16 lump, INT32 tag) #ifdef HWRENDER // Software-only compile cache the data without conversion - if (rendermode == render_soft || rendermode == render_none) + if (rendermode != render_opengl) #endif return (void *)patch; diff --git a/src/win32ce/win_vid.c b/src/win32ce/win_vid.c index 68b797fe3..fc3ddbb7a 100644 --- a/src/win32ce/win_vid.c +++ b/src/win32ce/win_vid.c @@ -233,8 +233,8 @@ void I_LoadingScreen(LPCSTR msg) void I_ReadScreen(UINT8 *scr) { // DEBUGGING - if (rendermode != render_soft) - I_Error("I_ReadScreen: called while in non-software mode"); + if (rendermode == render_opengl) + I_Error("I_ReadScreen: called while in Legacy GL mode"); VID_BlitLinearScreen(screens[0], scr, vid.width*vid.bpp, vid.height, vid.width*vid.bpp, vid.rowbytes); } diff --git a/src/y_inter.cpp b/src/y_inter.cpp index 23fdf5fe3..8f2117051 100644 --- a/src/y_inter.cpp +++ b/src/y_inter.cpp @@ -2523,7 +2523,7 @@ static void Y_UnloadData(void) { // In hardware mode, don't Z_ChangeTag a pointer returned by W_CachePatchName(). // It doesn't work and is unnecessary. - if (rendermode != render_soft) + if (rendermode == render_opengl) return; // unload the background patches