[Super-tux-commit] supertux/src gameloop.cpp,1.165,1.166 tile.cpp,1.35,1.36 worldmap.cpp,1.114,1.115
Brought to you by:
wkendrick
From: Matze B. <mat...@us...> - 2004-09-08 17:32:42
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8100/src Modified Files: gameloop.cpp tile.cpp worldmap.cpp Log Message: applied netsrot's patch Index: worldmap.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/worldmap.cpp,v retrieving revision 1.114 retrieving revision 1.115 diff -u -d -r1.114 -r1.115 --- worldmap.cpp 26 Aug 2004 23:05:03 -0000 1.114 +++ worldmap.cpp 8 Sep 2004 17:32:31 -0000 1.115 @@ -684,6 +684,18 @@ break; } break; + + case SDL_JOYHATMOTION: + if(event.jhat.value & SDL_HAT_UP) { + tux->set_direction(D_NORTH); + } else if(event.jhat.value & SDL_HAT_DOWN) { + tux->set_direction(D_SOUTH); + } else if(event.jhat.value & SDL_HAT_LEFT) { + tux->set_direction(D_WEST); + } else if(event.jhat.value & SDL_HAT_RIGHT) { + tux->set_direction(D_EAST); + } + break; case SDL_JOYAXISMOTION: if (event.jaxis.axis == joystick_keymap.x_axis) Index: tile.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/tile.cpp,v retrieving revision 1.35 retrieving revision 1.36 diff -u -d -r1.35 -r1.36 --- tile.cpp 20 Jul 2004 18:04:48 -0000 1.35 +++ tile.cpp 8 Sep 2004 17:32:31 -0000 1.36 @@ -20,6 +20,7 @@ #include <cmath> #include <cassert> +#include <cmath> #include <iostream> #include "app/globals.h" Index: gameloop.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/gameloop.cpp,v retrieving revision 1.165 retrieving revision 1.166 diff -u -d -r1.165 -r1.166 --- gameloop.cpp 6 Aug 2004 11:43:09 -0000 1.165 +++ gameloop.cpp 8 Sep 2004 17:32:31 -0000 1.166 @@ -431,6 +431,27 @@ tux.input.down = UP; } break; + + case SDL_JOYHATMOTION: + if(event.jhat.value & SDL_HAT_UP) { + tux.input.up = DOWN; + tux.input.down = UP; + } else if(event.jhat.value & SDL_HAT_DOWN) { + tux.input.up = UP; + tux.input.down = DOWN; + } else if(event.jhat.value & SDL_HAT_LEFT) { + tux.input.left = DOWN; + tux.input.right = UP; + } else if(event.jhat.value & SDL_HAT_RIGHT) { + tux.input.left = UP; + tux.input.right = DOWN; + } else if(event.jhat.value == SDL_HAT_CENTERED) { + tux.input.left = UP; + tux.input.right = UP; + tux.input.up = UP; + tux.input.down = UP; + } + break; case SDL_JOYBUTTONDOWN: if (event.jbutton.button == joystick_keymap.a_button) |