From 4ffb5f2e10c26ad08bd26c01817f70d6e9bf3155 Mon Sep 17 00:00:00 2001 From: toaster Date: Sun, 7 May 2023 13:08:24 +0100 Subject: [PATCH] Improvements to background handling - Don't draw Lua HUD hook behind the background - Flip background in Encore mode - Only animate scrolling elements when not paused or P_AutoPause - Don't clobber the (TC_DEFAULT, SKINCOLOR_YELLOW) cache, instead use (TC_RAINBOW, SKINCOLOR_INTERMISSION) directly - Clearer variable name for background colormap (color to bgcolor) --- src/y_inter.c | 40 +++++++++++++++++++++++----------------- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/src/y_inter.c b/src/y_inter.c index 1b390dbb5..6be3a82b4 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -619,22 +619,10 @@ skiptallydrawer: fixed_t mqloop = SHORT(rrmq->width)*FRACUNIT; fixed_t chkloop = SHORT(rbgchk->width)*FRACUNIT; - UINT8 *color = R_GetTranslationColormap(TC_DEFAULT, SKINCOLOR_YELLOW, GTC_CACHE); // I don't even know how necessary this is anymore but I don't want the game yelling at me + UINT8 *bgcolor = R_GetTranslationColormap(TC_RAINBOW, SKINCOLOR_INTERMISSION, GTC_CACHE); - K_RainbowColormap(color, SKINCOLOR_INTERMISSION); - - if (renderisnewtic) - { - LUA_HUD_ClearDrawList(luahuddrawlist_intermission); - LUA_HookHUD(luahuddrawlist_intermission, HUD_HOOK(intermission)); - } - LUA_HUD_DrawList(luahuddrawlist_intermission); - - if (!LUA_HudEnabled(hud_intermissiontally)) - goto skiptallydrawer; - // Draw the background - K_DrawMapThumbnail(0, 0, BASEVIDWIDTH< mqloop) + mqscroll %= mqloop; + + chkscroll += renderdeltatics; + if (chkscroll > chkloop) + chkscroll %= chkloop; + } + + if (renderisnewtic) + { + LUA_HUD_ClearDrawList(luahuddrawlist_intermission); + LUA_HookHUD(luahuddrawlist_intermission, HUD_HOOK(intermission)); + } + LUA_HUD_DrawList(luahuddrawlist_intermission); + + if (!LUA_HudEnabled(hud_intermissiontally)) + goto skiptallydrawer; if (sorttic != -1 && intertic > sorttic) {