From 7113cdd6f2c0b4e6ead4c120b65c99453626d459 Mon Sep 17 00:00:00 2001 From: MadDeCoDeR Date: Tue, 2 May 2023 22:09:13 +0300 Subject: [PATCH] Add Toggle Run Option on Classic DOOM (ref #91) --- base/wads/newopt.wad | Bin 116979 -> 119780 bytes doomclassic/doom/constructs.h | 6 ++++-- doomclassic/doom/globaldata.cpp | 1 + doomclassic/doom/m_menu.cpp | 10 ++++++++++ doomclassic/doom/structs.h | 2 ++ doomclassic/doom/vars.h | 2 +- 6 files changed, 18 insertions(+), 3 deletions(-) diff --git a/base/wads/newopt.wad b/base/wads/newopt.wad index 8f157f82a58126fffc615750946cadc025b67505..886e8752af2d2018b0eec821d811393f302a29cb 100644 GIT binary patch delta 6809 zcmc(kYm8l0701uHGq>~T^hGJPRQoV$+DY4MYGp<(MIw}F3jqU`Seq7OG>t{0CdQ<( z2l=A%0V2ob8e*VBDWv$QbI80J!`MC_da{Cz4m(SdE-ZYuRYT@c;~j8Z`tWM&e`9O4<4T7zjWkU|HJz?xS@aO zKl}Wlt;?a-Yz_Q}PtK{HUE!{$y6eRD>KiNEk7T63>i9Em?7wh)x7TVkT9rzrT^_7d zT6HVbt(r6%&1S2mYVQzli?TLn)LT%MNf%;u%{Ph$LqOb#;LeLUgql37Q#4 zPivyKY7%xBjSE^Nyz#f+zSQ46vZ%W06YdAyu=;|_dOklo*T47J0{`sTeAZch@|6Al z(yxtQ8$5Bk&m9OWmD!qK=pR0FU9frH=Uh)KsI>da{H7^XxeuyYk45(kh)(0c=3hcW zRN_c8tF&ESw$dclY^c#KP3lHF{fMF=k{7BZ3>LA9wu2b8&@TnHHbUAQW$G2au|7pbPh+Sl2c%)@YiB~UsyCZbIcuR$1VI>?C9xL9fWtFukz^Ce2JNqSri}qy zJ8~i>Du^VL0%s&j5S)#olSxH3$@(-4dAhSW>51gmE)|L>-OauQp+#rAZ3L1FJU&>I ze1fr+Os~}>&~fCa*dWM6=467A)RQ#joOc!pQItvFV+NUEiaFiw3>!D2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MqOXDH<}um#*Z1ch7&8>wR9v=HJUoX^(FsHDt`9ApLVT$%vB}7-P+}fzfiW$ zUnK?`HU7rqE0+Aq;$Bek(+MF{)5|TF{4c5a3%mX(M^3TPqekV-7vLI>1C5KONXYt*r$d95_lQa1JD8nvj^iSouA6FQjQZ?M+-0l!KA`=L{WbMtS=C}5Y+=oi#c}MMAMBsx!*PcNq`a@ zZ+UWUDq+^Ty0B>k2G4>H8`O#uA1rGIre+Z(Z^(R{0;v z=6^4F7d)M)DO_j#JtZB!FZg*A9 zqk%qL6W6EkK()y?HA0kvjYx!%?^Dtrp4G@y+eofLUadx#q?319ZKD`?1;-rT3yy`2q7b@Q&#lfc_b!6&)8tg6aJ5jR%|%$b+E5G!OXMa5X^IPA2|L~iOPr~=Vy?C%V{msMIPM^K=`RUg`{>l6A zer55s)8)tCI{oP2?DP-+d|ZC^_NR-}-~H>Cr@wvePp9vF_~r7i&%XEX@SndeKH2*( D%ab~T diff --git a/doomclassic/doom/constructs.h b/doomclassic/doom/constructs.h index 0bebab1b..74047b0c 100644 --- a/doomclassic/doom/constructs.h +++ b/doomclassic/doom/constructs.h @@ -483,14 +483,16 @@ menu_t temp_GameDef = { 0 }; memcpy(&::g->GameDef, &temp_GameDef, sizeof(temp_GameDef)); -menuitem_t temp_CtlMenu[7] = { +menuitem_t temp_CtlMenu[9] = { {1,"M_KEY", M_Key,'k'}, {-1, "", 0}, {1, "M_RMBL", M_Rumble, 'r' }, {1, "M_LAY", M_Layout, 'l'}, {-1, "", 0}, {2,"M_MSENS", M_ChangeSensitivity,'m'}, - {-1,"",0} + {-1,"",0}, + {-1,"",0}, + {1, "M_TRUN", M_ToggleRun, 't'} }; memcpy(::g->CtlMenu, temp_CtlMenu, sizeof(temp_CtlMenu)); menu_t temp_CtlDef = { diff --git a/doomclassic/doom/globaldata.cpp b/doomclassic/doom/globaldata.cpp index 8c273474..c0030ec0 100644 --- a/doomclassic/doom/globaldata.cpp +++ b/doomclassic/doom/globaldata.cpp @@ -89,6 +89,7 @@ void M_Key(int choice); void M_ChangeKeys(int choice); void M_Rumble(int choice); void M_Layout(int choice); +void M_ToggleRun(int choice); void M_FinishReadThis(int choice); void M_LoadSelect(int choice); diff --git a/doomclassic/doom/m_menu.cpp b/doomclassic/doom/m_menu.cpp index 6f81b2df..bc223e13 100644 --- a/doomclassic/doom/m_menu.cpp +++ b/doomclassic/doom/m_menu.cpp @@ -108,6 +108,7 @@ extern idCVar s_useXAudio2; #endif extern idCVar in_photomode; +extern idCVar in_toggleRun; // // defaulted values // @@ -231,6 +232,7 @@ void M_Key(int choice); void M_ChangeKeys(int choice); void M_Rumble(int choice); void M_Layout(int choice); +void M_ToggleRun(int choice); void M_FinishReadThis(int choice); void M_LoadSelect(int choice); @@ -1790,12 +1792,15 @@ void M_DrawCtl(void) const int roundedMouseSpeed = M_GetMouseSpeedForMenu(in_mouseSpeed.GetFloat()); bool rumbleOnOff = in_joystickRumble.GetBool(); bool layoutOnOff = in_joylayout.GetBool(); + bool autorunOnOff = in_toggleRun.GetBool(); V_DrawPatchDirect(::g->CtlDef.x + 95, ::g->CtlDef.y + LINEHEIGHT * rumble, 0, /*(patch_t*)*/img2lmp(W_CacheLumpName(msgNames[rumbleOnOff], PU_CACHE_SHARED), W_GetNumForName(msgNames[rumbleOnOff])), false); V_DrawPatchDirect(::g->CtlDef.x + 99, ::g->CtlDef.y + LINEHEIGHT * layout, 0, /*(patch_t*)*/img2lmp(W_CacheLumpName(layNames[layoutOnOff], PU_CACHE_SHARED), W_GetNumForName(layNames[layoutOnOff])), false); M_DrawThermo(::g->CtlDef.x, ::g->CtlDef.y + LINEHEIGHT * ctl_empty3, 16, roundedMouseSpeed); + V_DrawPatchDirect(::g->CtlDef.x + 148, ::g->CtlDef.y + LINEHEIGHT * togglerun, 0, + /*(patch_t*)*/img2lmp(W_CacheLumpName(msgNames[autorunOnOff], PU_CACHE_SHARED), W_GetNumForName(msgNames[autorunOnOff])), false); //M_DrawThermo(::g->OptionsDef.x,::g->OptionsDef.y+LINEHEIGHT*(scrnsize+1), // 9,::g->screenSize); @@ -2150,6 +2155,11 @@ void M_Layout(int choice) } } +void M_ToggleRun(int choice) +{ + in_toggleRun.SetBool(!in_toggleRun.GetBool()); +} + void M_ChangeDetail(int choice) { diff --git a/doomclassic/doom/structs.h b/doomclassic/doom/structs.h index eb61e312..20eca932 100644 --- a/doomclassic/doom/structs.h +++ b/doomclassic/doom/structs.h @@ -279,6 +279,8 @@ typedef enum ctl_empty2, mousesens, ctl_empty3, + ctl_empty4, + togglerun, ctl_end } ctl_e; // m_menu.structs end // diff --git a/doomclassic/doom/vars.h b/doomclassic/doom/vars.h index 221a65c2..d809343a 100644 --- a/doomclassic/doom/vars.h +++ b/doomclassic/doom/vars.h @@ -436,7 +436,7 @@ menuitem_t GameMenu[7]; menu_t GameDef; menuitem_t ResMenu[20]; menu_t ResDef; -menuitem_t CtlMenu[7]; +menuitem_t CtlMenu[9]; menu_t CtlDef; menuitem_t KeyMenu[30]; menu_t KeyDef;