#include "main.h"
#include "globaldefs.h"
-#include "version.h"
-
#include "debugging/debugging.h"
#include "iundo.h"
// set without saving, the class is not in a coherent state yet
// just do the value change and call to start logging, CGamesDialog will pickup when relevant
g_GamesDialog.m_bForceLogConsole = true;
- Sys_LogFile( true );
+ Sys_EnableLogFile( true );
}
// create a primary .pid for global init run
// force console logging on! (will go in prefs too)
g_GamesDialog.m_bForceLogConsole = true;
- Sys_LogFile( true );
+ Sys_EnableLogFile( true );
}
else
{
SaveCommandMap( path.c_str() );
}
+/* HACK: If ui::main is not called yet,
+gtk_main_quit will not quit, so tell main
+to not call ui::main. This happens when a
+map is loaded from command line and require
+a restart because of wrong format.
+Delete this when the code to not have to
+restart to load another format is merged. */
+bool g_dontStart = false;
+
int main( int argc, char* argv[] ){
+#if GTK_TARGET == 3
+ // HACK: force legacy GL backend as we don't support GL3 yet
+ setenv("GDK_GL", "LEGACY", 0);
+#if GDEF_OS_LINUX || GDEF_OS_BSD
+ setenv("GDK_BACKEND", "x11", 0);
+#endif
+#endif // GTK_TARGET == 3
crt_init();
streams_init();
// we may have the console turned on and want to keep it that way
// so we use a latching system
if ( g_GamesDialog.m_bForceLogConsole ) {
- Sys_LogFile( true );
+ Sys_EnableLogFile( true );
g_Console_enableLogging = true;
g_GamesDialog.m_bForceLogConsole = false;
}
remove_local_pid();
- ui::main();
+ /* HACK: If ui::main is not called yet,
+ gtk_main_quit will not quit, so tell main
+ to not call ui::main. This happens when a
+ map is loaded from command line and require
+ a restart because of wrong format.
+ Delete this when the code to not have to
+ restart to load another format is merged. */
+ if ( !g_dontStart )
+ {
+ ui::main();
+ }
// avoid saving prefs when the app is minimized
if ( g_pParentWnd->IsSleeping() ) {
Radiant_Shutdown();
// close the log file if any
- Sys_LogFile( false );
+ Sys_EnableLogFile( false );
return EXIT_SUCCESS;
}