X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=radiant%2Fmain.cpp;h=15baa3c048323a3fbee78992a77bb543d96138d1;hb=da366187d6a36f998616d1707ccf0fc5d67c6fc5;hp=ff10ebac7198b7efd0959e6eda2825d8e92b3d1c;hpb=8a1ebd7397355ef00b87531da6f1700bc5a47a41;p=xonotic%2Fnetradiant.git diff --git a/radiant/main.cpp b/radiant/main.cpp index ff10ebac..15baa3c0 100644 --- a/radiant/main.cpp +++ b/radiant/main.cpp @@ -89,6 +89,10 @@ DefaultAllocator - Memory allocation using new/delete, compliant with std::alloc #include "referencecache.h" #include "stacktrace.h" +#ifdef WIN32 +#include +#endif + void show_splash(); void hide_splash(); @@ -325,7 +329,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 +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();