From 8f318871eb0562fcc4f06941223a36b9440e27f0 Mon Sep 17 00:00:00 2001 From: toaster Date: Thu, 14 Jun 2018 22:23:20 +0100 Subject: [PATCH] * Make the OpenGL loading screen work with the fades better. * Make the closed captions not mess with fades, and improve their movement calculation. --- src/hardware/hw_bsp.c | 3 ++- src/p_setup.c | 7 +++++-- src/p_setup.h | 1 + src/screen.c | 8 +++++--- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/hardware/hw_bsp.c b/src/hardware/hw_bsp.c index fa5bce308..04afb9be9 100644 --- a/src/hardware/hw_bsp.c +++ b/src/hardware/hw_bsp.c @@ -29,6 +29,7 @@ #include "../m_argv.h" #include "../i_video.h" #include "../w_wad.h" +#include "../p_setup.h" // levelfadecol // -------------------------------------------------------------------------- // This is global data for planes rendering @@ -644,7 +645,7 @@ static void WalkBSPNode(INT32 bspnum, poly_t *poly, UINT16 *leafnode, fixed_t *b sprintf(s, "%d%%", (++ls_percent)<<1); x = BASEVIDWIDTH/2; y = BASEVIDHEIGHT/2; - V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31); // Black background to match fade in effect + V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, levelfadecol); // Background to match fade in effect //V_DrawPatchFill(W_CachePatchName("SRB2BACK",PU_CACHE)); // SRB2 background, ehhh too bright. M_DrawTextBox(x-58, y-8, 13, 1); V_DrawString(x-50, y, V_YELLOWMAP, "Loading..."); diff --git a/src/p_setup.c b/src/p_setup.c index a1ef08c5d..43da5275b 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -103,6 +103,7 @@ side_t *sides; mapthing_t *mapthings; INT32 numstarposts; boolean levelloading; +UINT8 levelfadecol; // BLOCKMAP // Created from axis aligned bounding box @@ -2806,6 +2807,8 @@ boolean P_SetupLevel(boolean skipprecip) } } + levelfadecol = (ranspecialwipe) ? 0 : 31; + #ifdef HAVE_BLUA LUA_InvalidateLevel(); #endif @@ -3183,7 +3186,7 @@ boolean P_SetupLevel(boolean skipprecip) // Remove the loading shit from the screen if (rendermode != render_none && !titlemapinaction) - V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, (ranspecialwipe) ? 0 : 31); + V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, levelfadecol); if (precache || dedicated) R_PrecacheLevel(); @@ -3254,7 +3257,7 @@ boolean P_SetupLevel(boolean skipprecip) I_Sleep(); lasttime = nowtime; - V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, (ranspecialwipe) ? 0 : 31); + V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, levelfadecol); stplyr = &players[consoleplayer]; ST_drawLevelTitle(nowtime - starttime); if (splitscreen) diff --git a/src/p_setup.h b/src/p_setup.h index a42ac5b76..f3897d1e0 100644 --- a/src/p_setup.h +++ b/src/p_setup.h @@ -27,6 +27,7 @@ extern mapthing_t *deathmatchstarts[MAX_DM_STARTS]; extern INT32 numdmstarts, numcoopstarts, numredctfstarts, numbluectfstarts; extern boolean levelloading; +extern UINT8 levelfadecol; extern lumpnum_t lastloadedmaplumpnum; // for comparative savegame // diff --git a/src/screen.c b/src/screen.c index cd97b62fa..13c211724 100644 --- a/src/screen.c +++ b/src/screen.c @@ -442,14 +442,16 @@ void SCR_ClosedCaptions(void) boolean gamestopped = (paused || P_AutoPause()); INT32 basey = BASEVIDHEIGHT; + if (gamestate != wipegamestate) + return; + if (gamestate == GS_LEVEL) { if (splitscreen) basey -= 8; - else if (((maptol & TOL_NIGHTS) && (modeattacking == ATTACKING_NIGHTS)) + else if ((modeattacking == ATTACKING_NIGHTS) || (cv_powerupdisplay.value == 2) - || (cv_powerupdisplay.value == 1 && ((stplyr == &players[displayplayer] && !camera.chase) - || ((splitscreen && stplyr == &players[secondarydisplayplayer]) && !camera2.chase)))) + || (cv_powerupdisplay.value == 1 && !splitscreen && !camera.chase)) basey -= 16; }