24950179b0dd39d3d3e231e3f1158b2698c7f0dd
[supertux.git] / lib / app / globals.h
1 //  $Id$
2 // 
3 //  SuperTux
4 //  Copyright (C) 2004 Bill Kendrick <bill@newbreedsoftware.com>
5 //                     Tobias Glaesser <tobi.web@gmx.de>
6 //                     Ingo Ruhnke <grumbel@gmx.de>
7 //
8 //  This program is free software; you can redistribute it and/or
9 //  modify it under the terms of the GNU General Public License
10 //  as published by the Free Software Foundation; either version 2
11 //  of the License, or (at your option) any later version.
12 //
13 //  This program is distributed in the hope that it will be useful,
14 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
15 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 //  GNU General Public License for more details.
17 // 
18 //  You should have received a copy of the GNU General Public License
19 //  along with this program; if not, write to the Free Software
20 //  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
21
22 #ifndef SUPERTUX_GLOBALS_H
23 #define SUPERTUX_GLOBALS_H
24
25 #include <string>
26
27 #include "SDL.h"
28
29 #include "../video/font.h"
30 #include "../gui/menu.h"
31 #include "../gui/mousecursor.h"
32
33 namespace SuperTux
34   {
35
36   extern std::string datadir;
37
38   struct JoystickKeymap
39     {
40       int a_button;
41       int b_button;
42       int start_button;
43
44       int x_axis;
45       int y_axis;
46
47       int dead_zone;
48
49       JoystickKeymap();
50     };
51
52   extern JoystickKeymap joystick_keymap;
53
54   extern SDL_Surface* screen;
55   extern Font* gold_text;
56   extern Font* white_text;
57   extern Font* blue_text;
58   extern Font* gray_text;
59   extern Font* white_small_text;
60   extern Font* white_big_text;
61   extern Font* yellow_nums;
62
63   extern MouseCursor * mouse_cursor;
64
65   extern bool use_gl;
66   extern bool use_joystick;
67   extern bool use_fullscreen;
68   extern bool debug_mode;
69   extern bool show_fps;
70
71   /** The number of the joystick that will be use in the game */
72   extern int joystick_num;
73   extern char* level_startup_file;
74   extern bool launch_leveleditor_mode;
75   extern bool launch_worldmap_mode;
76
77   /* SuperTux directory ($HOME/.supertux) and save directory($HOME/.supertux/save) */
78   extern char* st_dir;
79   extern char* st_save_dir;
80
81   extern float game_speed;
82   extern SDL_Joystick * js;
83
84   int wait_for_event(SDL_Event& event,unsigned int min_delay = 0, unsigned int max_delay = 0, bool empty_events = false);
85
86 } //namespace SuperTux
87
88 #endif /* SUPERTUX_GLOBALS_H */