Move some more globals to supertux/globals.hpp
authorgrumbel <grumbel@837edb03-e0f3-0310-88ca-d4d4e8b29345>
Thu, 19 Nov 2009 17:46:40 +0000 (17:46 +0000)
committergrumbel <grumbel@837edb03-e0f3-0310-88ca-d4d4e8b29345>
Thu, 19 Nov 2009 17:46:40 +0000 (17:46 +0000)
git-svn-id: http://supertux.lethargik.org/svn/supertux/trunk/supertux@6054 837edb03-e0f3-0310-88ca-d4d4e8b29345

15 files changed:
src/audio/sound_manager.cpp
src/audio/sound_manager.hpp
src/gui/button_group.cpp
src/gui/menu.cpp
src/gui/mousecursor.cpp
src/lisp/parser.cpp
src/supertux/gameconfig.cpp
src/supertux/gameconfig.hpp
src/supertux/globals.cpp
src/supertux/globals.hpp
src/supertux/menu/keyboard_menu.cpp
src/supertux/menu/language_menu.cpp
src/supertux/menu/profile_menu.cpp
src/supertux/timer.cpp
src/supertux/timer.hpp

index 9a6b6c8..ce1579f 100644 (file)
  * supertux...
  */
 #ifdef alcGetString
-#undef alcGetString
+#  undef alcGetString
 #endif
-#define alcGetString(x,y) ""
+#  define alcGetString(x,y) ""
 #endif
 
-SoundManager* sound_manager = 0;
-
 SoundManager::SoundManager() :
   device(0), 
   context(0), 
index 7791df1..3744c62 100644 (file)
@@ -117,8 +117,6 @@ private:
   SoundManager& operator=(const SoundManager&);
 };
 
-extern SoundManager* sound_manager;
-
 #endif
 
 /* EOF */
index 00e37b5..0a2c7ed 100644 (file)
@@ -19,8 +19,6 @@
 #include "supertux/globals.hpp"
 #include "video/drawing_context.hpp"
 
-extern SDL_Surface* g_screen;
-
 ButtonGroup::ButtonGroup(Vector pos_, Vector buttons_size_, Vector buttons_box_) :
   pos(pos_), 
   buttons_size(buttons_size_), 
index 6e48496..48a4c87 100644 (file)
@@ -33,8 +33,6 @@
 static const float MENU_REPEAT_INITIAL = 0.4f;
 static const float MENU_REPEAT_RATE    = 0.1f;
 
-extern SDL_Surface* g_screen;
-
 Menu::Menu() :
   hit_item(),
   pos_x(),
index b40a111..7139d2e 100644 (file)
@@ -22,7 +22,6 @@
 #include "video/drawing_context.hpp"
 
 MouseCursor* MouseCursor::current_ = 0;
-extern SDL_Surface* g_screen;
 
 MouseCursor::MouseCursor(std::string cursor_file) : 
   mid_x(0), 
index c782551..c0fc5f1 100644 (file)
@@ -22,6 +22,7 @@
 #include "obstack/obstackpp.hpp"
 #include "physfs/ifile_stream.hpp"
 #include "physfs/ifile_streambuf.hpp"
+#include "supertux/globals.hpp"
 #include "tinygettext/tinygettext.hpp"
 
 #include "supertux/gameconfig.hpp"
index b9a2995..96dbdf7 100644 (file)
@@ -25,8 +25,6 @@
 #include "util/reader.hpp"
 #include "supertux/globals.hpp"
 
-Config* g_config = 0;
-
 Config::Config() :
   profile(1),
   fullscreen_width (800),
index 0fd89e6..6833c05 100644 (file)
@@ -63,8 +63,6 @@ public:
   std::string locale; /**< force SuperTux language to this locale, e.g. "de". A file "data/locale/xx.po" must exist for this to work. An empty string means autodetect. */
 };
 
-extern Config* g_config;
-
 #endif
 
 /* EOF */
index c85a446..a89efb1 100644 (file)
@@ -24,8 +24,15 @@ tinygettext::DictionaryManager dictionary_manager;
 int SCREEN_WIDTH;
 int SCREEN_HEIGHT;
 
-ScreenManager* g_screen_manager = NULL;
+ScreenManager* g_screen_manager = 0;
 
-TextureManager* texture_manager = NULL;
+TextureManager* texture_manager = 0;
+
+SoundManager* sound_manager = 0;
+
+Config* g_config = 0;
+
+float game_time = 0;
+float real_time = 0;
 
 /* EOF */
index 6fe934f..86a62b4 100644 (file)
@@ -19,7 +19,9 @@
 
 #include <SDL.h>
 
+class Config;
 class JoystickKeyboardController;
+class SoundManager;
 class ScreenManager;
 class TextureManager;
 
@@ -42,6 +44,13 @@ extern ScreenManager* g_screen_manager;
 
 extern TextureManager* texture_manager;
 
+extern SoundManager* sound_manager;
+
+extern Config* g_config;
+
+extern float game_time;
+extern float real_time;
+
 #endif
 
 /* EOF */
index a34b974..883adef 100644 (file)
@@ -19,6 +19,7 @@
 
 #include "util/gettext.hpp"
 #include "supertux/gameconfig.hpp"
+#include "supertux/globals.hpp"
 
 KeyboardMenu::KeyboardMenu(JoystickKeyboardController* _controller) :
   controller(_controller)
index 5e110b0..5b1fef3 100644 (file)
 #include "supertux/menu/language_menu.hpp"
 
 extern "C" {
-#include "findlocale.h"
+#include <findlocale.h>
 }
 #include "gui/menu_item.hpp"
 #include "gui/menu_manager.hpp"
 #include "supertux/gameconfig.hpp"
+#include "supertux/globals.hpp"
 
 enum {
   MNID_LANGUAGE_AUTO_DETECT = 0,
index 5ed5072..f61b76d 100644 (file)
@@ -21,6 +21,7 @@
 #include "gui/menu_manager.hpp"
 #include "gui/menu_item.hpp"
 #include "supertux/gameconfig.hpp"
+#include "supertux/globals.hpp"
 #include "util/gettext.hpp"
 
 ProfileMenu::ProfileMenu() 
index 8981c95..90e7655 100644 (file)
 
 #include "supertux/timer.hpp"
 
-float game_time = 0;
-float real_time = 0;
-
-Timer::Timer()
-  : period(0), cycle_start(0), cyclic(false)
+Timer::Timer() :
+  period(0), 
+cycle_start(0), 
+  cyclic(false)
 {
 }
 
index 9f2a540..646f0dd 100644 (file)
@@ -17,8 +17,7 @@
 #ifndef HEADER_SUPERTUX_SUPERTUX_TIMER_HPP
 #define HEADER_SUPERTUX_SUPERTUX_TIMER_HPP
 
-extern float game_time;
-extern float real_time;
+#include "supertux/globals.hpp"
 
 /**
  * Simple timer designed to be used in the update functions of objects