X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=radiant%2Fmainframe.cpp;h=a91157bee2e9d1cb74765b406e4c3754d0433406;hb=35680f96d57400576d1e3996f2e8064e97e71ec9;hp=452c97fdcc7a60b25ee97389772883811fe97776;hpb=b8ef001e495fea520a2b46add1948f054a3253d3;p=xonotic%2Fnetradiant.git diff --git a/radiant/mainframe.cpp b/radiant/mainframe.cpp index 452c97fd..a91157be 100644 --- a/radiant/mainframe.cpp +++ b/radiant/mainframe.cpp @@ -184,6 +184,9 @@ void VFS_Destroy() // Home Paths +#ifdef WIN32 +#include +#endif void HomePaths_Realise() { #if defined(POSIX) @@ -196,6 +199,26 @@ void HomePaths_Realise() Q_mkdir(g_qeglobals.m_userEnginePath.c_str()); } else +#elif defined(WIN32) + if(!string_empty(prefix)) + { + StringOutputStream path(256); + TCHAR mydocsdir[MAX_PATH + 1]; + if(SHGetFolderPath(NULL, CSIDL_PERSONAL, NULL, 0, mydocsdir)) + { + path << DirectoryCleaned(mydocsdir) << "My Games/" << prefix << "/"; + // win32: only add it if it already exists + if(file_is_directory(path.c_str())) + g_qeglobals.m_userEnginePath = path.c_str(); + else + g_qeglobals.m_userEnginePath = EnginePath_get(); + } + else + { + g_qeglobals.m_userEnginePath = EnginePath_get(); + } + } + else #endif { g_qeglobals.m_userEnginePath = EnginePath_get(); @@ -3333,11 +3356,15 @@ void GlobalGL_sharedContextCreated() GlobalShaderCache().realise(); Textures_Realise(); - /* use default font here (Sans 10 is gtk default) */ +#ifdef WIN32 + /* win32 is dodgy here, just use courier new then */ + g_font = glfont_create("arial 9"); +#else GtkSettings *settings = gtk_settings_get_default(); gchar *fontname; g_object_get(settings, "gtk-font-name", &fontname, NULL); g_font = glfont_create(fontname); +#endif GlobalOpenGL().m_font = g_font; }