summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorZack Middleton <zturtleman@gmail.com>2012-02-15 18:09:24 +0000
committerTim Angus <tim@ngus.net>2013-01-12 20:18:09 +0000
commit3eca313660e7c0bfbe461f034cd2c7c6497e9b56 (patch)
treec78f5b8359780c7db499583450c2235e422e4b35 /src
parent8000b6b55c8c432c081172fa0e169e0eb895bf31 (diff)
Allow analog joystick up axis to be remapped too.
Diffstat (limited to 'src')
-rw-r--r--src/client/cl_input.c2
-rw-r--r--src/client/cl_main.c4
-rw-r--r--src/client/client.h2
3 files changed, 7 insertions, 1 deletions
diff --git a/src/client/cl_input.c b/src/client/cl_input.c
index 1823b9b4..e0bc26cc 100644
--- a/src/client/cl_input.c
+++ b/src/client/cl_input.c
@@ -419,7 +419,7 @@ void CL_JoystickMove( usercmd_t *cmd ) {
cmd->forwardmove = ClampChar( cmd->forwardmove + (int) (j_forward->value * cl.joystickAxis[j_forward_axis->integer]) );
}
- cmd->upmove = ClampChar( cmd->upmove + cl.joystickAxis[AXIS_UP] );
+ cmd->upmove = ClampChar( cmd->upmove + (int) (j_up->value * cl.joystickAxis[j_up_axis->integer]) );
}
/*
diff --git a/src/client/cl_main.c b/src/client/cl_main.c
index 58618f19..68ca6f12 100644
--- a/src/client/cl_main.c
+++ b/src/client/cl_main.c
@@ -95,10 +95,12 @@ cvar_t *j_pitch;
cvar_t *j_yaw;
cvar_t *j_forward;
cvar_t *j_side;
+cvar_t *j_up;
cvar_t *j_pitch_axis;
cvar_t *j_yaw_axis;
cvar_t *j_forward_axis;
cvar_t *j_side_axis;
+cvar_t *j_up_axis;
cvar_t *cl_activeAction;
@@ -3589,10 +3591,12 @@ void CL_Init( void ) {
j_yaw = Cvar_Get ("j_yaw", "-0.022", CVAR_ARCHIVE);
j_forward = Cvar_Get ("j_forward", "-0.25", CVAR_ARCHIVE);
j_side = Cvar_Get ("j_side", "0.25", CVAR_ARCHIVE);
+ j_up = Cvar_Get ("j_up", "1", CVAR_ARCHIVE);
j_pitch_axis = Cvar_Get ("j_pitch_axis", "3", CVAR_ARCHIVE);
j_yaw_axis = Cvar_Get ("j_yaw_axis", "4", CVAR_ARCHIVE);
j_forward_axis = Cvar_Get ("j_forward_axis", "1", CVAR_ARCHIVE);
j_side_axis = Cvar_Get ("j_side_axis", "0", CVAR_ARCHIVE);
+ j_up_axis = Cvar_Get ("j_up_axis", "2", CVAR_ARCHIVE);
cl_motdString = Cvar_Get( "cl_motdString", "", CVAR_ROM );
diff --git a/src/client/client.h b/src/client/client.h
index db996401..37e36a91 100644
--- a/src/client/client.h
+++ b/src/client/client.h
@@ -405,10 +405,12 @@ extern cvar_t *j_pitch;
extern cvar_t *j_yaw;
extern cvar_t *j_forward;
extern cvar_t *j_side;
+extern cvar_t *j_up;
extern cvar_t *j_pitch_axis;
extern cvar_t *j_yaw_axis;
extern cvar_t *j_forward_axis;
extern cvar_t *j_side_axis;
+extern cvar_t *j_up_axis;
extern cvar_t *cl_timedemo;
extern cvar_t *cl_aviFrameRate;