]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - radiant/mainframe.cpp
::zerowing-base=422
[xonotic/netradiant.git] / radiant / mainframe.cpp
index 7f7eb061f4b4be77ac2088b33c03dc19cff41fee..c8a739b6f6939952f32845849e74b8c5b6252d5e 100644 (file)
@@ -1189,8 +1189,11 @@ void SelectFaceMode()
 class CloneSelected : public scene::Graph::Walker
 {
   bool doMakeUnique;
+  NodeSmartReference worldspawn;
 public:
-  CloneSelected(bool d): doMakeUnique(d) { }
+  CloneSelected(bool d): doMakeUnique(d), worldspawn(Map_FindOrInsertWorldspawn(g_map))
+  {
+  }
   bool pre(const scene::Path& path, scene::Instance& instance) const
   {
     if(path.size() == 1)
@@ -1198,7 +1201,7 @@ public:
 
     // ignore worldspawn, but keep checking children
     NodeSmartReference me(path.top().get());
-    if(me == Map_FindOrInsertWorldspawn(g_map))
+    if(me == worldspawn)
            return true;
 
     if(!path.top().get().isRoot())
@@ -1220,7 +1223,7 @@ public:
 
     // ignore worldspawn, but keep checking children
     NodeSmartReference me(path.top().get());
-    if(me == Map_FindOrInsertWorldspawn(g_map))
+    if(me == worldspawn)
            return;
 
     if(!path.top().get().isRoot())
@@ -3313,13 +3316,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";
@@ -3335,19 +3335,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()