4 // Copyright (C) 2004 SuperTux Development Team, see AUTHORS for details
6 // This program is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU General Public License
8 // as published by the Free Software Foundation; either version 2
9 // of the License, or (at your option) any later version.
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License
17 // along with this program; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
23 /** The datadir prefix prepended when loading game data file */
26 JoystickKeymap::JoystickKeymap()
38 JoystickKeymap joystick_keymap;
48 Text* white_small_text;
51 MouseCursor * mouse_cursor;
58 float game_speed = 1.0f;
61 char* level_startup_file = 0;
62 bool launch_leveleditor_mode = false;
64 /* SuperTux directory ($HOME/.supertux) and save directory($HOME/.supertux/save) */
65 char *st_dir, *st_save_dir;
69 /* Returns 1 for every button event, 2 for a quit event and 0 for no event. */
70 int wait_for_event(SDL_Event& event,unsigned int min_delay, unsigned int max_delay, bool empty_events)
79 if(max_delay < min_delay)
80 max_delay = min_delay;
82 maxdelay.start(max_delay);
83 mindelay.start(min_delay);
86 while (SDL_PollEvent(&event))
91 for(i = 0; maxdelay.check() || !i; ++i)
93 while (SDL_PollEvent(&event))
97 if (event.type == SDL_QUIT)
99 /* Quit event - quit: */
102 else if (event.type == SDL_KEYDOWN)
104 /* Keypress - skip intro: */
108 else if (event.type == SDL_JOYBUTTONDOWN)
110 /* Fire button - skip intro: */
114 else if (event.type == SDL_MOUSEBUTTONDOWN)
116 /* Mouse button - skip intro: */