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:
parent
4675058851
commit
827cfded73
1 changed files with 6 additions and 10 deletions
|
@ -380,6 +380,7 @@ void trRenderFrame( void ) {
|
||||||
|
|
||||||
// Update all Visuals (redraws anything graphics related)
|
// Update all Visuals (redraws anything graphics related)
|
||||||
void fgRenderFrame() {
|
void fgRenderFrame() {
|
||||||
|
bool scenery_loaded = fgGetBool("sim/sceneryloaded") || fgGetBool("sim/sceneryloaded-override");
|
||||||
bool draw_otw = fgGetBool("/sim/rendering/draw-otw");
|
bool draw_otw = fgGetBool("/sim/rendering/draw-otw");
|
||||||
bool skyblend = fgGetBool("/sim/rendering/skyblend");
|
bool skyblend = fgGetBool("/sim/rendering/skyblend");
|
||||||
bool enhanced_lighting = fgGetBool("/sim/rendering/enhanced-lighting");
|
bool enhanced_lighting = fgGetBool("/sim/rendering/enhanced-lighting");
|
||||||
|
@ -435,7 +436,7 @@ void fgRenderFrame() {
|
||||||
// GLfloat mat_shininess[] = { 10.0 };
|
// GLfloat mat_shininess[] = { 10.0 };
|
||||||
GLbitfield clear_mask;
|
GLbitfield clear_mask;
|
||||||
|
|
||||||
if ( idle_state != 1000 ) {
|
if ( idle_state != 1000 || !scenery_loaded ) {
|
||||||
// still initializing, draw the splash screen
|
// still initializing, draw the splash screen
|
||||||
if ( fgGetBool("/sim/startup/splash-screen") ) {
|
if ( fgGetBool("/sim/startup/splash-screen") ) {
|
||||||
fgSplashUpdate(0.0, 1.0);
|
fgSplashUpdate(0.0, 1.0);
|
||||||
|
@ -1205,16 +1206,14 @@ static void fgMainLoop( void ) {
|
||||||
remainder = 0;
|
remainder = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool scenery_loaded = fgGetBool("sim/sceneryloaded") || fgGetBool("sim/sceneryloaded-override");
|
||||||
|
|
||||||
// flight model
|
// flight model
|
||||||
if ( global_multi_loop > 0) {
|
if ( global_multi_loop > 0) {
|
||||||
// first run the flight model each frame until it is intialized
|
// first run the flight model each frame until it is intialized
|
||||||
// then continue running each frame only after initial scenery load is complete.
|
// 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();
|
fgUpdateTimeDepCalcs();
|
||||||
} else {
|
|
||||||
// only during scenery load
|
|
||||||
NewGUI * gui = (NewGUI *)globals->get_subsystem("gui");
|
|
||||||
gui->showDialog("scenery_loading");
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
SG_LOG( SG_ALL, SG_DEBUG,
|
SG_LOG( SG_ALL, SG_DEBUG,
|
||||||
|
@ -1339,11 +1338,8 @@ static void fgMainLoop( void ) {
|
||||||
|
|
||||||
// END Tile Manager udpates
|
// 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);
|
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")) {
|
if (fgGetBool("/sim/rendering/specular-highlight")) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue