1
0
Fork 0

Jim Wilson: This patch prevents FDM execution until intial scenery load completes making

midair starts in the KSFO area possible again.
This commit is contained in:
ehofman 2004-07-22 16:42:14 +00:00
parent 517a7a3e5a
commit 9d972d86bf
4 changed files with 32 additions and 2 deletions

View file

@ -1875,5 +1875,6 @@ void fgReInitSubsystems()
fgSetBool("/sim/freeze/master", false);
}
fgSetBool("/sim/initialised", true);
fgSetBool("/sim/sceneryloaded",false);
}

View file

@ -84,6 +84,7 @@
#include <Time/tmp.hxx>
#include <Time/fg_timer.hxx>
#include <Environment/environment_mgr.hxx>
#include <GUI/new_gui.hxx>
#ifdef FG_MPLAYER_AS
#include <MultiPlayer/multiplaytxmgr.hxx>
@ -1205,8 +1206,16 @@ static void fgMainLoop( void ) {
}
// flight model
if ( global_multi_loop > 0 ) {
fgUpdateTimeDepCalcs();
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() or fgGetBool("sim/sceneryloaded")) {
fgUpdateTimeDepCalcs();
} else {
// only during scenery load
NewGUI * gui = (NewGUI *)globals->get_subsystem("gui");
gui->showDialog("scenery_loading");
}
} else {
SG_LOG( SG_ALL, SG_DEBUG,
"Elapsed time is zero ... we're zinging" );
@ -1330,6 +1339,13 @@ static void fgMainLoop( void ) {
// END Tile Manager udpates
if (!fgGetBool("sim/sceneryloaded") and globals->get_tile_mgr()->all_queues_empty() and 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")) {
glLightModeli(GL_LIGHT_MODEL_COLOR_CONTROL, GL_SEPARATE_SPECULAR_COLOR);
// glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE);
@ -1441,6 +1457,7 @@ static void fgIdleFunction ( void ) {
// We've finished all our initialization steps, from now on we
// run the main loop.
fgSetBool("sim/initialised",true);
fgSetBool("sim/sceneryloaded",false);
fgRegisterIdleHandler(fgMainLoop);
} else {

View file

@ -261,6 +261,15 @@ void FGTileMgr::initialize_queue()
#endif
}
/**
* return current status of queues
*
*/
bool FGTileMgr::all_queues_empty() {
return attach_queue.empty() && model_queue.empty();
}
/**
* Update the various queues maintained by the tilemagr (private

View file

@ -159,6 +159,9 @@ public:
// internal function, do not call directly.)
void update_queues();
// get state of all the scenery loading queues
bool all_queues_empty();
// given the current lon/lat (in degrees), fill in the array of
// local chunks. If the chunk isn't already in the cache, then
// read it from disk.