From 4095ef599b4f12098c587fdc4ef8b59c4a00d682 Mon Sep 17 00:00:00 2001 From: Eidolon Date: Tue, 26 Apr 2022 11:04:48 -0500 Subject: [PATCH] Delta time choose player menu animations --- src/m_menu.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index 0ed7e6882..1b3943f8b 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -175,7 +175,7 @@ static INT32 vidm_column_size; static fixed_t recatkdrawtimer = 0; static fixed_t ntsatkdrawtimer = 0; -static tic_t charseltimer = 0; +static fixed_t charseltimer = 0; static fixed_t char_scroll = 0; #define charscrollamt 128*FRACUNIT @@ -9354,8 +9354,8 @@ static void M_DrawSetupChoosePlayerMenu(void) INT32 x, y; INT32 w = (vid.width/vid.dupx); - if (abs(char_scroll) > FRACUNIT) - char_scroll -= (char_scroll>>2); + if (abs(char_scroll) > FRACUNIT/4) + char_scroll -= FixedMul((char_scroll>>2), renderdeltatics); else // close enough. char_scroll = 0; // just be exact now. @@ -9383,7 +9383,7 @@ static void M_DrawSetupChoosePlayerMenu(void) // Don't render the title map hidetitlemap = true; - charseltimer++; + charseltimer += renderdeltatics; // Background and borders V_DrawFill(0, 0, bgwidth, vid.height, V_SNAPTOTOP|colormap[101]); @@ -9395,7 +9395,7 @@ static void M_DrawSetupChoosePlayerMenu(void) V_DrawFill(0, 0, bw, vid.height, V_NOSCALESTART|col); } - y = (charseltimer%32); + y = (charseltimer / FRACUNIT) % 32; V_DrawMappedPatch(0, y-bgheight, V_SNAPTOTOP, charbg, colormap); V_DrawMappedPatch(0, y, V_SNAPTOTOP, charbg, colormap); V_DrawMappedPatch(0, y+bgheight, V_SNAPTOTOP, charbg, colormap);