From f21847b3c2f23d5a2687256bfb1e8dbcd74867ba Mon Sep 17 00:00:00 2001 From: curt Date: Fri, 15 Sep 2000 19:28:26 +0000 Subject: [PATCH] bfi load/save fix from David. Added an initial freeze on startup so that we can try to avoid bouncing the plane on it's back during the very low frame rate / scenery loading startup conditions. --- src/Main/bfi.cxx | 18 +++++++++--------- src/Main/main.cxx | 9 ++++++++- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/src/Main/bfi.cxx b/src/Main/bfi.cxx index e39d43921..8dbd52096 100644 --- a/src/Main/bfi.cxx +++ b/src/Main/bfi.cxx @@ -250,15 +250,15 @@ FGBFI::reinit () cout << "BFI: start reinit\n"; - setHeading(getHeading()); - setPitch(getPitch()); - setRoll(getRoll()); - setSpeedNorth(getSpeedNorth()); - setSpeedEast(getSpeedEast()); - setSpeedDown(getSpeedDown()); - setLatitude(getLatitude()); - setLongitude(getLongitude()); - setAltitude(getAltitude()); +// setHeading(getHeading()); +// setPitch(getPitch()); +// setRoll(getRoll()); +// setSpeedNorth(getSpeedNorth()); +// setSpeedEast(getSpeedEast()); +// setSpeedDown(getSpeedDown()); +// setLatitude(getLatitude()); +// setLongitude(getLongitude()); +// setAltitude(getAltitude()); // TODO: add more AP stuff double elevator = getElevator(); diff --git a/src/Main/main.cxx b/src/Main/main.cxx index 626c85f7e..ef3bf9cdb 100644 --- a/src/Main/main.cxx +++ b/src/Main/main.cxx @@ -130,6 +130,9 @@ FGGeneral general; static int idle_state = 0; static int global_multi_loop; +// attempt to avoid a large bounce at startup +static bool initial_freeze = true; + // Another hack int use_signals = 0; @@ -617,7 +620,7 @@ void fgUpdateTimeDepCalcs(int multi_loop, int remainder) { multi_loop = 1; } - if ( !globals->get_freeze() ) { + if ( !globals->get_freeze() && !initial_freeze ) { // run Autopilot system current_autopilot->run(); @@ -633,6 +636,10 @@ void fgUpdateTimeDepCalcs(int multi_loop, int remainder) { // fdm_state, 0, remainder ); cur_fdm_state->update( 0 ); FGSteam::update( 0 ); + + if ( global_tile_mgr.queue_size() == 0 ) { + initial_freeze = false; + } } fdm_list.push_back( *cur_fdm_state );