1
0
Fork 0

iFrederic Bouvier: Postpone rendering the scene until the scenery is loaded. This means that the splash screen remains a bit longer, but the scenery loading time is cut in half.

This commit is contained in:
ehofman 2004-08-15 11:25:15 +00:00
parent 4675058851
commit 827cfded73

View file

@ -380,6 +380,7 @@ void trRenderFrame( void ) {
// Update all Visuals (redraws anything graphics related)
void fgRenderFrame() {
bool scenery_loaded = fgGetBool("sim/sceneryloaded") || fgGetBool("sim/sceneryloaded-override");
bool draw_otw = fgGetBool("/sim/rendering/draw-otw");
bool skyblend = fgGetBool("/sim/rendering/skyblend");
bool enhanced_lighting = fgGetBool("/sim/rendering/enhanced-lighting");
@ -435,7 +436,7 @@ void fgRenderFrame() {
// GLfloat mat_shininess[] = { 10.0 };
GLbitfield clear_mask;
if ( idle_state != 1000 ) {
if ( idle_state != 1000 || !scenery_loaded ) {
// still initializing, draw the splash screen
if ( fgGetBool("/sim/startup/splash-screen") ) {
fgSplashUpdate(0.0, 1.0);
@ -1205,16 +1206,14 @@ static void fgMainLoop( void ) {
remainder = 0;
}
bool scenery_loaded = fgGetBool("sim/sceneryloaded") || fgGetBool("sim/sceneryloaded-override");
// flight model
if ( global_multi_loop > 0) {
// first run the flight model each frame until it is intialized
// then continue running each frame only after initial scenery load is complete.
if (!cur_fdm_state->get_inited() || fgGetBool("sim/sceneryloaded")) {
if (!cur_fdm_state->get_inited() || scenery_loaded) {
fgUpdateTimeDepCalcs();
} else {
// only during scenery load
NewGUI * gui = (NewGUI *)globals->get_subsystem("gui");
gui->showDialog("scenery_loading");
}
} else {
SG_LOG( SG_ALL, SG_DEBUG,
@ -1339,11 +1338,8 @@ static void fgMainLoop( void ) {
// END Tile Manager udpates
if (!fgGetBool("sim/sceneryloaded") && globals->get_tile_mgr()->all_queues_empty() && cur_fdm_state->get_inited()) {
if (!scenery_loaded && globals->get_tile_mgr()->all_queues_empty() && cur_fdm_state->get_inited()) {
fgSetBool("sim/sceneryloaded",true);
// probably not efficient way to popup msg, but is done only during scenery load
NewGUI * gui = (NewGUI *)globals->get_subsystem("gui");
gui->closeDialog("scenery_loading");
}
if (fgGetBool("/sim/rendering/specular-highlight")) {