From 79aac789be4ed7a7a7ef4281fc86e835bdcc64fa Mon Sep 17 00:00:00 2001 From: Eric Wasylishen Date: Wed, 23 Aug 2017 06:00:20 +0000 Subject: [PATCH] Revert "always run" changes from r797; move the QuakeSpasm customizations to a new "cl_alwaysrun" cvar. Set to 1 to scale forward/side/up speed by "cl_movespeedkey" (usually 2), and make "speedkey" act as "slowkey". Change "always run" menu option to offer "off" (cl_alwaysrun 0, cl_forwardspeed 200, cl_backspeed 200), "vanilla" (cl_alwaysrun 0, cl_forwardspeed 400, cl_backspeed 400) and "quakespasm" (cl_alwaysrun 1, cl_forwardspeed 200, cl_backspeed 200). git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1480 af15c1b1-3010-417e-b628-4374ebc0bcbd --- Linux/sgml/Quakespasm.sgml | 2 ++ Quake/cl_input.c | 7 +++--- Quake/cl_main.c | 2 ++ Quake/client.h | 2 ++ Quake/in_sdl.c | 2 +- Quake/menu.c | 49 ++++++++++++++++++++++++++++++-------- Quakespasm.html | 2 ++ Quakespasm.txt | 10 ++++++++ 8 files changed, 61 insertions(+), 15 deletions(-) diff --git a/Linux/sgml/Quakespasm.sgml b/Linux/sgml/Quakespasm.sgml index 4f1f31db..d09dacb2 100644 --- a/Linux/sgml/Quakespasm.sgml +++ b/Linux/sgml/Quakespasm.sgml @@ -169,6 +169,8 @@ these patched libSDL binaries may help. Restore vid_refreshrate from fitzquake-0.85 for SDL2 builds. Alpha-masked model support. (MF_HOLEY: 0x4000). Change default screenshot format to png. The 'screenshot' command now supports optional format (tga, png or jpg) and quality (1-100) arguments. + Revert "always run" changes from 0.85.9; move the QuakeSpasm customizations to a new "cl_alwaysrun" cvar. Set to 1 to scale forward/side/up speed by "cl_movespeedkey" (usually 2), and make "speedkey" act as "slowkey". + Change "always run" menu option to offer "off" (cl_alwaysrun 0, cl_forwardspeed 200, cl_backspeed 200), "vanilla" (cl_alwaysrun 0, cl_forwardspeed 400, cl_backspeed 400) and "quakespasm" (cl_alwaysrun 1, cl_forwardspeed 200, cl_backspeed 200). New "r_scale" cvar. Set to 2, 3, or 4 to render the view at 1/2, 1/3, or 1/4 resolution. New "r_viewmodel_quake" cvar. Set to 1 for WinQuake gun position (from MarkV). New "find" / "apropos" command, searches for commands/cvar names for the given substring (from Spike). diff --git a/Quake/cl_input.c b/Quake/cl_input.c index 11837945..6e5fcdb5 100644 --- a/Quake/cl_input.c +++ b/Quake/cl_input.c @@ -232,6 +232,7 @@ cvar_t cl_pitchspeed = {"cl_pitchspeed","150",CVAR_NONE}; cvar_t cl_anglespeedkey = {"cl_anglespeedkey","1.5",CVAR_NONE}; +cvar_t cl_alwaysrun = {"cl_alwaysrun","0",CVAR_ARCHIVE}; // QuakeSpasm -- new always run /* ================ @@ -245,7 +246,7 @@ void CL_AdjustAngles (void) float speed; float up, down; - if ((cl_forwardspeed.value > 200) ^ (in_speed.state & 1)) + if ((in_speed.state & 1) ^ (cl_alwaysrun.value != 0.0)) speed = host_frametime * cl_anglespeedkey.value; else speed = host_frametime; @@ -322,9 +323,7 @@ void CL_BaseMove (usercmd_t *cmd) // // adjust for speed key // - if (cl_forwardspeed.value > 200 && cl_movespeedkey.value) - cmd->forwardmove /= cl_movespeedkey.value; - if ((cl_forwardspeed.value > 200) ^ (in_speed.state & 1)) + if ((in_speed.state & 1) ^ (cl_alwaysrun.value != 0.0)) { cmd->forwardmove *= cl_movespeedkey.value; cmd->sidemove *= cl_movespeedkey.value; diff --git a/Quake/cl_main.c b/Quake/cl_main.c index 5f848761..5d870bd9 100644 --- a/Quake/cl_main.c +++ b/Quake/cl_main.c @@ -791,6 +791,8 @@ void CL_Init (void) Cvar_RegisterVariable (&lookspring); Cvar_RegisterVariable (&lookstrafe); Cvar_RegisterVariable (&sensitivity); + + Cvar_RegisterVariable (&cl_alwaysrun); Cvar_RegisterVariable (&m_pitch); Cvar_RegisterVariable (&m_yaw); diff --git a/Quake/client.h b/Quake/client.h index 0db68da1..1c7db181 100644 --- a/Quake/client.h +++ b/Quake/client.h @@ -245,6 +245,8 @@ extern cvar_t cl_pitchspeed; extern cvar_t cl_anglespeedkey; +extern cvar_t cl_alwaysrun; // QuakeSpasm + extern cvar_t cl_autofire; extern cvar_t cl_shownet; diff --git a/Quake/in_sdl.c b/Quake/in_sdl.c index b63149c9..5e114138 100644 --- a/Quake/in_sdl.c +++ b/Quake/in_sdl.c @@ -674,7 +674,7 @@ void IN_JoyMove (usercmd_t *cmd) moveEased = IN_ApplyMoveEasing(moveDeadzone); lookEased = IN_ApplyLookEasing(lookDeadzone, joy_exponent.value); - if (in_speed.state & 1) + if ((in_speed.state & 1) ^ (cl_alwaysrun.value != 0.0)) speed = cl_movespeedkey.value; else speed = 1; diff --git a/Quake/menu.c b/Quake/menu.c index 3503d80f..0a76fc56 100644 --- a/Quake/menu.c +++ b/Quake/menu.c @@ -997,6 +997,14 @@ enum OPTIONS_ITEMS }; +enum +{ + ALWAYSRUN_OFF = 0, + ALWAYSRUN_VANILLA, + ALWAYSRUN_QUAKESPASM, + ALWAYSRUN_ITEMS +}; + #define SLIDER_RANGE 10 int options_cursor; @@ -1012,6 +1020,7 @@ void M_Menu_Options_f (void) void M_AdjustSliders (int dir) { + int curr_alwaysrun, target_alwaysrun; float f, l; S_LocalSound ("misc/menu3.wav"); @@ -1074,17 +1083,32 @@ void M_AdjustSliders (int dir) break; case OPT_ALWAYRUN: // always run - if (cl_movespeedkey.value <= 1) - Cvar_Set ("cl_movespeedkey", "2.0"); - if (cl_forwardspeed.value > 200) - { - Cvar_Set ("cl_forwardspeed", "200"); - Cvar_Set ("cl_backspeed", "200"); - } + if (cl_alwaysrun.value) + curr_alwaysrun = ALWAYSRUN_QUAKESPASM; + else if (cl_forwardspeed.value > 200) + curr_alwaysrun = ALWAYSRUN_VANILLA; else + curr_alwaysrun = ALWAYSRUN_OFF; + + target_alwaysrun = (ALWAYSRUN_ITEMS + curr_alwaysrun + dir) % ALWAYSRUN_ITEMS; + + if (target_alwaysrun == ALWAYSRUN_VANILLA) { - Cvar_SetValue ("cl_forwardspeed", 200 * cl_movespeedkey.value); - Cvar_SetValue ("cl_backspeed", 200 * cl_movespeedkey.value); + Cvar_SetValue ("cl_alwaysrun", 0); + Cvar_SetValue ("cl_forwardspeed", 400); + Cvar_SetValue ("cl_backspeed", 400); + } + else if (target_alwaysrun == ALWAYSRUN_QUAKESPASM) + { + Cvar_SetValue ("cl_alwaysrun", 1); + Cvar_SetValue ("cl_forwardspeed", 200); + Cvar_SetValue ("cl_backspeed", 200); + } + else // ALWAYSRUN_OFF + { + Cvar_SetValue ("cl_alwaysrun", 0); + Cvar_SetValue ("cl_forwardspeed", 200); + Cvar_SetValue ("cl_backspeed", 200); } break; @@ -1203,7 +1227,12 @@ void M_Options_Draw (void) // OPT_ALWAYRUN: M_Print (16, 32 + 8*OPT_ALWAYRUN, " Always Run"); - M_DrawCheckbox (220, 32 + 8*OPT_ALWAYRUN, cl_forwardspeed.value > 200); + if (cl_alwaysrun.value) + M_Print (220, 32 + 8*OPT_ALWAYRUN, "quakespasm"); + else if (cl_forwardspeed.value > 200.0) + M_Print (220, 32 + 8*OPT_ALWAYRUN, "vanilla"); + else + M_Print (220, 32 + 8*OPT_ALWAYRUN, "off"); // OPT_INVMOUSE: M_Print (16, 32 + 8*OPT_INVMOUSE, " Invert Mouse"); diff --git a/Quakespasm.html b/Quakespasm.html index 3bd75323..83645c28 100644 --- a/Quakespasm.html +++ b/Quakespasm.html @@ -263,6 +263,8 @@ these patched libSDL binaries may help.
  • Restore vid_refreshrate from fitzquake-0.85 for SDL2 builds.
  • Alpha-masked model support. (MF_HOLEY: 0x4000).
  • Change default screenshot format to png. The 'screenshot' command now supports optional format (tga, png or jpg) and quality (1-100) arguments.
  • +
  • Revert "always run" changes from 0.85.9; move the QuakeSpasm customizations to a new "cl_alwaysrun" cvar. Set to 1 to scale forward/side/up speed by "cl_movespeedkey" (usually 2), and make "speedkey" act as "slowkey".
  • +
  • Change "always run" menu option to offer "off" (cl_alwaysrun 0, cl_forwardspeed 200, cl_backspeed 200), "vanilla" (cl_alwaysrun 0, cl_forwardspeed 400, cl_backspeed 400) and "quakespasm" (cl_alwaysrun 1, cl_forwardspeed 200, cl_backspeed 200).
  • New "r_scale" cvar. Set to 2, 3, or 4 to render the view at 1/2, 1/3, or 1/4 resolution.
  • New "r_viewmodel_quake" cvar. Set to 1 for WinQuake gun position (from MarkV).
  • New "find" / "apropos" command, searches for commands/cvar names for the given substring (from Spike).
  • diff --git a/Quakespasm.txt b/Quakespasm.txt index 0b9ae9a6..f1352990 100644 --- a/Quakespasm.txt +++ b/Quakespasm.txt @@ -319,6 +319,16 @@ now supports optional format (tga, png or jpg) and quality (1-100) arguments. + o Revert "always run" changes from 0.85.9; move the QuakeSpasm + customizations to a new "cl_alwaysrun" cvar. Set to 1 to scale + forward/side/up speed by "cl_movespeedkey" (usually 2), + and make "speedkey" act as "slowkey". + + o Change "always run" menu option to offer + "off" (cl_alwaysrun 0, cl_forwardspeed 200, cl_backspeed 200), + "vanilla" (cl_alwaysrun 0, cl_forwardspeed 400, cl_backspeed 400) and + "quakespasm" (cl_alwaysrun 1, cl_forwardspeed 200, cl_backspeed 200). + o New "r_scale" cvar. Set to 2, 3, or 4 to render the view at 1/2, 1/3, or 1/4 resolution.