From f729ec60132868db9523af7be92dc7ce58a45e83 Mon Sep 17 00:00:00 2001 From: mfranz Date: Thu, 26 Jan 2006 22:22:37 +0000 Subject: [PATCH] cosmetics --- src/GUI/new_gui.cxx | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/src/GUI/new_gui.cxx b/src/GUI/new_gui.cxx index a439440b9..5f762dcb7 100644 --- a/src/GUI/new_gui.cxx +++ b/src/GUI/new_gui.cxx @@ -418,26 +418,24 @@ FGFontCache::get(const char *name, float size, float slant) { _itt_t it; - if ((it = _fonts.find(name)) == _fonts.end()) { - SGPath path(_path); - path.append(name); - - fnt *f = new fnt(); - f->texfont = new fntTexFont; - if (f->texfont->load((char *)path.c_str())) { - f->pufont = new puFont; - f->pufont->initialize(static_cast(f->texfont), size, slant); - _fonts[name] = f; - return f->pufont; - - } else { - delete f; - return _fonts["default"]->pufont; - } - - } else { + if ((it = _fonts.find(name)) != _fonts.end()) return it->second->pufont; + + SGPath path(_path); + path.append(name); + + fnt *f = new fnt(); + f->texfont = new fntTexFont; + + if (f->texfont->load((char *)path.c_str())) { + f->pufont = new puFont; + f->pufont->initialize(static_cast(f->texfont), size, slant); + _fonts[name] = f; + return f->pufont; } + + delete f; + return _fonts["default"]->pufont; } puFont *