Update of /cvsroot/super-tux/supertux/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv716/src
Modified Files:
gameloop.cpp
Log Message:
Just made the keys UP code go when the menu is called.
This way they are only done once, instead of every time. Doesn't solve anything, it's just cleaner IMO.
Index: gameloop.cpp
===================================================================
RCS file: /cvsroot/super-tux/supertux/src/gameloop.cpp,v
retrieving revision 1.130
retrieving revision 1.131
diff -u -d -r1.130 -r1.131
--- gameloop.cpp 17 May 2004 10:11:43 -0000 1.130
+++ gameloop.cpp 17 May 2004 14:11:03 -0000 1.131
@@ -189,6 +189,16 @@
}
else if (!Menu::current())
{
+ /* Tell Tux that the keys are all down, otherwise
+ it could have nasty bugs, like going allways to the right
+ or whatever that key does */
+ Player& tux = *world->get_tux();
+ tux.key_event((SDLKey)keymap.jump, UP);
+ tux.key_event((SDLKey)keymap.duck, UP);
+ tux.key_event((SDLKey)keymap.left, UP);
+ tux.key_event((SDLKey)keymap.right, UP);
+ tux.key_event((SDLKey)keymap.fire, UP);
+
Menu::set_current(game_menu);
st_pause_ticks_start();
}
@@ -263,18 +273,8 @@
if (Menu::current())
{
Menu::current()->event(event);
- if(!Menu::current())
- st_pause_ticks_stop();
-
- /* Tell Tux that the keys are all down, otherwise
- it could have nasty bugs, like going allways to the right
- or whatever that key does */
- Player& tux = *world->get_tux();
- tux.key_event((SDLKey)keymap.jump, UP);
- tux.key_event((SDLKey)keymap.duck, UP);
- tux.key_event((SDLKey)keymap.left, UP);
- tux.key_event((SDLKey)keymap.right, UP);
- tux.key_event((SDLKey)keymap.fire, UP);
+ if(!Menu::current())
+ st_pause_ticks_stop();
}
else
{
|