]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - radiant/main.cpp
Q3map2:
[xonotic/netradiant.git] / radiant / main.cpp
index c669aba41f4d5367024720aa6ed6a2d2c9f04b11..d17db3d6aa4f619eb26aedfcaa02d5eac1a47ab3 100644 (file)
@@ -543,6 +543,21 @@ void user_shortcuts_save(){
        SaveCommandMap( path.c_str() );
 }
 
+void add_local_rc_files(){
+       {
+               StringOutputStream path( 512 );
+               path << AppPath_get() << ".gtkrc-2.0.radiant";
+               gtk_rc_add_default_file( path.c_str() );
+       }
+#ifdef WIN32
+       {
+               StringOutputStream path( 512 );
+               path << AppPath_get() << ".gtkrc-2.0.win";
+               gtk_rc_add_default_file( path.c_str() );
+       }
+#endif
+}
+
 int main( int argc, char* argv[] ){
        crt_init();
 
@@ -554,13 +569,26 @@ int main( int argc, char* argv[] ){
        if ( lib != 0 ) {
                void ( WINAPI *qDwmEnableComposition )( bool bEnable ) = ( void (WINAPI *) ( bool bEnable ) )GetProcAddress( lib, "DwmEnableComposition" );
                if ( qDwmEnableComposition ) {
-                       qDwmEnableComposition( FALSE );
+                       bool Aero = false;
+                       for ( int i = 1; i < argc; ++i ){
+                               if ( !stricmp( argv[i], "-aero" ) ){
+                                       Aero = true;
+                                       qDwmEnableComposition( TRUE );
+                                       break;
+                               }
+                       }
+                       // disable Aero
+                       if ( !Aero ){
+                               qDwmEnableComposition( FALSE );
+                       }
                }
                FreeLibrary( lib );
        }
+       _setmaxstdio(2048);
 #endif
 
        gtk_disable_setlocale();
+
        gtk_init( &argc, &argv );
 
        // redirect Gtk warnings to the console
@@ -581,6 +609,8 @@ int main( int argc, char* argv[] ){
 
        paths_init();
 
+       add_local_rc_files();
+
        if ( !check_version() ) {
                return EXIT_FAILURE;
        }
@@ -622,7 +652,10 @@ int main( int argc, char* argv[] ){
 
        hide_splash();
 
-       if ( g_bLoadLastMap && !g_strLastMap.empty() ) {
+       if( openCmdMap && *openCmdMap ){
+               Map_LoadFile( openCmdMap );
+       }
+       else if ( g_bLoadLastMap && !g_strLastMap.empty() ) {
                Map_LoadFile( g_strLastMap.c_str() );
        }
        else