]> git.mxchange.org Git - flightgear.git/commitdiff
bark if the requested font isn't a texture font. A more graceful recovery
authormfranz <mfranz>
Tue, 6 Jun 2006 19:25:33 +0000 (19:25 +0000)
committermfranz <mfranz>
Tue, 6 Jun 2006 19:25:33 +0000 (19:25 +0000)
doesn't buy us much, as the font is only set at initialization time and not
changeable later. Better tell the user immediately that he goofed.

src/Cockpit/hud.cxx

index a9e5782015317a3645dd3540faa5d5871bfa6a74..e8497e347fedb02fdd38bb3ae7291bb1253b9f5e 100644 (file)
@@ -766,6 +766,9 @@ int fgHUDInit( fgAIRCRAFT * /* current_aircraft */ )
 
     FGFontCache *fc = globals->get_fontcache();
     HUD_Font = fc->getTexFont(fgGetString("/sim/hud/font/name", "Helvetica.txf"));
+    if (!HUD_Font)
+        throw sg_throwable(string("/sim/hud/font/name is not a texture font"));
+
     HUD_TextSize = fgGetFloat("/sim/hud/font/size", 10);
 
     HUDtext = new fntRenderer();