projects
/
supertux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
002eb2c
)
- larger joystick dead zone for analog stick noise
author
Ingo Ruhnke
<grumbel@gmx.de>
Sun, 14 Mar 2004 17:01:45 +0000
(17:01 +0000)
committer
Ingo Ruhnke
<grumbel@gmx.de>
Sun, 14 Mar 2004 17:01:45 +0000
(17:01 +0000)
SVN-Revision: 217
src/gameloop.c
patch
|
blob
|
history
diff --git
a/src/gameloop.c
b/src/gameloop.c
index
3eddc5e
..
f4727ee
100644
(file)
--- a/
src/gameloop.c
+++ b/
src/gameloop.c
@@
-68,6
+68,8
@@
void drawstatus(void);
void drawendscreen(void);
void drawresultscreen(void);
void drawendscreen(void);
void drawresultscreen(void);
+#define JOYSTICK_DEAD_ZONE 4096
+
void levelintro(void)
{
/* Level Intro: */
void levelintro(void)
{
/* Level Intro: */
@@
-236,20
+238,20
@@
void game_event(void)
switch(event.jaxis.axis)
{
case JOY_X:
switch(event.jaxis.axis)
{
case JOY_X:
- if (event.jaxis.value < -
1024
)
+ if (event.jaxis.value < -
JOYSTICK_DEAD_ZONE
)
tux.input.left = DOWN;
tux.input.left = DOWN;
- else if (event.jaxis.value >
1024
)
+ else if (event.jaxis.value >
JOYSTICK_DEAD_ZONE
)
tux.input.left = UP;
tux.input.left = UP;
- if (event.jaxis.value >
1024
)
+ if (event.jaxis.value >
JOYSTICK_DEAD_ZONE
)
tux.input.right = DOWN;
tux.input.right = DOWN;
- else if (event.jaxis.value < -
1024
)
+ else if (event.jaxis.value < -
JOYSTICK_DEAD_ZONE
)
tux.input.right = UP;
break;
case JOY_Y:
tux.input.right = UP;
break;
case JOY_Y:
- if (event.jaxis.value >
1024
)
+ if (event.jaxis.value >
JOYSTICK_DEAD_ZONE
)
tux.input.down = DOWN;
tux.input.down = DOWN;
- else if (event.jaxis.value < -
1024
)
+ else if (event.jaxis.value < -
JOYSTICK_DEAD_ZONE
)
tux.input.down = UP;
/* Handle joystick for the menu */
tux.input.down = UP;
/* Handle joystick for the menu */