fade out console
[supertux.git] / src / main.cpp
index 969e602..fe54abb 100644 (file)
@@ -20,7 +20,7 @@
 #include <config.h>
 #include <assert.h>
 
-#include "msg.hpp"
+#include "log.hpp"
 #include "main.hpp"
 
 #include <stdexcept>
@@ -65,7 +65,7 @@ static void init_config()
   try {
     config->load();
   } catch(std::exception& e) {
-    msg_info << "Couldn't load config file: " << e.what() << ", using default settings" << std::endl;
+    log_info << "Couldn't load config file: " << e.what() << ", using default settings" << std::endl;
   }
 }
 
@@ -148,7 +148,7 @@ static void init_physfs(const char* argv0)
   if(f) {
     fclose(f);
     if(!PHYSFS_addToSearchPath(dir.c_str(), 1)) {
-      msg_warning << "Couldn't add '" << dir << "' to physfs searchpath: " << PHYSFS_getLastError() << std::endl;
+      log_warning << "Couldn't add '" << dir << "' to physfs searchpath: " << PHYSFS_getLastError() << std::endl;
     } else {
       sourcedir = true;
     }
@@ -165,7 +165,7 @@ static void init_physfs(const char* argv0)
     datadir = APPDATADIR;
 #endif
     if(!PHYSFS_addToSearchPath(datadir.c_str(), 1)) {
-      msg_warning << "Couldn't add '" << datadir << "' to physfs searchpath: " << PHYSFS_getLastError() << std::endl;
+      log_warning << "Couldn't add '" << datadir << "' to physfs searchpath: " << PHYSFS_getLastError() << std::endl;
     }
 #endif
   }
@@ -175,7 +175,7 @@ static void init_physfs(const char* argv0)
 
   //show search Path
   for(char** i = PHYSFS_getSearchPath(); *i != NULL; i++)
-    msg_info << "[" << *i << "] is in the search path" << std::endl;
+    log_info << "[" << *i << "] is in the search path" << std::endl;
 }
 
 static void print_usage(const char* argv0)
@@ -237,12 +237,12 @@ static bool parse_commandline(int argc, char** argv)
       print_usage(argv[0]);
       return true;
     } else if(arg == "--version") {
-      msg_info << PACKAGE_NAME << " " << PACKAGE_VERSION << std::endl;
+      log_info << PACKAGE_NAME << " " << PACKAGE_VERSION << std::endl;
       return true;
     } else if(arg[0] != '-') {
       config->start_level = arg;
     } else {
-      msg_warning << "Unknown option '" << arg << "'. Use --help to see a list of options" << std::endl;
+      log_warning << "Unknown option '" << arg << "'. Use --help to see a list of options" << std::endl;
     }
   }
 
@@ -343,7 +343,7 @@ void init_video()
   }
 #ifdef DEBUG
   else {
-    msg_warning << "Couldn't find icon 'images/engine/icons/supertux.xpm'" << std::endl;
+    log_warning << "Couldn't find icon 'images/engine/icons/supertux.xpm'" << std::endl;
   }
 #endif
 
@@ -447,7 +447,7 @@ static inline void timelog(const char* component)
   Uint32 current_ticks = SDL_GetTicks();
   
   if(last_timelog_component != 0) {
-    msg_info << "Component '" << last_timelog_component <<  "' finished after " << (current_ticks - last_timelog_ticks) / 1000.0 << " seconds" << std::endl;
+    log_info << "Component '" << last_timelog_component <<  "' finished after " << (current_ticks - last_timelog_ticks) / 1000.0 << " seconds" << std::endl;
   }
 
   last_timelog_ticks = current_ticks;
@@ -480,14 +480,14 @@ int main(int argc, char** argv)
     init_audio();
     timelog("video");
     init_video();
-    Console::instance = new Console();
+    Console::instance = new Console(); 
     timelog("scripting");
     init_scripting();
 
     timelog("menu");
     setup_menu();
     timelog("resources");
-    load_shared();
+    load_shared(); 
     timelog(0);
 
     main_loop = new MainLoop(); 
@@ -510,10 +510,10 @@ int main(int argc, char** argv)
 
     main_loop->run();
   } catch(std::exception& e) {
-    msg_fatal << "Unexpected exception: " << e.what() << std::endl;
+    log_fatal << "Unexpected exception: " << e.what() << std::endl;
     result = 1;
   } catch(...) {
-    msg_fatal << "Unexpected exception" << std::endl;
+    log_fatal << "Unexpected exception" << std::endl;
     result = 1;
   }