From 95da0171a009e5e30848c61a377a4dbd0693bc8b Mon Sep 17 00:00:00 2001 From: mfranz Date: Tue, 6 Jun 2006 19:25:33 +0000 Subject: [PATCH] bark if the requested font isn't a texture font. A more graceful recovery 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 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Cockpit/hud.cxx b/src/Cockpit/hud.cxx index a9e578201..e8497e347 100644 --- a/src/Cockpit/hud.cxx +++ b/src/Cockpit/hud.cxx @@ -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(); -- 2.39.5