In a globally installed build, debug.txt is now placed in userdata directory. Needs testing still.

master
Perttu Ahola 2011-06-02 19:30:03 +03:00
parent fd64dd5e20
commit 1b8cff8fbf
3 changed files with 46 additions and 31 deletions

View File

@ -9,7 +9,7 @@ project(minetest)
set(VERSION_MAJOR 0) set(VERSION_MAJOR 0)
set(VERSION_MINOR 2) set(VERSION_MINOR 2)
set(VERSION_PATCH 20110602_0) set(VERSION_PATCH 20110602_1_dev)
set(VERSION_STRING "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}") set(VERSION_STRING "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")
# Configuration options # Configuration options

View File

@ -1028,6 +1028,15 @@ void drawMenuBackground(video::IVideoDriver* driver)
int main(int argc, char *argv[]) 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 Parse command line
*/ */
@ -1091,21 +1100,28 @@ int main(int argc, char *argv[])
disable_stderr = true; disable_stderr = true;
#endif #endif
porting::signal_handler_init();
bool &kill = *porting::signal_handler_killstatus();
// Initialize porting::path_data and porting::path_userdata
porting::initializePaths();
// Initialize debug streams // 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 // Initialize debug stacks
debug_stacks_init(); debug_stacks_init();
DSTACK(__FUNCTION_NAME); DSTACK(__FUNCTION_NAME);
porting::signal_handler_init();
bool &kill = *porting::signal_handler_killstatus();
porting::initializePaths();
// Create user data directory // Create user data directory
fs::CreateDir(porting::path_userdata); fs::CreateDir(porting::path_userdata);
// C-style stuff initialization // Init material properties table
initializeMaterialProperties(); initializeMaterialProperties();
// Debug handler // Debug handler
@ -1124,19 +1140,10 @@ int main(int argc, char *argv[])
// Initialize default settings // Initialize default settings
set_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 // Initialize sockets
sockets_init(); sockets_init();
atexit(sockets_cleanup); atexit(sockets_cleanup);
/*
Initialization
*/
/* /*
Read config file Read config file
*/ */

View File

@ -115,6 +115,15 @@ u32 getTimeMs()
int main(int argc, char *argv[]) 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 Low-level initialization
*/ */
@ -124,20 +133,28 @@ int main(int argc, char *argv[])
disable_stderr = true; disable_stderr = true;
#endif #endif
porting::signal_handler_init();
bool &kill = *porting::signal_handler_killstatus();
// Initialize porting::path_data and porting::path_userdata
porting::initializePaths();
// Initialize debug streams // 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 // Initialize debug stacks
debug_stacks_init(); debug_stacks_init();
DSTACK(__FUNCTION_NAME); DSTACK(__FUNCTION_NAME);
porting::signal_handler_init(); // Init material properties table
bool &kill = *porting::signal_handler_killstatus();
porting::initializePaths();
initializeMaterialProperties(); initializeMaterialProperties();
// Debug handler
BEGIN_DEBUG_EXCEPTION_HANDLER BEGIN_DEBUG_EXCEPTION_HANDLER
// Print startup message // Print startup message
@ -202,19 +219,10 @@ int main(int argc, char *argv[])
// Initialize default settings // Initialize default settings
set_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 // Initialize sockets
sockets_init(); sockets_init();
atexit(sockets_cleanup); atexit(sockets_cleanup);
/*
Initialization
*/
/* /*
Read config file Read config file
*/ */