diff options
author | Perttu Ahola <celeron55@gmail.com> | 2011-06-02 19:30:03 +0300 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2011-06-02 19:30:03 +0300 |
commit | 1b8cff8fbf6a1ae121bba93b12318a6f20f1daad (patch) | |
tree | c7e58c199c80b2a8d6fd290b84989a3e9c2fcc5d | |
parent | fd64dd5e20af855f68072ca888a1362d776de197 (diff) | |
download | minetest-1b8cff8fbf6a1ae121bba93b12318a6f20f1daad.tar.gz minetest-1b8cff8fbf6a1ae121bba93b12318a6f20f1daad.tar.bz2 minetest-1b8cff8fbf6a1ae121bba93b12318a6f20f1daad.zip |
In a globally installed build, debug.txt is now placed in userdata directory. Needs testing still.
-rw-r--r-- | CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/main.cpp | 37 | ||||
-rw-r--r-- | src/servermain.cpp | 38 |
3 files changed, 46 insertions, 31 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index c1074e6d3..9cb6db41f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 diff --git a/src/main.cpp b/src/main.cpp index 2cde3b302..881aa9bf7 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1029,6 +1029,15 @@ void drawMenuBackground(video::IVideoDriver* driver) 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");
+
+ /*
Parse command line
*/
@@ -1091,21 +1100,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();
// Create user data directory
fs::CreateDir(porting::path_userdata);
- // C-style stuff initialization
+ // Init material properties table
initializeMaterialProperties();
// Debug handler
@@ -1124,20 +1140,11 @@ 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
*/
diff --git a/src/servermain.cpp b/src/servermain.cpp index f83e2ae76..907d0d2db 100644 --- a/src/servermain.cpp +++ b/src/servermain.cpp @@ -116,6 +116,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,20 +219,11 @@ 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 */ |