Split particlesystem_interactive.?pp into separate files
[supertux.git] / src / supertux / main.cpp
index d4c4f46..41e22ef 100644 (file)
@@ -22,6 +22,7 @@
 #include <SDL_image.h>
 #include <physfs.h>
 #include <iostream>
+#include <binreloc.h>
 
 #ifdef MACOSX
 namespace supertux_apple {
@@ -33,7 +34,6 @@ namespace supertux_apple {
 
 #include "addon/addon_manager.hpp"
 #include "audio/sound_manager.hpp"
-#include "binreloc/binreloc.h"
 #include "control/joystickkeyboardcontroller.hpp"
 #include "math/random_generator.hpp"
 #include "physfs/ifile_stream.hpp"
@@ -66,15 +66,17 @@ Main::init_config()
 void
 Main::init_tinygettext()
 {
+  dictionary_manager = new tinygettext::DictionaryManager();
   tinygettext::Log::set_log_info_callback(0);
-  dictionary_manager.set_filesystem(std::auto_ptr<tinygettext::FileSystem>(new PhysFSFileSystem));
+  dictionary_manager->set_filesystem(std::auto_ptr<tinygettext::FileSystem>(new PhysFSFileSystem));
 
-  dictionary_manager.add_directory("locale");
-  dictionary_manager.set_charset("UTF-8");
+  dictionary_manager->add_directory("locale");
+  dictionary_manager->set_charset("UTF-8");
 
   // Config setting "locale" overrides language detection
-  if (g_config->locale != "") {
-    dictionary_manager.set_language(tinygettext::Language::from_name(g_config->locale));
+  if (g_config->locale != "") 
+  {
+    dictionary_manager->set_language(tinygettext::Language::from_name(g_config->locale));
   }
 }
 
@@ -204,27 +206,27 @@ Main::init_physfs(const char* argv0)
 void
 Main::print_usage(const char* argv0)
 {
-  fprintf(stderr, _("Usage: %s [OPTIONS] [LEVELFILE]\n\n"), argv0);
-  fprintf(stderr,
-          _("Options:\n"
-            "  -f, --fullscreen             Run in fullscreen mode\n"
-            "  -w, --window                 Run in window mode\n"
-            "  -g, --geometry WIDTHxHEIGHT  Run SuperTux in given resolution\n"
-            "  -a, --aspect WIDTH:HEIGHT    Run SuperTux with given aspect ratio\n"
-            "  -d, --default                Reset video settings to default values\n"
-            "  --renderer RENDERER          Use sdl, opengl, or auto to render\n"
-            "  --disable-sfx                Disable sound effects\n"
-            "  --disable-music              Disable music\n"
-            "  -h, --help                   Show this help message and quit\n"
-            "  -v, --version                Show SuperTux version and quit\n"
-            "  --console                    Enable ingame scripting console\n"
-            "  --noconsole                  Disable ingame scripting console\n"
-            "  --show-fps                   Display framerate in levels\n"
-            "  --no-show-fps                Do not display framerate in levels\n"
-            "  --record-demo FILE LEVEL     Record a demo to FILE\n"
-            "  --play-demo FILE LEVEL       Play a recorded demo\n"
-            "  -s, --debug-scripts          Enable script debugger.\n"
-            "%s\n"), "");
+  std::cerr << _("Usage: ") << argv0 << _(" [OPTIONS] [LEVELFILE]\n\n")
+            << _("Options:\n"
+                 "  -f, --fullscreen             Run in fullscreen mode\n"
+                 "  -w, --window                 Run in window mode\n"
+                 "  -g, --geometry WIDTHxHEIGHT  Run SuperTux in given resolution\n"
+                 "  -a, --aspect WIDTH:HEIGHT    Run SuperTux with given aspect ratio\n"
+                 "  -d, --default                Reset video settings to default values\n"
+                 "  --renderer RENDERER          Use sdl, opengl, or auto to render\n"
+                 "  --disable-sfx                Disable sound effects\n"
+                 "  --disable-music              Disable music\n"
+                 "  -h, --help                   Show this help message and quit\n"
+                 "  -v, --version                Show SuperTux version and quit\n"
+                 "  --console                    Enable ingame scripting console\n"
+                 "  --noconsole                  Disable ingame scripting console\n"
+                 "  --show-fps                   Display framerate in levels\n"
+                 "  --no-show-fps                Do not display framerate in levels\n"
+                 "  --record-demo FILE LEVEL     Record a demo to FILE\n"
+                 "  --play-demo FILE LEVEL       Play a recorded demo\n"
+                 "  -s, --debug-scripts          Enable script debugger.\n"
+                 "\n")
+            << std::flush;
 }
 
 /**