]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - radiant/main.cpp
try to disable composition on Vista
[xonotic/netradiant.git] / radiant / main.cpp
index ff10ebac7198b7efd0959e6eda2825d8e92b3d1c..03f186cb7ed67e264b62c309d632dfaf1031b6d7 100644 (file)
@@ -325,7 +325,7 @@ void paths_init()
 
   {
     StringOutputStream path(256);
-    path << home << RADIANT_VERSION << '/';
+    path << home << "1." << RADIANT_MAJOR_VERSION "." << RADIANT_MINOR_VERSION << '/';
     g_strSettingsPath = path.c_str();
   }
 
@@ -545,12 +545,31 @@ void user_shortcuts_init()
   SaveCommandMap(path.c_str());
 }
 
+void user_shortcuts_save()
+{
+  StringOutputStream path(256);
+  path << SettingsPath_get() << g_pGameDescription->mGameFile.c_str() << '/';
+  SaveCommandMap(path.c_str());
+}
+
 int main (int argc, char* argv[])
 {
   crt_init();
 
   streams_init();
 
+#ifdef WIN32
+  HMODULE lib;
+  lib = LoadLibrary("dwmapi.dll");
+  if(lib != 0)
+  {
+         void (WINAPI *DwmEnableComposition) (bool bEnable) = (void (WINAPI *) (bool bEnable)) GetProcAddress(lib, "DwmEnableComposition");
+         if(DwmEnableComposition)
+                 DwmEnableComposition(FALSE);
+         FreeLibrary(lib);
+  }
+#endif
+
   gtk_disable_setlocale();
   gtk_init(&argc, &argv);
 
@@ -649,6 +668,8 @@ int main (int argc, char* argv[])
 
   delete g_pParentWnd;
 
+  user_shortcuts_save();
+
   global_accel_destroy();
 
   Radiant_Shutdown();