diff --git a/source/in_null.c b/source/in_null.c index a844def..a6ac94f 100644 --- a/source/in_null.c +++ b/source/in_null.c @@ -24,6 +24,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. extern int bind_grab; +extern bool new3ds_flag; + +circlePosition cstick; + +cvar_t csensitivity = {"csensitivity","3", true}; +cvar_t circlepadsensitivity = {"circlepadsensitivity","10.0", true}; + extern cvar_t in_analog_strafe; extern cvar_t in_x_axis_adjust; extern cvar_t in_y_axis_adjust; @@ -31,7 +38,7 @@ extern cvar_t in_mlook; //Heffo - mlook cvar void IN_Init (void) { - + Cvar_RegisterVariable (&csensitivity); } void IN_Shutdown (void) @@ -130,6 +137,24 @@ void IN_Move (usercmd_t *cmd) // Set the yaw. + // naievil -- taken from ctrQuake + //cStick is only available on N3DS... Until libctru implements support for circlePad Pro + if(new3ds_flag){ + + hidCstickRead(&cstick); + + if(m_pitch.value < 0) { + cstick.dy = -cstick.dy; + } + + + cstick.dx = abs(cstick.dx) < 10 ? 0 : cstick.dx * csensitivity.value * 0.01; + cstick.dy = abs(cstick.dy) < 10 ? 0 : cstick.dy * csensitivity.value * 0.01; + + cl.viewangles[YAW] -= cstick.dx; + cl.viewangles[PITCH] -= cstick.dy; + } + // Analog nub look? if (!analog_strafe) { const float yawScale = 30.0f; diff --git a/source/sys_ctr.c b/source/sys_ctr.c index 039ad2e..a38128b 100644 --- a/source/sys_ctr.c +++ b/source/sys_ctr.c @@ -27,6 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. int __stacksize__ = 4 * 1024 * 1024; u32 __ctru_linear_heap_size = 28 * 1024 * 1024; +bool new3ds_flag; extern void Touch_Init(); extern void Touch_Update(); @@ -286,7 +287,7 @@ int main (int argc, char **argv) { static float time, oldtime; static quakeparms_t parms; - bool new3ds_flag = false; + new3ds_flag = false; osSetSpeedupEnable(true);