summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Howard2007-06-14 21:03:22 +0000
committerSimon Howard2007-06-14 21:03:22 +0000
commit66d22ab030630378c2feb57a5d8cd65669713c2a (patch)
treeb0463009a04e7d64e1787e063aa64760707243e8
parente4127187e0e5de9c94a92301b4dc780bc9153fb8 (diff)
downloadchocolate-doom-66d22ab030630378c2feb57a5d8cd65669713c2a.tar.gz
chocolate-doom-66d22ab030630378c2feb57a5d8cd65669713c2a.tar.bz2
chocolate-doom-66d22ab030630378c2feb57a5d8cd65669713c2a.zip
Don't send joystick updates when the joystick is disabled. Shut up
warning caused by missing header. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 904
-rw-r--r--src/i_joystick.c15
-rw-r--r--src/i_video.c1
2 files changed, 10 insertions, 6 deletions
diff --git a/src/i_joystick.c b/src/i_joystick.c
index 3eb9069d..b6333334 100644
--- a/src/i_joystick.c
+++ b/src/i_joystick.c
@@ -163,13 +163,16 @@ static int GetAxisState(int axis, int invert)
void I_UpdateJoystick(void)
{
- event_t ev;
+ if (joystick != NULL)
+ {
+ event_t ev;
- ev.type = ev_joystick;
- ev.data1 = GetButtonState();
- ev.data2 = GetAxisState(joystick_x_axis, joystick_x_invert);
- ev.data3 = GetAxisState(joystick_y_axis, joystick_y_invert);
+ ev.type = ev_joystick;
+ ev.data1 = GetButtonState();
+ ev.data2 = GetAxisState(joystick_x_axis, joystick_x_invert);
+ ev.data3 = GetAxisState(joystick_y_axis, joystick_y_invert);
- D_PostEvent(&ev);
+ D_PostEvent(&ev);
+ }
}
diff --git a/src/i_video.c b/src/i_video.c
index 0dfccfa3..1666171e 100644
--- a/src/i_video.c
+++ b/src/i_video.c
@@ -37,6 +37,7 @@
#include "doomdef.h"
#include "doomstat.h"
#include "d_main.h"
+#include "i_joystick.h"
#include "i_scale.h"
#include "i_system.h"
#include "i_swap.h"