]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - radiant/mainframe.cpp
add the #include here too
[xonotic/netradiant.git] / radiant / mainframe.cpp
index ea4edf31eee981c917760e8ca150573661df028d..a91157bee2e9d1cb74765b406e4c3754d0433406 100644 (file)
@@ -184,6 +184,9 @@ void VFS_Destroy()
 
 // Home Paths
 
+#ifdef WIN32
+#include <shlobj.h>
+#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();
@@ -3316,13 +3339,10 @@ void GridStatus_onTextureLockEnabledChanged()
   }
 }
 
-namespace
-{
-  GLFont g_font(0, 0, 0, 0);
-}
-
 void GlobalGL_sharedContextCreated()
 {
+  GLFont *g_font = NULL;
+
   // report OpenGL information
   globalOutputStream() << "GL_VENDOR: " << reinterpret_cast<const char*>(glGetString (GL_VENDOR)) << "\n";
   globalOutputStream() << "GL_RENDERER: " << reinterpret_cast<const char*>(glGetString (GL_RENDERER)) << "\n";
@@ -3338,19 +3358,15 @@ void GlobalGL_sharedContextCreated()
 
 #ifdef WIN32
   /* win32 is dodgy here, just use courier new then */
-  g_font = glfont_create("courier new 8");
+  g_font = glfont_create("arial 9");
 #else
-  /* use default font here (Sans 10 is gtk default) */
   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.getDisplayList();
-  GlobalOpenGL().m_fontHeight = g_font.getPixelHeight();
-  GlobalOpenGL().m_fontAscent = g_font.getPixelAscent();
-  GlobalOpenGL().m_fontDescent = g_font.getPixelDescent();
+  GlobalOpenGL().m_font = g_font;
 }
 
 void GlobalGL_sharedContextDestroyed()