]> git.mxchange.org Git - flightgear.git/blobdiff - src/GUI/new_gui.hxx
ok, so the old ~FGFontCache() was useless. But at least it didn't call
[flightgear.git] / src / GUI / new_gui.hxx
index f00bf72bf7d879c126851cb0dc9523ca5e5183b1..352024a66b07511f153e3b4602dee0962979b54b 100644 (file)
@@ -186,15 +186,8 @@ public:
     virtual puFont *getDefaultFont() { return _font; }
 
 
-    /**
-     * menu wide font cache, accessible from other classes as well.
-     */
-    FGFontCache *get_fontcache() { return _fontcache; }
-
 protected:
 
-    FGFontCache * _fontcache;
-
     /**
      * Test if the menubar is visible.
      *
@@ -302,7 +295,7 @@ class FGFontCache {
 private:
     struct fnt {
         fnt(puFont *pu = 0) : pufont(pu), texfont(0) {}
-        ~fnt() { delete pufont; delete texfont; }
+        ~fnt() { if (texfont) { delete pufont; delete texfont; } }
         puFont *pufont;
         fntTexFont *texfont;
     };
@@ -310,6 +303,8 @@ private:
 
     map<const string,fnt *> _fonts;
     typedef map<const string,fnt *>::const_iterator _itt_t;
+    bool _initialized;
+    struct fnt *getfnt(const char *name, float size, float slant);
 
 public:
     FGFontCache();
@@ -317,6 +312,8 @@ public:
 
     puFont *get(const char *name, float size=15.0, float slant=0.0);
     puFont *get(SGPropertyNode *node);
+
+    fntTexFont *getTexFont(const char *name, float size=15.0, float slant=0.0);
 };