Skip to content

Commit

Permalink
Add Toggle Run Option on Classic DOOM (ref #91)
Browse files Browse the repository at this point in the history
  • Loading branch information
MadDeCoDeR committed May 2, 2023
1 parent 36d7185 commit 7113cdd
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 3 deletions.
Binary file modified base/wads/newopt.wad
Binary file not shown.
6 changes: 4 additions & 2 deletions doomclassic/doom/constructs.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
1 change: 1 addition & 0 deletions doomclassic/doom/globaldata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
10 changes: 10 additions & 0 deletions doomclassic/doom/m_menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ extern idCVar s_useXAudio2;
#endif

extern idCVar in_photomode;
extern idCVar in_toggleRun;
//
// defaulted values
//
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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)
{
Expand Down
2 changes: 2 additions & 0 deletions doomclassic/doom/structs.h
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,8 @@ typedef enum
ctl_empty2,
mousesens,
ctl_empty3,
ctl_empty4,
togglerun,
ctl_end
} ctl_e;
// m_menu.structs end //
Expand Down
2 changes: 1 addition & 1 deletion doomclassic/doom/vars.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 7113cdd

Please sign in to comment.