diff --git a/utils/fgpanel/FGGLApplication.cxx b/utils/fgpanel/FGGLApplication.cxx index b0f58d250..2783737d9 100644 --- a/utils/fgpanel/FGGLApplication.cxx +++ b/utils/fgpanel/FGGLApplication.cxx @@ -56,6 +56,8 @@ FGGLApplication::FGGLApplication( const char * aName, int argc, char ** argv ) : FGGLApplication::~FGGLApplication() { + if (gameMode) + glutLeaveGameMode(); } void FGGLApplication::DisplayCallback() diff --git a/utils/fgpanel/FGPanelApplication.cxx b/utils/fgpanel/FGPanelApplication.cxx index b58700477..cf4bbcca3 100644 --- a/utils/fgpanel/FGPanelApplication.cxx +++ b/utils/fgpanel/FGPanelApplication.cxx @@ -90,6 +90,15 @@ FGPanelApplication::FGPanelApplication( int argc, char ** argv ) : throw exception(); } + // see if we got a valid fgdata path + SGPath BaseCheck(ApplicationProperties::root); + BaseCheck.append("version"); + if (!BaseCheck.exists()) + { + cerr << "Missing base package. Use --fg-root=path_to_fgdata" << endl; + throw exception(); + } + try { SGPath tpath = ApplicationProperties::GetRootPath( panelFilename.c_str() ); readProperties( tpath.str(), ApplicationProperties::Properties ); @@ -284,8 +293,12 @@ double ApplicationProperties::getDouble( const char * name, double def ) if( n == NULL ) return def; return n->getDoubleValue(); } + SGPath ApplicationProperties::GetRootPath( const char * sub ) { + SGPath subpath( sub ); + if ( subpath.isAbsolute() ) + return subpath; SGPath path( ApplicationProperties::root ); if( sub != NULL ) path.append( sub ); diff --git a/utils/fgpanel/panel.cxx b/utils/fgpanel/panel.cxx index 70c40876b..06a6159db 100644 --- a/utils/fgpanel/panel.cxx +++ b/utils/fgpanel/panel.cxx @@ -804,6 +804,11 @@ FGTextLayer::draw () transform(); text_renderer.setFont(ApplicationProperties::fontCache.getTexFont(_font_name.c_str())); + if (!text_renderer.getFont()) + { + SG_LOG( SG_COCKPIT, SG_ALERT, "Missing font file: " << _font_name ); + return; + } text_renderer.setPointSize(_pointSize); text_renderer.begin();