Fix usage of analog_strafe; to set n3ds analog look, add in_analog_strafe "1" to config.cfg

This commit is contained in:
Ryan Baldwin 2023-02-24 23:20:07 -08:00
parent 25be8cd391
commit 2cc40bc478

View file

@ -29,7 +29,6 @@ extern bool new3ds_flag;
circlePosition cstick; circlePosition cstick;
cvar_t csensitivity = {"csensitivity","3", true}; cvar_t csensitivity = {"csensitivity","3", true};
cvar_t circlepadsensitivity = {"circlepadsensitivity","10.0", true};
extern cvar_t in_analog_strafe; extern cvar_t in_analog_strafe;
extern cvar_t in_x_axis_adjust; extern cvar_t in_x_axis_adjust;
@ -39,6 +38,7 @@ extern cvar_t in_mlook; //Heffo - mlook cvar
void IN_Init (void) void IN_Init (void)
{ {
Cvar_RegisterVariable (&csensitivity); Cvar_RegisterVariable (&csensitivity);
Cvar_RegisterVariable (&in_analog_strafe);
} }
void IN_Shutdown (void) void IN_Shutdown (void)
@ -85,13 +85,13 @@ void IN_Move (usercmd_t *cmd)
// naievil -- fixme this operates incorrectly // naievil -- fixme this operates incorrectly
unsigned char analog_strafe = 0; unsigned char analog_strafe = 0;
// Don't let the pitch drift back to centre if analog nub look is on. // Don't let the pitch drift back to centre if analog nub look is on.
if (in_mlook.value) //if (in_mlook.value)
V_StopPitchDrift(); V_StopPitchDrift();
else { //else {
if (in_analog_strafe.value || (in_strafe.state & 1)) { if (in_analog_strafe.value || (in_strafe.state & 1)) {
analog_strafe = 1; analog_strafe = 1;
} }
} //}
// Read the pad state. // Read the pad state.
circlePosition pos; circlePosition pos;
@ -140,7 +140,6 @@ void IN_Move (usercmd_t *cmd)
// naievil -- taken from ctrQuake // naievil -- taken from ctrQuake
//cStick is only available on N3DS... Until libctru implements support for circlePad Pro //cStick is only available on N3DS... Until libctru implements support for circlePad Pro
if(new3ds_flag){ if(new3ds_flag){
hidCstickRead(&cstick); hidCstickRead(&cstick);
if(m_pitch.value < 0) { if(m_pitch.value < 0) {
@ -152,7 +151,7 @@ void IN_Move (usercmd_t *cmd)
cstick.dy = abs(cstick.dy) < 10 ? 0 : cstick.dy * csensitivity.value * 0.01; cstick.dy = abs(cstick.dy) < 10 ? 0 : cstick.dy * csensitivity.value * 0.01;
cl.viewangles[YAW] -= cstick.dx; cl.viewangles[YAW] -= cstick.dx;
cl.viewangles[PITCH] -= cstick.dy; cl.viewangles[PITCH] += cstick.dy;
} }
// Analog nub look? // Analog nub look?
@ -183,7 +182,7 @@ void IN_Move (usercmd_t *cmd)
} }
} else { } else {
cmd->sidemove += cl_sidespeed * x; cmd->sidemove += cl_sidespeed * x;
cmd->forwardmove -= cl_forwardspeed * y; cmd->forwardmove += cl_forwardspeed * y;
} }
} }