From bd5a34022f716db8df0d0d660ba022f90b1fc37d Mon Sep 17 00:00:00 2001 From: toaster Date: Mon, 11 Sep 2023 09:20:00 +0100 Subject: [PATCH] Move V-DrawCustomFadeScreen to D_Display TODO: This is steenky. Essentially immediately tint the geometry and players the latest possible place it is safe to do so, with the magic of the software-exclusive fade. This would ideally be handled with a shader so that GL and any future hwr2-native renderer can get in on the action too. --- src/d_main.c | 13 +++++++++++++ src/k_podium.c | 5 +++-- src/st_stuff.c | 9 ++++++--- 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/src/d_main.c b/src/d_main.c index 4f88b2538..93183e6e0 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -580,6 +580,19 @@ static void D_Display(void) // rhi: display the software framebuffer to the screen if (rendermode == render_soft) { + // TODO: THIS SHOULD IDEALLY BE IN REGULAR HUD CODE !! + // (st_stuff.c ST_Drawer, also duplicated in k_podium.c) + // Unfortunately this is the latest place we can do it + // If we could immediately tint the GPU data a lot + // of problems could be solved (including GL support) + if (gamestate != GS_TITLESCREEN + && G_GamestateUsesLevel() == true + && timeinmap < 16) + { + // Level fade-in + V_DrawCustomFadeScreen(((levelfadecol == 0) ? "FADEMAP1" : "FADEMAP0"), 31-(timeinmap*2)); + } + VID_DisplaySoftwareScreen(); } diff --git a/src/k_podium.c b/src/k_podium.c index 9235c8965..9cf47d528 100644 --- a/src/k_podium.c +++ b/src/k_podium.c @@ -601,11 +601,12 @@ void K_CeremonyDrawer(void) } } - if (timeinmap < 16) + // See d_main.c and V_DrawCustomFadeScreen for the hacks that prevents this being here + /*if (timeinmap < 16) { // Level fade-in V_DrawCustomFadeScreen(((levelfadecol == 0) ? "FADEMAP1" : "FADEMAP0"), 31-(timeinmap*2)); - } + }*/ if (podiumData.state == PODIUM_STATES) { diff --git a/src/st_stuff.c b/src/st_stuff.c index 1e738dc5f..7ec70c7d7 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -1491,9 +1491,12 @@ void ST_Drawer(void) ST_MayonakaStatic(); } - // Draw a fade on level opening - if (timeinmap < 16) - V_DrawCustomFadeScreen(((levelfadecol == 0) ? "FADEMAP1" : "FADEMAP0"), 31-(timeinmap*2)); // Then gradually fade out from there + // See d_main.c and V_DrawCustomFadeScreen for the hacks that prevents this being here + /*if (timeinmap < 16) + { + // Level fade-in + V_DrawCustomFadeScreen(((levelfadecol == 0) ? "FADEMAP1" : "FADEMAP0"), 31-(timeinmap*2)); + }*/ if (stagetitle) ST_drawTitleCard();