Skip to content

Commit

Permalink
Renamed gamepad stick sensitivity console commands and variables
Browse files Browse the repository at this point in the history
  • Loading branch information
Xottab-DUTY authored and fgsfdsfgs committed Feb 18, 2022
1 parent 3e48fb3 commit 6f5af71
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion src/xrEngine/FDemoRecord.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,7 @@ void CDemoRecord::IR_OnControllerHold(int key, float x, float y)
case kLOOK_AROUND:
{
m_angle_speed = speed;
const float scale = .05f; // psControllerSens;
const float scale = .05f; // psControllerStickSens;
OnAxisMove(x, y, scale, psControllerInvertY.test(1));
break;
}
Expand Down
6 changes: 3 additions & 3 deletions src/xrEngine/IInputReceiver.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ ENGINE_API extern float psMouseSens;
ENGINE_API extern float psMouseSensScale;
ENGINE_API extern Flags32 psMouseInvert;

ENGINE_API extern float psControllerSens;
ENGINE_API extern float psControllerSensScale;
ENGINE_API extern float psControllerDeadZoneSens;
ENGINE_API extern float psControllerStickSens;
ENGINE_API extern float psControllerStickSensScale;
ENGINE_API extern float psControllerStickDeadZone;
ENGINE_API extern Flags32 psControllerInvertY;

#endif
8 changes: 4 additions & 4 deletions src/xrEngine/xr_input.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ ENGINE_API float psMouseSens = 1.f;
ENGINE_API float psMouseSensScale = 1.f;
ENGINE_API Flags32 psMouseInvert = {false};

ENGINE_API float psControllerSens = 1.f;
ENGINE_API float psControllerSensScale = 1.f;
ENGINE_API float psControllerDeadZoneSens = 0.f;
ENGINE_API float psControllerStickSens = 1.f;
ENGINE_API float psControllerStickSensScale = 1.f;
ENGINE_API float psControllerStickDeadZone = 0.f;
ENGINE_API Flags32 psControllerInvertY = { false };

static bool AltF4Pressed = false;
Expand Down Expand Up @@ -265,7 +265,7 @@ void CInput::ControllerUpdate()
if (!IsControllerAvailable())
return;

const int controllerDeadZone = int(psControllerDeadZoneSens * (SDL_JOYSTICK_AXIS_MAX / 100.f)); // raw
const int controllerDeadZone = int(psControllerStickDeadZone * (SDL_JOYSTICK_AXIS_MAX / 100.f)); // raw

const auto controllerPrev = controllerState;
decltype(controllerAxisState) controllerAxisStatePrev;
Expand Down
8 changes: 4 additions & 4 deletions src/xrEngine/xr_ioc_cmd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -839,10 +839,10 @@ void CCC_Register()

// Gamepad
CMD3(CCC_Mask, "gamepad_invert_y", &psControllerInvertY, 1);
psControllerSens = 0.02f;
CMD4(CCC_Float, "gamepad_sens", &psControllerSens, 0.001f, 0.6f);
psControllerDeadZoneSens = 15.f;
CMD4(CCC_Float, "gamepad_deadzone_sens", &psControllerDeadZoneSens, 1.f, 35.f);
psControllerStickSens = 0.02f;
CMD4(CCC_Float, "gamepad_stick_sens", &psControllerStickSens, 0.001f, 0.6f);
psControllerStickDeadZone = 15.f;
CMD4(CCC_Float, "gamepad_stick_deadzone", &psControllerStickDeadZone, 1.f, 35.f);

// Camera
CMD2(CCC_Float, "cam_inert", &psCamInert);
Expand Down
4 changes: 2 additions & 2 deletions src/xrGame/ActorInput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ void CActor::IR_OnControllerPress(int cmd, float x, float y)
{
const float LookFactor = GetLookFactor();
CCameraBase* C = cameras[cam_active];
float scale = (cam_Active()->f_fov / g_fov) * psControllerSens * psControllerSensScale / 50.f / LookFactor;
float scale = (cam_Active()->f_fov / g_fov) * psControllerStickSens * psControllerStickSensScale / 50.f / LookFactor;
OnAxisMove(x, y, scale, psControllerInvertY.test(1));
break;
}
Expand Down Expand Up @@ -506,7 +506,7 @@ void CActor::IR_OnControllerHold(int cmd, float x, float y)
{
const float LookFactor = GetLookFactor();
CCameraBase* C = cameras[cam_active];
float scale = (cam_Active()->f_fov / g_fov) * psControllerSens * psControllerSensScale / 50.f / LookFactor;
float scale = (cam_Active()->f_fov / g_fov) * psControllerStickSens * psControllerStickSensScale / 50.f / LookFactor;
OnAxisMove(x, y, scale, psControllerInvertY.test(1));
break;
}
Expand Down
4 changes: 2 additions & 2 deletions src/xrGame/CarInput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ void CCar::OnControllerPress(int cmd, float x, float y)
{
case kLOOK_AROUND:
{
const float scale = (active_camera->f_fov / g_fov) * psControllerSens * psControllerSensScale / 50.f;
const float scale = (active_camera->f_fov / g_fov) * psControllerStickSens * psControllerStickSensScale / 50.f;
OnAxisMove(x, y, scale, psControllerInvertY.test(1));
break;
}
Expand Down Expand Up @@ -298,7 +298,7 @@ void CCar::OnControllerHold(int cmd, float x, float y)
{
case kLOOK_AROUND:
{
const float scale = (active_camera->f_fov / g_fov) * psControllerSens * psControllerSensScale / 50.f;
const float scale = (active_camera->f_fov / g_fov) * psControllerStickSens * psControllerStickSensScale / 50.f;
OnAxisMove(x, y, scale, psControllerInvertY.test(1));
break;
}
Expand Down
4 changes: 2 additions & 2 deletions src/xrGame/WeaponStatMgunIR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ void CWeaponStatMgun::OnControllerPress(int cmd, float x, float y)
{
case kLOOK_AROUND:
{
const float scale = psControllerSens * psControllerSensScale / 50.f;
const float scale = psControllerStickSens * psControllerStickSensScale / 50.f;
OnAxisMove(x, y, scale, psControllerInvertY.test(1));
break;
}
Expand Down Expand Up @@ -101,7 +101,7 @@ void CWeaponStatMgun::OnControllerHold(int cmd, float x, float y)
switch (cmd)
{
case kLOOK_AROUND:
const float scale = psControllerSens * psControllerSensScale / 50.f;
const float scale = psControllerStickSens * psControllerStickSensScale / 50.f;
OnAxisMove(x, y, scale, psControllerInvertY.test(1));
break;
}; // switch (cmd)
Expand Down

0 comments on commit 6f5af71

Please sign in to comment.