1
0
Fork 0

Remove confusing default (missing) path from 2D panel code.

This commit is contained in:
James Turner 2010-10-28 13:54:45 +01:00
parent 0320010d95
commit e9f4106bc1
2 changed files with 15 additions and 13 deletions

View file

@ -392,9 +392,11 @@ static bool
do_panel_load (const SGPropertyNode * arg)
{
string panel_path =
arg->getStringValue("path",
fgGetString("/sim/panel/path",
"Panels/Default/default.xml"));
arg->getStringValue("path", fgGetString("/sim/panel/path"));
if (panel_path.empty()) {
return false;
}
FGPanel * new_panel = fgReadPanel(panel_path);
if (new_panel == 0) {
SG_LOG(SG_INPUT, SG_ALERT,

View file

@ -1414,20 +1414,20 @@ bool fgInitSubsystems() {
// Add a new 2D panel.
////////////////////////////////////////////////////////////////////
string panel_path = fgGetString("/sim/panel/path",
"Panels/Default/default.xml");
globals->set_current_panel( fgReadPanel(panel_path) );
if (globals->get_current_panel() == 0) {
string panel_path(fgGetString("/sim/panel/path"));
if (!panel_path.empty()) {
FGPanel* p = fgReadPanel(panel_path);
if (p) {
globals->set_current_panel(p);
p->init();
p->bind();
SG_LOG( SG_INPUT, SG_INFO, "Loaded new panel from " << panel_path );
} else {
SG_LOG( SG_INPUT, SG_ALERT,
"Error reading new panel from " << panel_path );
} else {
SG_LOG( SG_INPUT, SG_INFO, "Loaded new panel from " << panel_path );
globals->get_current_panel()->init();
globals->get_current_panel()->bind();
}
}
////////////////////////////////////////////////////////////////////
// Initialize the controls subsystem.
////////////////////////////////////////////////////////////////////