diff --git a/source/blood/src/config.cpp b/source/blood/src/config.cpp index 54a4e8199..57f10fc82 100644 --- a/source/blood/src/config.cpp +++ b/source/blood/src/config.cpp @@ -76,6 +76,7 @@ int32_t useprecache; char CommbatMacro[MAXRIDECULE][MAXRIDECULELENGTH]; char szPlayerName[MAXPLAYERNAME]; int32_t gTurnSpeed; +int32_t gTurnAcceleration; int32_t gDetail; int32_t gMouseAim; int32_t gAutoAim; @@ -384,6 +385,7 @@ void CONFIG_SetDefaults(void) gDeliriumBlur = 1; gViewSize = 2; gTurnSpeed = 92; + gTurnAcceleration = 1; gDetail = 4; gAutoRun = 0; gViewInterpolate = 1; diff --git a/source/blood/src/config.h b/source/blood/src/config.h index 19715aa56..1124484f2 100644 --- a/source/blood/src/config.h +++ b/source/blood/src/config.h @@ -57,6 +57,7 @@ extern int32_t useprecache; extern char CommbatMacro[MAXRIDECULE][MAXRIDECULELENGTH]; extern char szPlayerName[MAXPLAYERNAME]; extern int32_t gTurnSpeed; +extern int32_t gTurnAcceleration; extern int32_t gDetail; extern int32_t gAutoAim; extern int32_t gWeaponSwitch; diff --git a/source/blood/src/controls.cpp b/source/blood/src/controls.cpp index 934e90ba9..1f3338780 100644 --- a/source/blood/src/controls.cpp +++ b/source/blood/src/controls.cpp @@ -487,7 +487,7 @@ void ctrlGetInput(void) if (turnRight) input.q16turn = fix16_sadd(input.q16turn, fix16_from_float(scaleAdjustmentToInterval(ClipHigh(12 * turnHeldTime, gTurnSpeed)>>2))); - if ((run2 || run) && turnHeldTime > 24) + if (!gTurnAcceleration || (((gTurnAcceleration == 2) || run2 || run) && (turnHeldTime > 24))) input.q16turn <<= 1; if (BUTTON(gamefunc_Strafe)) diff --git a/source/blood/src/menu.cpp b/source/blood/src/menu.cpp index 9d09175c1..6d1f8f7af 100644 --- a/source/blood/src/menu.cpp +++ b/source/blood/src/menu.cpp @@ -70,6 +70,7 @@ void SetViewSwaying(CGameMenuItemZBool *); void SetMouseSensitivity(CGameMenuItemSliderFloat *); void SetMouseAimFlipped(CGameMenuItemZBool *); void SetTurnSpeed(CGameMenuItemSlider *); +void SetTurnAcceleration(CGameMenuItemZCycle *); void ResetKeys(CGameMenuItemChain *); void ResetKeysClassic(CGameMenuItemChain *); void SetMessages(CGameMenuItemZBool *); @@ -716,6 +717,12 @@ void SetJoystickDigitalNeg(CGameMenuItemZCycle* pItem); void SetJoystickDeadzone(CGameMenuItemSlider* pItem); void SetJoystickSaturate(CGameMenuItemSlider* pItem); +const char *pzTurnAccelerationStrings[] = { + "OFF", + "ON RUNNING", + "ALWAYS ON", +}; + CGameMenuItemTitle itemOptionsControlTitle("CONTROL SETUP", 1, 160, 20, 2038); CGameMenuItemChain itemOptionsControlKeyboard("KEYBOARD SETUP", 1, 0, 60, 320, 1, &menuOptionsControlKeyboard, -1, NULL, 0); CGameMenuItemChain itemOptionsControlMouse("MOUSE SETUP", 1, 0, 80, 320, 1, &menuOptionsControlMouse, -1, SetupMouseMenu, 0); @@ -724,6 +731,7 @@ CGameMenuItemChain itemOptionsControlJoystickAxes("JOYSTICK AXES SETUP", 1, 0, 1 CGameMenuItemTitle itemOptionsControlKeyboardTitle("KEYBOARD SETUP", 1, 160, 20, 2038); CGameMenuItemSlider itemOptionsControlKeyboardSliderTurnSpeed("Key Turn Speed:", 1, 18, 50, 280, &gTurnSpeed, 64, 128, 4, SetTurnSpeed, -1, -1); +CGameMenuItemZCycle itemOptionsControlKeyboardCycleTurnAcceleration("Key Turn Acceleration:", 1, 18, 70, 280, 0, SetTurnAcceleration, pzTurnAccelerationStrings, ARRAY_SIZE(pzTurnAccelerationStrings), 0); CGameMenuItemChain itemOptionsControlKeyboardList("Configure Keys...", 1, 0, 110, 320, 1, &menuKeys, -1, NULL, 0); CGameMenuItemChain itemOptionsControlKeyboardReset("Reset Keys (default)...", 1, 0, 135, 320, 1, &menuKeys, -1, ResetKeys, 0); CGameMenuItemChain itemOptionsControlKeyboardResetClassic("Reset Keys (classic)...", 1, 0, 155, 320, 1, &menuKeys, -1, ResetKeysClassic, 0); @@ -1436,12 +1444,15 @@ void SetupControlsMenu(void) menuOptionsControlKeyboard.Add(&itemOptionsControlKeyboardTitle, false); menuOptionsControlKeyboard.Add(&itemOptionsControlKeyboardSliderTurnSpeed, true); + menuOptionsControlKeyboard.Add(&itemOptionsControlKeyboardCycleTurnAcceleration, false); menuOptionsControlKeyboard.Add(&itemOptionsControlKeyboardList, false); menuOptionsControlKeyboard.Add(&itemOptionsControlKeyboardReset, false); menuOptionsControlKeyboard.Add(&itemOptionsControlKeyboardResetClassic, false); menuOptionsControlKeyboard.Add(&itemBloodQAV, false); itemOptionsControlKeyboardSliderTurnSpeed.nValue = gTurnSpeed; + itemOptionsControlKeyboardCycleTurnAcceleration.m_nFocus = gTurnAcceleration; + menuOptionsControlMouse.Add(&itemOptionsControlMouseTitle, false); menuOptionsControlMouse.Add(&itemOptionsControlMouseButton, true); menuOptionsControlMouse.Add(&itemOptionsControlMouseSensitivity, false); @@ -1793,6 +1804,11 @@ void SetTurnSpeed(CGameMenuItemSlider *pItem) gTurnSpeed = pItem->nValue; } +void SetTurnAcceleration(CGameMenuItemZCycle *pItem) +{ + gTurnAcceleration = pItem->m_nFocus; +} + void SetAutoAim(CGameMenuItemZCycle *pItem) { gAutoAim = pItem->m_nFocus; diff --git a/source/blood/src/osdcmd.cpp b/source/blood/src/osdcmd.cpp index f8ddd3d07..77490542b 100644 --- a/source/blood/src/osdcmd.cpp +++ b/source/blood/src/osdcmd.cpp @@ -1030,6 +1030,7 @@ int32_t registerosdcommands(void) { "in_mousedeadzone", "amount of mouse movement to filter out", (void *)&MouseDeadZone, CVAR_INT, 0, 512 }, { "in_mouseflip", "invert vertical mouse movement", (void *)&gMouseAimingFlipped, CVAR_BOOL, 0, 1 }, { "in_mousemode", "toggles vertical mouse view", (void *)&gMouseAim, CVAR_BOOL, 0, 1 }, + { "in_turnacceleration", "set keyboard turning acceleration (0: off, 1: only when running, 2: always on)", (void *)&gTurnAcceleration, CVAR_INT, 0, 2 }, { "in_turnsensitivity", "keyboard turning sensitivity multiplier", (void *)&gTurnSpeed, CVAR_INT, 64, 124 }, // { "mus_enabled", "enables/disables music", (void *)&MusicToggle, CVAR_BOOL, 0, 1 },