X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FCockpit%2Fpanel.cxx;h=9c39626ee6bd1dd4250047400a198064a1169b36;hb=8e5f3ac8a333a971d7f8104a387426c3bc47a014;hp=e2caa87f0cc1d0bd963f7d34422e4e2e3dfb389f;hpb=8b10bb12f59618a772ddcda93541ac45b3fd7246;p=flightgear.git diff --git a/src/Cockpit/panel.cxx b/src/Cockpit/panel.cxx index e2caa87f0..9c39626ee 100644 --- a/src/Cockpit/panel.cxx +++ b/src/Cockpit/panel.cxx @@ -122,11 +122,7 @@ FGTextureManager::createTexture (const string &relativePath, bool staticTexture) { osg::Texture2D* texture = _textureMap[relativePath].get(); if (texture == 0) { - SG_LOG( SG_COCKPIT, SG_DEBUG, - "Texture " << relativePath << " does not yet exist" ); - SGPath tpath(globals->get_fg_root()); - tpath.append(relativePath); - + SGPath tpath = globals->resolve_aircraft_path(relativePath); texture = SGLoadTexture2D(staticTexture, tpath); _textureMap[relativePath] = texture; @@ -1109,7 +1105,12 @@ FGTextLayer::draw (osg::State& state) transform(); FGFontCache *fc = globals->get_fontcache(); - text_renderer.setFont(fc->getTexFont(_font_name.c_str())); + fntFont* font = fc->getTexFont(_font_name.c_str()); + if (!font) { + return; // don't crash on missing fonts + } + + text_renderer.setFont(font); text_renderer.setPointSize(_pointSize); text_renderer.begin(); @@ -1170,6 +1171,11 @@ void FGTextLayer::setFontName(const string &name) { _font_name = name + ".txf"; + FGFontCache *fc = globals->get_fontcache(); + fntFont* font = fc->getTexFont(_font_name.c_str()); + if (!font) { + SG_LOG(SG_GENERAL, SG_WARN, "unable to find font:" << name); + } }