From b69bb8500318f4c3ed0387c685a9a1b90cb7a334 Mon Sep 17 00:00:00 2001 From: Alug Date: Fri, 3 Jan 2025 20:09:28 +0100 Subject: [PATCH] remove redundant stuff can just set this all the time, its only used when menu is active anyways so it doesent matter if we set it --- src/d_main.c | 5 ++--- src/m_menu.c | 26 ++++++++------------------ 2 files changed, 10 insertions(+), 21 deletions(-) diff --git a/src/d_main.c b/src/d_main.c index ac4326f65..94fe8792d 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -165,7 +165,7 @@ UINT8 ctrldown = 0; // 0x1 left, 0x2 right UINT8 altdown = 0; // 0x1 left, 0x2 right boolean capslock = 0; // gee i wonder what this does. -static void D_PadScrollInput(int input) +static void D_PadMenuScrollInput(int input) { event_t myev = {0, 0, 0, 0}; myev.type = ev_keydown; @@ -198,7 +198,7 @@ static void D_GamePadMenuScrollTicker(void) menuInputDelayTimer++; if (menuInputDelayTimer == SCROLLDELAY) - D_PadScrollInput(key); + D_PadMenuScrollInput(key); } else { @@ -815,7 +815,6 @@ void D_SRB2Loop(void) doDisplay = true; } - // this is absolutely awful and i hate it lmao if (menuactive) { D_GamePadMenuScrollTicker(); diff --git a/src/m_menu.c b/src/m_menu.c index 03eeef210..6272f57fa 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -3675,40 +3675,28 @@ boolean M_Responder(event_t *ev) break; case KEY_HAT1: ch = KEY_UPARROW; + DPADUPSCROLL = true; break; case KEY_HAT1 + 1: ch = KEY_DOWNARROW; + DPADDOWNSCROLL = true; break; case KEY_HAT1 + 2: ch = KEY_LEFTARROW; + DPADLEFTSCROLL = true; break; case KEY_HAT1 + 3: ch = KEY_RIGHTARROW; + DPADRIGHTSCROLL = true; break; } if (menuactive) { - switch (ev->data1) // if you pressed it set those to true - { - case KEY_HAT1: - DPADUPSCROLL = true; - break; - case KEY_HAT1 + 1: - DPADDOWNSCROLL = true; - break; - case KEY_HAT1 + 2: - DPADLEFTSCROLL = true; - break; - case KEY_HAT1 + 3: - DPADRIGHTSCROLL = true; - break; - } - if (currentMenu == &MISC_ChangeLevelDef || currentMenu == &MP_OfflineServerDef || currentMenu == &MP_ServerDef) { - if (ev->data1 == gamecontrol[gc_fire][0] - || ev->data1 == gamecontrol[gc_fire][1]) + if (ch == gamecontrol[gc_fire][0] + || ch == gamecontrol[gc_fire][1]) { COM_ImmedExecute("add kartencore 1"); } @@ -4383,10 +4371,12 @@ void M_StartControlPanel(void) menuactive = true; + // reset those just in case the game missed the keyup event DPADUPSCROLL = false; DPADDOWNSCROLL = false; DPADLEFTSCROLL = false; DPADRIGHTSCROLL = false; + // if (demo.playback) {