projects
/
supertux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
4b68076
)
- fixed joystick support a bit for analog joysticks, menu is still not really useable...
author
Ingo Ruhnke
<grumbel@gmx.de>
Sun, 18 Jan 2004 13:30:10 +0000
(13:30 +0000)
committer
Ingo Ruhnke
<grumbel@gmx.de>
Sun, 18 Jan 2004 13:30:10 +0000
(13:30 +0000)
SVN-Revision: 96
src/gameloop.c
patch
|
blob
|
history
src/title.c
patch
|
blob
|
history
diff --git
a/src/gameloop.c
b/src/gameloop.c
index
3f70658
..
b9f9596
100644
(file)
--- a/
src/gameloop.c
+++ b/
src/gameloop.c
@@
-217,20
+217,21
@@
void game_event(void)
switch(event.jaxis.axis)
{
case JOY_X:
switch(event.jaxis.axis)
{
case JOY_X:
- if (event.jaxis.value < -256)
+ printf("X: %d\n", event.jaxis.value);
+ if (event.jaxis.value < -1024)
tux.input.left = DOWN;
tux.input.left = DOWN;
- else
+ else
if (event.jaxis.value > 1024)
tux.input.left = UP;
tux.input.left = UP;
- if (event.jaxis.value >
256
)
+ if (event.jaxis.value >
1024
)
tux.input.right = DOWN;
tux.input.right = DOWN;
- else
+ else
if (event.jaxis.value < -1024)
tux.input.right = UP;
break;
case JOY_Y:
tux.input.right = UP;
break;
case JOY_Y:
- if (event.jaxis.value >
256
)
+ if (event.jaxis.value >
1024
)
tux.input.down = DOWN;
tux.input.down = DOWN;
- else
+ else
if (event.jaxis.value < -1024)
tux.input.down = UP;
/* Handle joystick for the menu */
tux.input.down = UP;
/* Handle joystick for the menu */
diff --git
a/src/title.c
b/src/title.c
index
0c66575
..
a7f5a3e
100644
(file)
--- a/
src/title.c
+++ b/
src/title.c
@@
-109,11
+109,11
@@
int title(void)
}
}
#ifdef JOY_YES
}
}
#ifdef JOY_YES
- else if (event.type == SDL_JOYAXISMOTION)
+ else if (event.type == SDL_JOYAXISMOTION
&& event.jaxis.axis == JOY_Y
)
{
{
- if (event.jaxis.value >
256
)
+ if (event.jaxis.value >
1024
)
menuaction = MN_DOWN;
menuaction = MN_DOWN;
- else
+ else
if (event.jaxis.value < -1024)
menuaction = MN_UP;
}
else if (event.type == SDL_JOYBUTTONDOWN)
menuaction = MN_UP;
}
else if (event.type == SDL_JOYBUTTONDOWN)