]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - radiant/main.cpp
disable gtktheme compilation
[xonotic/netradiant.git] / radiant / main.cpp
index f19bec378977c67d158f5012731ea6d23b08ee57..88cd0cad4fd89e7a774ca8941be1a9fbd5b60144 100644 (file)
@@ -534,6 +534,31 @@ void user_shortcuts_save(){
        SaveCommandMap( path.c_str() );
 }
 
+void add_local_rc_files(){
+#define GARUX_DISABLE_GTKTHEME
+#ifndef GARUX_DISABLE_GTKTHEME
+/* FIXME: HACK: not GTK3 compatible
+ https://developer.gnome.org/gtk2/stable/gtk2-Resource-Files.html#gtk-rc-add-default-file
+ https://developer.gnome.org/gtk3/stable/gtk3-Resource-Files.html#gtk-rc-add-default-file
+ > gtk_rc_add_default_file has been deprecated since version 3.0 and should not be used in newly-written code.
+ > Use GtkStyleContext with a custom GtkStyleProvider instead
+*/
+
+       {
+               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
+#endif // GARUX_DISABLE_GTKTHEME
+}
+
 int main( int argc, char* argv[] ){
        crt_init();
 
@@ -545,11 +570,22 @@ int main( int argc, char* argv[] ){
        if ( lib != 0 ) {
                void ( WINAPI *qDwmEnableComposition )( bool bEnable ) = ( void (WINAPI *) ( bool bEnable ) )GetProcAddress( lib, "DwmEnableComposition" );
                if ( qDwmEnableComposition ) {
+                       bool Aero = false;
+                       for ( int i = 1; i < argc; ++i ){
+                               if ( !stricmp( argv[i], "-aero" ) ){
+                                       Aero = true;
+                                       qDwmEnableComposition( TRUE );
+                                       break;
+                               }
+                       }
                        // disable Aero
-                       qDwmEnableComposition( FALSE );
+                       if ( !Aero ){
+                               qDwmEnableComposition( FALSE );
+                       }
                }
                FreeLibrary( lib );
        }
+       _setmaxstdio(2048);
 #endif
 
        const char* mapname = NULL;
@@ -598,6 +634,8 @@ int main( int argc, char* argv[] ){
 
        paths_init();
 
+       add_local_rc_files();
+
        if ( !check_version() ) {
                return EXIT_FAILURE;
        }
@@ -637,6 +675,12 @@ int main( int argc, char* argv[] ){
 
        hide_splash();
 
+#ifdef WIN32
+       if( openCmdMap && *openCmdMap ){
+               Map_LoadFile( openCmdMap );
+       }
+       else
+#endif // WIN32
        if ( mapname != NULL ) {
                Map_LoadFile( mapname );
        }