]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - radiant/main.cpp
add more vertexes to the entity display to make it more visible (paint an X in its...
[xonotic/netradiant.git] / radiant / main.cpp
index 99182f8c193dd5c590abbc9f3931dbb42f25701c..15baa3c048323a3fbee78992a77bb543d96138d1 100644 (file)
@@ -89,6 +89,10 @@ DefaultAllocator - Memory allocation using new/delete, compliant with std::alloc
 #include "referencecache.h"
 #include "stacktrace.h"
 
+#ifdef WIN32
+#include <windows.h>
+#endif
+
 void show_splash();
 void hide_splash();
 
@@ -545,12 +549,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 +672,8 @@ int main (int argc, char* argv[])
 
   delete g_pParentWnd;
 
+  user_shortcuts_save();
+
   global_accel_destroy();
 
   Radiant_Shutdown();