}
else
{
+ fgSplashProgress("loading scenery");
// be nice to loader threads while waiting for initial scenery, reduce to 2fps
simgear::sleepForMSec(500);
}
}
// This is the top level master main function that is registered as
-// our idle funciton
+// our idle function
// The first few passes take care of initialization things (a couple
// per pass) and once everything has been initialized fgMainLoop from
if (!guiFinishInit())
return;
idle_state++;
- fgSplashProgress("reading aircraft list");
-
+ fgSplashProgress("loading aircraft list");
} else if ( idle_state == 2 ) {
idle_state++;
-
- fgSplashProgress("reading airport & navigation data");
-
+ fgSplashProgress("loading navigation data");
} else if ( idle_state == 3 ) {
idle_state++;
fgInitNav();
- fgSplashProgress("setting up scenery");
+ fgSplashProgress("initializing scenery system");
} else if ( idle_state == 4 ) {
idle_state++;
////////////////////////////////////////////////////////////////////
fgInitCommands();
-
////////////////////////////////////////////////////////////////////
// Initialize the material manager
////////////////////////////////////////////////////////////////////
globals->set_matlib( new SGMaterialLib );
simgear::SGModelLib::init(globals->get_fg_root(), globals->get_props());
simgear::SGModelLib::setPanelFunc(load_panel);
-
+
////////////////////////////////////////////////////////////////////
// Initialize the TG scenery subsystem.
////////////////////////////////////////////////////////////////////
globals->get_scenery()->bind();
globals->set_tile_mgr( new FGTileMgr );
-
fgSplashProgress("loading aircraft");
-
} else if ( idle_state == 5 ) {
idle_state++;
- fgSplashProgress("generating sky elements");
-
+ fgSplashProgress("initializing sky elements");
} else if ( idle_state == 6 ) {
idle_state++;
// airport->setName( "Airport Lighting" );
// lighting->addKid( airport );
- // build our custom render states
fgSplashProgress("initializing subsystems");
-
} else if ( idle_state == 7 ) {
idle_state++;
// Initialize audio support
fgSetPosFromAirportIDandHdg( apt, hdg );
}
}
- fgSplashProgress("setting up time & renderer");
+
+ fgSplashProgress("initializing graphics engine");
} else if ( idle_state == 8 ) {
idle_state = 1000;
// setup OpenGL view parameters
- globals->get_renderer()->init();
+ globals->get_renderer()->setupView();
globals->get_renderer()->resize( fgGetInt("/sim/startup/xsize"),
fgGetInt("/sim/startup/ysize") );
- fgSplashProgress("loading scenery objects");
int session = fgGetInt("/sim/session",0);
session++;
fgSetInt("/sim/session",session);
return result;
}
-
-
_cloud_status = fgGetNode("/environment/clouds/status", true);
_visibility_m = fgGetNode("/environment/visibility-m", true);
+}
+void
+FGRenderer::setupView( void )
+{
osgViewer::Viewer* viewer = globals->get_renderer()->getViewer();
osg::initNotifyLevel();
// Update all Visuals (redraws anything graphics related)
void
FGRenderer::update( bool refresh_camera_settings ) {
- if ((!_scenery_loaded.get())||
- !(_scenery_loaded->getBoolValue() ||
+ if (!(_scenery_loaded->getBoolValue() ||
_scenery_override->getBoolValue()))
{
- // alas, first "update" is being called before "init"...
- fgSetDouble("/sim/startup/splash-alpha", 1.0);
+ _splash_alpha->setDoubleValue(1.0);
return;
}
osgViewer::Viewer* viewer = globals->get_renderer()->getViewer();
double delay_time = SGMiscd::min(fade_time/fade_steps_per_sec,
(SGTimeStamp::now() - _splash_time).toSecs());
_splash_time = SGTimeStamp::now();
- double sAlpha = fgGetDouble("/sim/startup/splash-alpha", 1.0);
+ double sAlpha = _splash_alpha->getDoubleValue();
sAlpha -= SGMiscd::max(0.0,delay_time/fade_time);
FGScenerySwitchCallback::scenery_enabled = (sAlpha<1.0);
- fgSetDouble("/sim/startup/splash-alpha", sAlpha);
+ _splash_alpha->setDoubleValue(sAlpha);
}
bool skyblend = _skyblend->getBoolValue();