From 89276c5900691ed05edbb43821cdf9382eb5a83d Mon Sep 17 00:00:00 2001 From: Sally Coolatta Date: Fri, 3 Mar 2023 22:17:05 -0500 Subject: [PATCH] Fade-in the tint behind podium ranking --- src/k_podium.c | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/src/k_podium.c b/src/k_podium.c index 9b6f82093..fdd450b43 100644 --- a/src/k_podium.c +++ b/src/k_podium.c @@ -46,7 +46,11 @@ #include "k_menu.h" #include "k_grandprix.h" -static boolean s_podiumDone = false; +static struct podiumData_s +{ + boolean ranking; + UINT8 fade; +} podiumData; /*-------------------------------------------------- boolean K_PodiumSequence(void) @@ -117,7 +121,7 @@ void K_FinishCeremony(void) return; } - s_podiumDone = true; + podiumData.ranking = true; } /*-------------------------------------------------- @@ -127,7 +131,7 @@ void K_FinishCeremony(void) --------------------------------------------------*/ void K_ResetCeremony(void) { - s_podiumDone = false; + memset(&podiumData, 0, sizeof(struct podiumData_s)); } /*-------------------------------------------------- @@ -137,8 +141,6 @@ void K_ResetCeremony(void) --------------------------------------------------*/ void K_CeremonyTicker(boolean run) { - (void)run; - // don't trigger if doing anything besides idling if (gameaction != ga_nothing || gamestate != GS_CEREMONY) { @@ -156,6 +158,19 @@ void K_CeremonyTicker(boolean run) camera[0].aiming = titlemapcam.mobj->pitch; camera[0].subsector = titlemapcam.mobj->subsector; } + + if (podiumData.ranking == false) + { + return; + } + + if (run == true) + { + if (podiumData.fade < 16) + { + podiumData.fade++; + } + } } /*-------------------------------------------------- @@ -167,7 +182,7 @@ boolean K_CeremonyResponder(event_t *event) { INT32 key = event->data1; - if (s_podiumDone == false) + if (podiumData.ranking == false || podiumData.fade < 16) { return false; } @@ -225,9 +240,9 @@ boolean K_CeremonyResponder(event_t *event) --------------------------------------------------*/ void K_CeremonyDrawer(void) { - if (s_podiumDone == true) + if (podiumData.ranking == true) { - V_DrawFadeScreen(0xFF00, 16); + V_DrawFadeScreen(0xFF00, podiumData.fade); V_DrawCenteredString(BASEVIDWIDTH / 2, 64, 0, "STUFF GOES HERE"); }