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
21 #include "../app/globals.h"
25 /** The datadir prefix prepended when loading game data file */
27 std::string package_symbol_name;
28 std::string package_name;
29 std::string package_version;
31 JoystickKeymap::JoystickKeymap()
43 JoystickKeymap joystick_keymap;
46 MouseCursor * mouse_cursor;
55 char* level_startup_file = 0;
56 bool launch_leveleditor_mode = false;
57 bool launch_worldmap_mode = false;
59 /* SuperTux directory ($HOME/.supertux) and save directory($HOME/.supertux/save) */
60 char *st_dir, *st_save_dir;
64 /* Returns 1 for every button event, 2 for a quit event and 0 for no event. */
65 int wait_for_event(SDL_Event& event,unsigned int min_delay, unsigned int max_delay, bool empty_events)
74 if(max_delay < min_delay)
75 max_delay = min_delay;
77 maxdelay.start(max_delay);
78 mindelay.start(min_delay);
81 while (SDL_PollEvent(&event))
86 for(i = 0; maxdelay.check() || !i; ++i)
88 while (SDL_PollEvent(&event))
92 if (event.type == SDL_QUIT)
94 /* Quit event - quit: */
97 else if (event.type == SDL_KEYDOWN)
99 /* Keypress - skip intro: */
103 else if (event.type == SDL_JOYBUTTONDOWN)
105 /* Fire button - skip intro: */
109 else if (event.type == SDL_MOUSEBUTTONDOWN)
111 /* Mouse button - skip intro: */
122 } //namespace SuperTux