From 827cfded73231d0c5457a561647897e412fd42f0 Mon Sep 17 00:00:00 2001 From: ehofman Date: Sun, 15 Aug 2004 11:25:15 +0000 Subject: [PATCH] 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. --- src/Main/main.cxx | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/Main/main.cxx b/src/Main/main.cxx index 2bb717155..57d58828a 100644 --- a/src/Main/main.cxx +++ b/src/Main/main.cxx @@ -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")) {