Added supertux/globals.?pp to collect all the random global variables
authorIngo Ruhnke <grumbel@gmx.de>
Wed, 18 Nov 2009 03:37:40 +0000 (03:37 +0000)
committerIngo Ruhnke <grumbel@gmx.de>
Wed, 18 Nov 2009 03:37:40 +0000 (03:37 +0000)
SVN-Revision: 6027

52 files changed:
src/gui/button.cpp
src/gui/button_group.cpp
src/gui/menu.cpp
src/gui/mousecursor.cpp
src/object/background.cpp
src/object/bullet.cpp
src/object/camera.cpp
src/object/cloud_particle_system.cpp
src/object/display_effect.cpp
src/object/falling_coin.cpp
src/object/fireworks.cpp
src/object/floating_image.cpp
src/object/ghost_particle_system.cpp
src/object/level_time.cpp
src/object/magicblock.cpp
src/object/particles.cpp
src/object/particlesystem.cpp
src/object/particlesystem_interactive.cpp
src/object/player.cpp
src/object/snow_particle_system.cpp
src/object/sprite_particle.cpp
src/object/text_object.cpp
src/object/thunderstorm.cpp
src/object/tilemap.cpp
src/scripting/functions.cpp
src/supertux/console.cpp
src/supertux/fadeout.cpp
src/supertux/game_session.cpp
src/supertux/gameconfig.cpp
src/supertux/globals.cpp [new file with mode: 0644]
src/supertux/globals.hpp [new file with mode: 0644]
src/supertux/info_box.cpp
src/supertux/levelintro.cpp
src/supertux/main.cpp
src/supertux/main.hpp
src/supertux/mainloop.cpp
src/supertux/options_menu.cpp
src/supertux/player_status.cpp
src/supertux/sector.cpp
src/supertux/shrinkfade.cpp
src/supertux/statistics.cpp
src/supertux/textscroller.cpp
src/supertux/title_screen.cpp
src/trigger/climbable.cpp
src/trigger/secretarea_trigger.cpp
src/video/drawing_context.cpp
src/video/gl/gl_lightmap.cpp
src/video/gl/gl_renderer.cpp
src/video/sdl/sdl_surface_data.hpp
src/video/sdl/sdl_texture.cpp
src/worldmap/tux.cpp
src/worldmap/worldmap.cpp

index 937bf6c..7a57620 100644 (file)
@@ -16,7 +16,7 @@
 
 #include "gui/button.hpp"
 
-#include "supertux/main.hpp"
+#include "supertux/globals.hpp"
 #include "video/drawing_context.hpp"
 
 Font* Button::info_font = 0;
index 0e910e9..00e37b5 100644 (file)
@@ -16,7 +16,7 @@
 
 #include "gui/button_group.hpp"
 
-#include "supertux/main.hpp"
+#include "supertux/globals.hpp"
 #include "video/drawing_context.hpp"
 
 extern SDL_Surface* g_screen;
index d92fff9..77fa403 100644 (file)
@@ -21,7 +21,7 @@
 #include "control/joystickkeyboardcontroller.hpp"
 #include "gui/menu_item.hpp"
 #include "gui/mousecursor.hpp"
-#include "supertux/main.hpp"
+#include "supertux/globals.hpp"
 #include "supertux/mainloop.hpp"
 #include "supertux/resources.hpp"
 #include "supertux/timer.hpp"
index 7723b36..b40a111 100644 (file)
@@ -18,7 +18,7 @@
 
 #include <SDL.h>
 
-#include "supertux/main.hpp"
+#include "supertux/globals.hpp"
 #include "video/drawing_context.hpp"
 
 MouseCursor* MouseCursor::current_ = 0;
index 1c3a9b9..619645b 100644 (file)
@@ -15,7 +15,7 @@
 //  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 #include "object/background.hpp"
-#include "supertux/main.hpp"
+#include "supertux/globals.hpp"
 #include "supertux/object_factory.hpp"
 #include "util/reader.hpp"
 
index 2161e3b..a4da53a 100644 (file)
@@ -17,7 +17,7 @@
 #include "object/bullet.hpp"
 #include "object/camera.hpp"
 #include "sprite/sprite_manager.hpp"
-#include "supertux/main.hpp"
+#include "supertux/globals.hpp"
 #include "supertux/sector.hpp"
 
 namespace {
index 48cd7a3..9c858d3 100644 (file)
@@ -26,7 +26,7 @@
 #include "object/player.hpp"
 #include "scripting/camera.hpp"
 #include "scripting/squirrel_util.hpp"
-#include "supertux/main.hpp"
+#include "supertux/globals.hpp"
 #include "supertux/sector.hpp"
 
 /* this is the fractional distance toward the peek
index 0e2659e..dda8c69 100644 (file)
@@ -19,7 +19,7 @@
 #include <math.h>
 
 #include "math/random_generator.hpp"
-#include "supertux/main.hpp"
+#include "supertux/globals.hpp"
 #include "video/drawing_context.hpp"
 
 CloudParticleSystem::CloudParticleSystem() :
index 924e7e7..ef46f6e 100644 (file)
@@ -17,7 +17,7 @@
 #include "object/display_effect.hpp"
 
 #include "scripting/squirrel_util.hpp"
-#include "supertux/main.hpp"
+#include "supertux/globals.hpp"
 #include "video/drawing_context.hpp"
 
 static const float BORDER_SIZE = 75;
index 73b9302..66b2c2e 100644 (file)
@@ -17,7 +17,7 @@
 #include "object/falling_coin.hpp"
 
 #include "sprite/sprite_manager.hpp"
-#include "supertux/main.hpp"
+#include "supertux/globals.hpp"
 
 FallingCoin::FallingCoin(const Vector& start_position, const int vel_x) :
   physic(),
index 6532c89..a903fa8 100644 (file)
@@ -19,7 +19,7 @@
 #include "object/camera.hpp"
 #include "object/fireworks.hpp"
 #include "object/particles.hpp"
-#include "supertux/main.hpp"
+#include "supertux/globals.hpp"
 #include "supertux/sector.hpp"
 #include "video/drawing_context.hpp"
 
index 07aa120..c7e586a 100644 (file)
@@ -17,7 +17,7 @@
 #include "object/floating_image.hpp"
 #include "sprite/sprite.hpp"
 #include "sprite/sprite_manager.hpp"
-#include "supertux/main.hpp"
+#include "supertux/globals.hpp"
 
 FloatingImage::FloatingImage(const std::string& spritefile) :
   sprite(),
index 4b493a4..aca6ccd 100644 (file)
@@ -19,7 +19,7 @@
 #include <math.h>
 
 #include "math/random_generator.hpp"
-#include "supertux/main.hpp"
+#include "supertux/globals.hpp"
 #include "video/drawing_context.hpp"
 
 //FIXME: Sometimes both ghosts have the same image
index 1f92c11..26de88d 100644 (file)
@@ -19,7 +19,7 @@
 #include "object/player.hpp"
 #include "scripting/level_time.hpp"
 #include "scripting/squirrel_util.hpp"
-#include "supertux/main.hpp"
+#include "supertux/globals.hpp"
 #include "supertux/object_factory.hpp"
 #include "supertux/resources.hpp"
 #include "supertux/sector.hpp"
index 973c764..4081cf9 100644 (file)
@@ -23,7 +23,7 @@
 #include "object/camera.hpp"
 #include "object/magicblock.hpp"
 #include "sprite/sprite.hpp"
-#include "supertux/main.hpp"
+#include "supertux/globals.hpp"
 #include "supertux/object_factory.hpp"
 #include "supertux/sector.hpp"
 
index 18432ea..910136b 100644 (file)
@@ -20,7 +20,7 @@
 
 #include "math/random_generator.hpp"
 #include "object/camera.hpp"
-#include "supertux/main.hpp"
+#include "supertux/globals.hpp"
 #include "supertux/sector.hpp"
 #include "video/drawing_context.hpp"
 
index e6e18ca..7684696 100644 (file)
@@ -19,7 +19,7 @@
 #include <math.h>
 
 #include "math/random_generator.hpp"
-#include "supertux/main.hpp"
+#include "supertux/globals.hpp"
 #include "video/drawing_context.hpp"
 
 ParticleSystem::ParticleSystem(float max_particle_size) :
index 5347f13..1628af6 100644 (file)
@@ -15,7 +15,6 @@
 //  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 #include "object/particlesystem_interactive.hpp"
-#include "supertux/main.hpp"
 
 #include "math/aatriangle.hpp"
 #include "math/random_generator.hpp"
@@ -23,6 +22,7 @@
 #include "object/rainsplash.hpp"
 #include "object/tilemap.hpp"
 #include "supertux/collision.hpp"
+#include "supertux/globals.hpp"
 #include "supertux/tile.hpp"
 
 //TODO: Find a way to make rain collide with objects like bonus blocks
index 1de4610..052a4c5 100644 (file)
@@ -30,7 +30,7 @@
 #include "object/sprite_particle.hpp"
 #include "scripting/squirrel_util.hpp"
 #include "supertux/game_session.hpp"
-#include "supertux/main.hpp"
+#include "supertux/globals.hpp"
 #include "supertux/sector.hpp"
 #include "supertux/tile.hpp"
 #include "trigger/climbable.hpp"
index 406ca08..a6a2add 100644 (file)
@@ -19,7 +19,7 @@
 #include <math.h>
 
 #include "math/random_generator.hpp"
-#include "supertux/main.hpp"
+#include "supertux/globals.hpp"
 #include "video/drawing_context.hpp"
 
 SnowParticleSystem::SnowParticleSystem()
index 07d8732..21725d8 100644 (file)
@@ -17,7 +17,7 @@
 
 #include "object/camera.hpp"
 #include "object/sprite_particle.hpp"
-#include "supertux/main.hpp"
+#include "supertux/globals.hpp"
 #include "supertux/sector.hpp"
 
 SpriteParticle::SpriteParticle(std::string sprite_name, std::string action, 
index efe8708..d40bfbf 100644 (file)
@@ -17,7 +17,7 @@
 #include "object/text_object.hpp"
 
 #include "scripting/squirrel_util.hpp"
-#include "supertux/main.hpp"
+#include "supertux/globals.hpp"
 #include "supertux/resources.hpp"
 #include "video/drawing_context.hpp"
 
index cd92605..61e60df 100644 (file)
@@ -19,7 +19,7 @@
 #include "audio/sound_manager.hpp"
 #include "object/electrifier.hpp"
 #include "scripting/squirrel_util.hpp"
-#include "supertux/main.hpp"
+#include "supertux/globals.hpp"
 #include "supertux/object_factory.hpp"
 #include "supertux/sector.hpp"
 #include "util/reader.hpp"
index 535a807..7dd4bb8 100644 (file)
@@ -19,7 +19,7 @@
 #include "object/tilemap.hpp"
 #include "scripting/squirrel_util.hpp"
 #include "scripting/tilemap.hpp"
-#include "supertux/main.hpp"
+#include "supertux/globals.hpp"
 #include "supertux/object_factory.hpp"
 #include "supertux/tile_manager.hpp"
 #include "supertux/tile_set.hpp"
index 1f8ed94..853f204 100644 (file)
@@ -24,7 +24,7 @@
 #include "supertux/fadeout.hpp"
 #include "supertux/game_session.hpp"
 #include "supertux/gameconfig.hpp"
-#include "supertux/main.hpp"
+#include "supertux/globals.hpp"
 #include "supertux/mainloop.hpp"
 #include "supertux/sector.hpp"
 #include "supertux/shrinkfade.hpp"
index ce03f40..860869b 100644 (file)
@@ -22,7 +22,7 @@
 #include "physfs/ifile_stream.hpp"
 #include "scripting/squirrel_util.hpp"
 #include "supertux/gameconfig.hpp"
-#include "supertux/main.hpp"
+#include "supertux/globals.hpp"
 #include "video/drawing_context.hpp"
 
 /// speed (pixels/s) the console closes
index 58d2ecd..8259beb 100644 (file)
@@ -15,7 +15,7 @@
 //  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 #include "supertux/fadeout.hpp"
-#include "supertux/main.hpp"
+#include "supertux/globals.hpp"
 #include "video/drawing_context.hpp"
 
 FadeOut::FadeOut(float fade_time, Color color)
index 40242e1..7da344b 100644 (file)
@@ -32,7 +32,7 @@
 #include "scripting/squirrel_util.hpp"
 #include "supertux/gameconfig.hpp"
 #include "supertux/levelintro.hpp"
-#include "supertux/main.hpp"
+#include "supertux/globals.hpp"
 #include "supertux/mainloop.hpp"
 #include "supertux/options_menu.hpp"
 #include "supertux/sector.hpp"
index dbef165..be8bb70 100644 (file)
@@ -23,7 +23,7 @@
 #include "lisp/lisp.hpp"
 #include "lisp/writer.hpp"
 #include "lisp/parser.hpp"
-#include "supertux/main.hpp"
+#include "supertux/globals.hpp"
 
 Config* g_config = 0;
 
diff --git a/src/supertux/globals.cpp b/src/supertux/globals.cpp
new file mode 100644 (file)
index 0000000..1089c13
--- /dev/null
@@ -0,0 +1,27 @@
+//  SuperTux
+//  Copyright (C) 2009 Ingo Ruhnke <grumbel@gmx.de>
+//
+//  This program is free software: you can redistribute it and/or modify
+//  it under the terms of the GNU General Public License as published by
+//  the Free Software Foundation, either version 3 of the License, or
+//  (at your option) any later version.
+//
+//  This program is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+//  GNU General Public License for more details.
+//
+//  You should have received a copy of the GNU General Public License
+//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+#include "supertux/globals.hpp"
+#include "tinygettext/tinygettext.hpp"
+
+SDL_Surface* g_screen;
+JoystickKeyboardController* g_main_controller = 0;
+TinyGetText::DictionaryManager dictionary_manager;
+
+int SCREEN_WIDTH;
+int SCREEN_HEIGHT;
+
+/* EOF */
diff --git a/src/supertux/globals.hpp b/src/supertux/globals.hpp
new file mode 100644 (file)
index 0000000..eb9a252
--- /dev/null
@@ -0,0 +1,40 @@
+//  SuperTux
+//  Copyright (C) 2009 Ingo Ruhnke <grumbel@gmx.de>
+//
+//  This program is free software: you can redistribute it and/or modify
+//  it under the terms of the GNU General Public License as published by
+//  the Free Software Foundation, either version 3 of the License, or
+//  (at your option) any later version.
+//
+//  This program is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+//  GNU General Public License for more details.
+//
+//  You should have received a copy of the GNU General Public License
+//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+#ifndef HEADER_SUPERTUX_SUPERTUX_GLOBALS_HPP
+#define HEADER_SUPERTUX_SUPERTUX_GLOBALS_HPP
+
+#include <SDL.h>
+
+/** The width of the display (this is a logical value, not the
+    physical value, since aspect_ration and projection_area might
+    shrink or scale things) */
+extern int SCREEN_WIDTH;
+
+/** The width of the display (this is a logical value, not the
+    physical value, since aspect_ration and projection_area might
+    shrink or scale things) */
+extern int SCREEN_HEIGHT;
+
+// global variables
+class  JoystickKeyboardController;
+extern JoystickKeyboardController* g_main_controller;
+
+extern SDL_Surface* g_screen;
+
+#endif
+
+/* EOF */
index 323bbfc..c6d997f 100644 (file)
@@ -16,7 +16,7 @@
 
 #include "supertux/info_box.hpp"
 
-#include "supertux/main.hpp"
+#include "supertux/globals.hpp"
 #include "supertux/info_box_line.hpp"
 #include "util/log.hpp"
 #include "video/drawing_context.hpp"
index cc5dec4..16df722 100644 (file)
@@ -20,7 +20,7 @@
 #include "math/random_generator.hpp"
 #include "sprite/sprite_manager.hpp"
 #include "supertux/fadeout.hpp"
-#include "supertux/main.hpp"
+#include "supertux/globals.hpp"
 #include "supertux/mainloop.hpp"
 #include "supertux/resources.hpp"
 #include "util/gettext.hpp"
index 6e150c2..91943bd 100644 (file)
@@ -36,21 +36,16 @@ namespace supertux_apple {
 #include "supertux/gameconfig.hpp"
 #include "supertux/mainloop.hpp"
 #include "supertux/resources.hpp"
+#include "supertux/globals.hpp"
 #include "supertux/title_screen.hpp"
 #include "util/file_system.hpp"
 #include "util/gettext.hpp"
 #include "video/drawing_context.hpp"
+#include "supertux/globals.hpp"
 #include "worldmap/worldmap.hpp"
 
 namespace { DrawingContext *context_pointer; }
 
-SDL_Surface* g_screen;
-JoystickKeyboardController* g_main_controller = 0;
-TinyGetText::DictionaryManager dictionary_manager;
-
-int SCREEN_WIDTH;
-int SCREEN_HEIGHT;
-
 static void init_config()
 {
   g_config = new Config();
index 4bfe7e6..e034feb 100644 (file)
 void init_video();
 void wait_for_event(float min_delay, float max_delay);
 
-/** The width of the display (this is a logical value, not the
-    physical value, since aspect_ration and projection_area might
-    shrink or scale things) */
-extern int SCREEN_WIDTH;
-
-/** The width of the display (this is a logical value, not the
-    physical value, since aspect_ration and projection_area might
-    shrink or scale things) */
-extern int SCREEN_HEIGHT;
-
-// global variables
-class  JoystickKeyboardController;
-extern JoystickKeyboardController* g_main_controller;
-
 int supertux_main(int argc, char** argv);
 
 #endif
index d6dd0a3..7fe5d5c 100644 (file)
@@ -24,6 +24,7 @@
 #include "supertux/constants.hpp"
 #include "supertux/console.hpp"
 #include "supertux/gameconfig.hpp"
+#include "supertux/globals.hpp"
 #include "supertux/main.hpp"
 #include "supertux/player_status.hpp"
 #include "supertux/resources.hpp"
index e218a10..f77b3dd 100644 (file)
@@ -22,6 +22,7 @@
 #include "gui/menu.hpp"
 #include "gui/menu_item.hpp"
 #include "supertux/gameconfig.hpp"
+#include "supertux/globals.hpp"
 #include "supertux/main.hpp"
 #include "supertux/profile_menu.hpp"
 #include "supertux/language_menu.hpp"
index c194679..97a124d 100644 (file)
@@ -20,7 +20,7 @@
 #include "audio/sound_manager.hpp"
 #include "lisp/lisp.hpp"
 #include "util/writer.hpp"
-#include "supertux/main.hpp"
+#include "supertux/globals.hpp"
 #include "supertux/player_status.hpp"
 #include "supertux/resources.hpp"
 #include "supertux/timer.hpp"
index d2ea9b1..11f5367 100644 (file)
@@ -48,7 +48,7 @@
 #include "supertux/collision.hpp"
 #include "supertux/constants.hpp"
 #include "supertux/level.hpp"
-#include "supertux/main.hpp"
+#include "supertux/globals.hpp"
 #include "supertux/object_factory.hpp"
 #include "supertux/spawn_point.hpp"
 #include "supertux/tile.hpp"
index e83d081..03ca3c1 100644 (file)
@@ -14,7 +14,7 @@
 //  You should have received a copy of the GNU General Public License
 //  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-#include "supertux/main.hpp"
+#include "supertux/globals.hpp"
 #include "supertux/shrinkfade.hpp"
 #include "video/drawing_context.hpp"
 
index a273715..3cea415 100644 (file)
@@ -22,7 +22,7 @@
 #include <limits>
 
 #include "scripting/squirrel_util.hpp"
-#include "supertux/main.hpp"
+#include "supertux/globals.hpp"
 #include "supertux/resources.hpp"
 #include "util/gettext.hpp"
 #include "video/drawing_context.hpp"
index 84f0737..49ac9c2 100644 (file)
@@ -22,7 +22,7 @@
 #include "lisp/parser.hpp"
 #include "supertux/fadeout.hpp"
 #include "supertux/info_box_line.hpp"
-#include "supertux/main.hpp"
+#include "supertux/globals.hpp"
 #include "supertux/mainloop.hpp"
 #include "supertux/resources.hpp"
 #include "video/drawing_context.hpp"
index 55fb4e9..17fdac0 100644 (file)
@@ -32,7 +32,7 @@
 #include "object/player.hpp"
 #include "supertux/fadeout.hpp"
 #include "supertux/gameconfig.hpp"
-#include "supertux/main.hpp"
+#include "supertux/globals.hpp"
 #include "supertux/mainloop.hpp"
 #include "supertux/options_menu.hpp"
 #include "supertux/resources.hpp"
index 416fb00..6fc957f 100644 (file)
@@ -17,7 +17,7 @@
 #include "trigger/climbable.hpp"
 
 #include "object/player.hpp"
-#include "supertux/main.hpp"
+#include "supertux/globals.hpp"
 #include "supertux/object_factory.hpp"
 #include "util/gettext.hpp"
 #include "util/reader.hpp"
index 8f3366b..d333eab 100644 (file)
@@ -18,7 +18,7 @@
 
 #include "object/tilemap.hpp"
 #include "supertux/level.hpp"
-#include "supertux/main.hpp"
+#include "supertux/globals.hpp"
 #include "supertux/object_factory.hpp"
 #include "supertux/resources.hpp"
 #include "supertux/sector.hpp"
index 82890be..90cb1db 100644 (file)
@@ -21,7 +21,7 @@
 
 #include "obstack/obstackpp.hpp"
 #include "supertux/gameconfig.hpp"
-#include "supertux/main.hpp"
+#include "supertux/globals.hpp"
 #include "video/drawing_request.hpp"
 #include "video/lightmap.hpp"
 #include "video/renderer.hpp"
index fe77db3..120aae6 100644 (file)
@@ -28,7 +28,7 @@
 
 #include "obstack/obstackpp.hpp"
 #include "supertux/gameconfig.hpp"
-#include "supertux/main.hpp"
+#include "supertux/globals.hpp"
 #include "video/lightmap.hpp"
 #include "video/drawing_context.hpp"
 #include "video/drawing_request.hpp"
index e05f755..41c8eec 100644 (file)
@@ -22,7 +22,7 @@
 #include <physfs.h>
 
 #include "supertux/gameconfig.hpp"
-#include "supertux/main.hpp"
+#include "supertux/globals.hpp"
 #include "video/drawing_request.hpp"
 #include "video/gl/gl_surface_data.hpp"
 #include "video/gl/gl_texture.hpp"
index f3ee5c1..47268ee 100644 (file)
@@ -20,7 +20,7 @@
 #include <config.h>
 
 #include "supertux/gameconfig.hpp"
-#include "supertux/main.hpp"
+#include "supertux/globals.hpp"
 #include "video/surface.hpp"
 #include "video/texture.hpp"
 
index 412c776..0bdd714 100644 (file)
@@ -17,7 +17,7 @@
 #include <config.h>
 
 #include "supertux/gameconfig.hpp"
-#include "supertux/main.hpp"
+#include "supertux/globals.hpp"
 #include "video/color.hpp"
 #include "video/sdl/sdl_texture.hpp"
 
index 7fca49a..a98cfd9 100644 (file)
@@ -19,7 +19,7 @@
 #include "scripting/squirrel_util.hpp"
 #include "sprite/sprite.hpp"
 #include "sprite/sprite_manager.hpp"
-#include "supertux/main.hpp"
+#include "supertux/globals.hpp"
 #include "supertux/player_status.hpp"
 #include "supertux/tile.hpp"
 #include "worldmap/level.hpp"
index 1321dff..cbf550f 100644 (file)
@@ -43,7 +43,7 @@
 #include "sprite/sprite.hpp"
 #include "sprite/sprite_manager.hpp"
 #include "supertux/game_session.hpp"
-#include "supertux/main.hpp"
+#include "supertux/globals.hpp"
 #include "supertux/mainloop.hpp"
 #include "supertux/options_menu.hpp"
 #include "supertux/player_status.hpp"