1
0
Fork 0

Handle scenery-override in a single place only.

This commit is contained in:
ThorstenB 2012-09-17 13:37:36 +02:00
parent 7415696492
commit 06170ddaae
5 changed files with 10 additions and 11 deletions

View file

@ -89,11 +89,14 @@ static void fgLoadInitialScenery()
{ {
static SGPropertyNode_ptr scenery_loaded static SGPropertyNode_ptr scenery_loaded
= fgGetNode("sim/sceneryloaded", true); = fgGetNode("sim/sceneryloaded", true);
static SGPropertyNode_ptr scenery_override
= fgGetNode("/sim/sceneryloaded-override", true);
if (!scenery_loaded->getBoolValue()) if (!scenery_loaded->getBoolValue())
{ {
if (globals->get_tile_mgr()->isSceneryLoaded() if (scenery_override->getBoolValue() ||
&& fgGetBool("sim/fdm-initialized")) { (globals->get_tile_mgr()->isSceneryLoaded()
&& fgGetBool("sim/fdm-initialized"))) {
fgSetBool("sim/sceneryloaded",true); fgSetBool("sim/sceneryloaded",true);
fgSplashProgress(""); fgSplashProgress("");
} }

View file

@ -55,7 +55,6 @@ TimeManager::TimeManager() :
_inited(false), _inited(false),
_impl(NULL), _impl(NULL),
_sceneryLoaded("sim/sceneryloaded"), _sceneryLoaded("sim/sceneryloaded"),
_sceneryLoadOverride("sim/sceneryloaded-override"),
_modelHz("sim/model-hz"), _modelHz("sim/model-hz"),
_timeDelta("sim/time/delta-realtime-sec"), _timeDelta("sim/time/delta-realtime-sec"),
_simTimeDelta("sim/time/delta-sec") _simTimeDelta("sim/time/delta-sec")
@ -163,7 +162,7 @@ void TimeManager::computeTimeDeltas(double& simDt, double& realDt)
_lastClockFreeze = _clockFreeze->getBoolValue(); _lastClockFreeze = _clockFreeze->getBoolValue();
} }
bool wait_for_scenery = !(_sceneryLoaded || _sceneryLoadOverride); bool wait_for_scenery = !_sceneryLoaded;
if (!wait_for_scenery) { if (!wait_for_scenery) {
throttleUpdateRate(); throttleUpdateRate();
} }

View file

@ -89,8 +89,7 @@ private:
double _frameLatencyMax; double _frameLatencyMax;
int _frameCount; int _frameCount;
SGPropObjBool _sceneryLoaded, SGPropObjBool _sceneryLoaded;
_sceneryLoadOverride;
SGPropObjInt _modelHz; SGPropObjInt _modelHz;
SGPropObjDouble _timeDelta, _simTimeDelta; SGPropObjDouble _timeDelta, _simTimeDelta;
}; };

View file

@ -514,7 +514,6 @@ FGRenderer::init( void )
if (!_classicalRenderer) if (!_classicalRenderer)
_pipeline = makeRenderingPipeline(_renderer, 0); _pipeline = makeRenderingPipeline(_renderer, 0);
_scenery_loaded = fgGetNode("/sim/sceneryloaded", true); _scenery_loaded = fgGetNode("/sim/sceneryloaded", true);
_scenery_override = fgGetNode("/sim/sceneryloaded-override", true);
_panel_hotspots = fgGetNode("/sim/panel-hotspots", true); _panel_hotspots = fgGetNode("/sim/panel-hotspots", true);
_virtual_cockpit = fgGetNode("/sim/virtual-cockpit", true); _virtual_cockpit = fgGetNode("/sim/virtual-cockpit", true);
@ -1535,8 +1534,7 @@ FGRenderer::setupView( void )
// Update all Visuals (redraws anything graphics related) // Update all Visuals (redraws anything graphics related)
void void
FGRenderer::update( ) { FGRenderer::update( ) {
if (!(_scenery_loaded->getBoolValue() || if (!_scenery_loaded->getBoolValue())
_scenery_override->getBoolValue()))
{ {
_splash_alpha->setDoubleValue(1.0); _splash_alpha->setDoubleValue(1.0);
return; return;

View file

@ -121,7 +121,7 @@ public:
protected: protected:
osg::ref_ptr<osgViewer::Viewer> viewer; osg::ref_ptr<osgViewer::Viewer> viewer;
osg::ref_ptr<flightgear::FGEventHandler> eventHandler; osg::ref_ptr<flightgear::FGEventHandler> eventHandler;
SGPropertyNode_ptr _scenery_loaded,_scenery_override; SGPropertyNode_ptr _scenery_loaded;
SGPropertyNode_ptr _skyblend, _splash_alpha; SGPropertyNode_ptr _skyblend, _splash_alpha;
SGPropertyNode_ptr _point_sprites, _enhanced_lighting, _distance_attenuation; SGPropertyNode_ptr _point_sprites, _enhanced_lighting, _distance_attenuation;
SGPropertyNode_ptr _textures; SGPropertyNode_ptr _textures;