In a globally installed build, debug.txt is now placed in userdata directory. Needs...
authorPerttu Ahola <celeron55@gmail.com>
Thu, 2 Jun 2011 16:30:03 +0000 (19:30 +0300)
committerPerttu Ahola <celeron55@gmail.com>
Thu, 2 Jun 2011 16:30:03 +0000 (19:30 +0300)
CMakeLists.txt
src/main.cpp
src/servermain.cpp

index c1074e6d37602e69a56302df1f08f36b16c4e1d8..9cb6db41f112d44a5860d9596d3e22a9141971b5 100644 (file)
@@ -9,7 +9,7 @@ project(minetest)
 
 set(VERSION_MAJOR 0)
 set(VERSION_MINOR 2)
-set(VERSION_PATCH 20110602_0)
+set(VERSION_PATCH 20110602_1_dev)
 set(VERSION_STRING "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")
 
 # Configuration options
index 2cde3b302f66765b7cefdb83f514cd1027d072b7..881aa9bf78ce7710dcc6193e062e2a868c511c8b 100644 (file)
@@ -1028,6 +1028,15 @@ void drawMenuBackground(video::IVideoDriver* driver)
 \r
 int main(int argc, char *argv[])\r
 {\r
+       /*\r
+               Initialization\r
+       */\r
+\r
+       // Set locale. This is for forcing '.' as the decimal point.\r
+       std::locale::global(std::locale("C"));\r
+       // This enables printing all characters in bitmap font\r
+       setlocale(LC_CTYPE, "en_US");\r
+\r
        /*\r
                Parse command line\r
        */\r
@@ -1091,21 +1100,28 @@ int main(int argc, char *argv[])
                disable_stderr = true;\r
 #endif\r
 \r
+       porting::signal_handler_init();\r
+       bool &kill = *porting::signal_handler_killstatus();\r
+       \r
+       // Initialize porting::path_data and porting::path_userdata\r
+       porting::initializePaths();\r
+\r
        // Initialize debug streams\r
-       debugstreams_init(disable_stderr, DEBUGFILE);\r
+#ifdef RUN_IN_PLACE\r
+       std::string debugfile = DEBUGFILE;\r
+#else\r
+       std::string debugfile = porting::path_userdata+"/"+DEBUGFILE;\r
+#endif\r
+       debugstreams_init(disable_stderr, debugfile.c_str());\r
        // Initialize debug stacks\r
        debug_stacks_init();\r
 \r
        DSTACK(__FUNCTION_NAME);\r
 \r
-       porting::signal_handler_init();\r
-       bool &kill = *porting::signal_handler_killstatus();\r
-       \r
-       porting::initializePaths();\r
        // Create user data directory\r
        fs::CreateDir(porting::path_userdata);\r
        \r
-       // C-style stuff initialization\r
+       // Init material properties table\r
        initializeMaterialProperties();\r
 \r
        // Debug handler\r
@@ -1124,19 +1140,10 @@ int main(int argc, char *argv[])
        // Initialize default settings\r
        set_default_settings();\r
        \r
-       // Set locale. This is for forcing '.' as the decimal point.\r
-       std::locale::global(std::locale("C"));\r
-       // This enables printing all characters in bitmap font\r
-       setlocale(LC_CTYPE, "en_US");\r
-\r
        // Initialize sockets\r
        sockets_init();\r
        atexit(sockets_cleanup);\r
        \r
-       /*\r
-               Initialization\r
-       */\r
-\r
        /*\r
                Read config file\r
        */\r
index f83e2ae76da8cefe6ff953a0fdbf361fdd99b128..907d0d2db56a77cc7d06bf3af6d83d3733d00a92 100644 (file)
@@ -115,6 +115,15 @@ u32 getTimeMs()
 
 int main(int argc, char *argv[])
 {
+       /*
+               Initialization
+       */
+
+       // Set locale. This is for forcing '.' as the decimal point.
+       std::locale::global(std::locale("C"));
+       // This enables printing all characters in bitmap font
+       setlocale(LC_CTYPE, "en_US");
+
        /*
                Low-level initialization
        */
@@ -124,20 +133,28 @@ int main(int argc, char *argv[])
        disable_stderr = true;
 #endif
 
+       porting::signal_handler_init();
+       bool &kill = *porting::signal_handler_killstatus();
+       
+       // Initialize porting::path_data and porting::path_userdata
+       porting::initializePaths();
+
        // Initialize debug streams
-       debugstreams_init(disable_stderr, DEBUGFILE);
+#ifdef RUN_IN_PLACE
+       std::string debugfile = DEBUGFILE;
+#else
+       std::string debugfile = porting::path_userdata+"/"+DEBUGFILE;
+#endif
+       debugstreams_init(disable_stderr, debugfile.c_str());
        // Initialize debug stacks
        debug_stacks_init();
 
        DSTACK(__FUNCTION_NAME);
 
-       porting::signal_handler_init();
-       bool &kill = *porting::signal_handler_killstatus();
-       
-       porting::initializePaths();
-
+       // Init material properties table
        initializeMaterialProperties();
 
+       // Debug handler
        BEGIN_DEBUG_EXCEPTION_HANDLER
 
        // Print startup message
@@ -202,19 +219,10 @@ int main(int argc, char *argv[])
        // Initialize default settings
        set_default_settings();
        
-       // Set locale. This is for forcing '.' as the decimal point.
-       std::locale::global(std::locale("C"));
-       // This enables printing all characters in bitmap font
-       setlocale(LC_CTYPE, "en_US");
-
        // Initialize sockets
        sockets_init();
        atexit(sockets_cleanup);
        
-       /*
-               Initialization
-       */
-
        /*
                Read config file
        */