diff --git a/src/d_netcmd.c b/src/d_netcmd.c index db23909d3..638fda99c 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -940,6 +940,7 @@ void D_RegisterClientCommands(void) CV_RegisterVar(&cv_mouse2opt); #endif CV_RegisterVar(&cv_controlperkey); + CV_RegisterVar(&cv_turnsmooth); CV_RegisterVar(&cv_usemouse); CV_RegisterVar(&cv_usemouse2); diff --git a/src/g_game.c b/src/g_game.c index 7f8283ca3..d3b49e219 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -1429,7 +1429,7 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer) th = 0; if (th < SLOWTURNTICS) - tspeed = 2; // slow turn + tspeed = cv_turnsmooth.value == 2 ? 2 : 0; // slow turn else tspeed = speed; diff --git a/src/g_game.h b/src/g_game.h index 5086bb4d1..2d865f8da 100644 --- a/src/g_game.h +++ b/src/g_game.h @@ -142,7 +142,7 @@ typedef enum // mouseaiming (looking up/down with the mouse or keyboard) #define KB_LOOKSPEED (1<<25) #define MAXPLMOVE (50) -#define SLOWTURNTICS (6) +#define SLOWTURNTICS (cv_turnsmooth.value * 3) // build an internal map name MAPxx from map number const char *G_BuildMapName(INT32 map); diff --git a/src/g_input.c b/src/g_input.c index 6d72452a6..8f5bc3d46 100644 --- a/src/g_input.c +++ b/src/g_input.c @@ -23,6 +23,7 @@ static CV_PossibleValue_t mousesens_cons_t[] = {{1, "MIN"}, {MAXMOUSESENSITIVITY, "MAX"}, {0, NULL}}; static CV_PossibleValue_t onecontrolperkey_cons_t[] = {{1, "One"}, {2, "Several"}, {0, NULL}}; +static CV_PossibleValue_t turnsmooth_cons_t[] = {{2, "Slow"}, {1, "Fast"}, {0, "Off"}, {0, NULL}}; // mouse values are used once consvar_t cv_mousesens = {"mousesens", "20", CV_SAVE, mousesens_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; @@ -30,6 +31,7 @@ consvar_t cv_mousesens2 = {"mousesens2", "20", CV_SAVE, mousesens_cons_t, NULL, consvar_t cv_mouseysens = {"mouseysens", "20", CV_SAVE, mousesens_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_mouseysens2 = {"mouseysens2", "20", CV_SAVE, mousesens_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_controlperkey = {"controlperkey", "One", CV_SAVE, onecontrolperkey_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_turnsmooth = {"turnsmoothing", "Slow", CV_SAVE, turnsmooth_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; INT32 mousex, mousey; INT32 mlooky; // like mousey but with a custom sensitivity for mlook diff --git a/src/g_input.h b/src/g_input.h index 6d0c7e2c8..3d170ba1d 100644 --- a/src/g_input.h +++ b/src/g_input.h @@ -127,7 +127,7 @@ typedef enum // mouse values are used once extern consvar_t cv_mousesens, cv_mouseysens; extern consvar_t cv_mousesens2, cv_mouseysens2; -extern consvar_t cv_controlperkey; +extern consvar_t cv_controlperkey, cv_turnsmooth; extern INT32 mousex, mousey; extern INT32 mlooky; //mousey with mlookSensitivity diff --git a/src/m_menu.c b/src/m_menu.c index d01a8b6ff..415b969a5 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -1109,7 +1109,8 @@ static menuitem_t OP_ControlsMenu[] = {IT_CALL | IT_STRING, NULL, "Player 3 Controls...", &M_Setup3PControlsMenu, 30}, {IT_CALL | IT_STRING, NULL, "Player 4 Controls...", &M_Setup4PControlsMenu, 40}, - {IT_STRING | IT_CVAR, NULL, "Controls per key", &cv_controlperkey, 60}, + {IT_STRING | IT_CVAR, NULL, "Controls per key", &cv_controlperkey, 60}, + {IT_STRING | IT_CVAR, NULL, "Digital turn easing", &cv_turnsmooth, 70}, }; static menuitem_t OP_AllControlsMenu[] =