From 9adf2456e2fb35640c84bfad2736721886319ed8 Mon Sep 17 00:00:00 2001 From: curt Date: Sat, 17 Jun 2000 03:41:03 +0000 Subject: [PATCH] Updates from David Megginson: 1. I've modified src/Time/fg_time.cxx so that the --start-date-gmt option works correctly, at least on my system. 2. I've modified src/Main/bfi.cxx to return the correct time from FGBFI::getTimeGMT(), so that saving and reloading now keeps the time set correctly again. 3. I've modified src/Main/main.cxx so that the engine still makes a noise when it's idling (it sounded very strange when the engine simply turned off at idle then magically turned on again with a little throttle). --- src/Cockpit/sp_panel.cxx | 2 +- src/Main/bfi.cxx | 3 +-- src/Main/main.cxx | 58 +++++++++++++++++++++------------------- src/Time/fg_time.cxx | 2 +- 4 files changed, 33 insertions(+), 32 deletions(-) diff --git a/src/Cockpit/sp_panel.cxx b/src/Cockpit/sp_panel.cxx index 6f81955e5..356bdaa22 100644 --- a/src/Cockpit/sp_panel.cxx +++ b/src/Cockpit/sp_panel.cxx @@ -464,7 +464,7 @@ InstrumentData instruments[] = {new MyTexturedLayer("turnBall", int(SIX_W * (4.0/64.0)), int(SIX_W * (4.0/64.0))), { {TransData::Rotation, FGSteam::get_TC_rad, - -0.1, 0.1, -450.0, 0.0}, + -0.1, 0.1, -2000.0, 0.0}, {TransData::YShift, 0, 0.0, 0.0, 0.0, -(SIX_W/4)+4} }} }}, diff --git a/src/Main/bfi.cxx b/src/Main/bfi.cxx index c87ce8b9b..9c20d6996 100644 --- a/src/Main/bfi.cxx +++ b/src/Main/bfi.cxx @@ -249,8 +249,7 @@ FGBFI::setAircraftDir (const string &dir) time_t FGBFI::getTimeGMT () { - // FIXME: inefficient - return mktime(FGTime::cur_time_params->getGmt()); + return FGTime::cur_time_params->get_cur_time(); } diff --git a/src/Main/main.cxx b/src/Main/main.cxx index 6967b7b8a..67491f581 100644 --- a/src/Main/main.cxx +++ b/src/Main/main.cxx @@ -942,35 +942,37 @@ static void fgMainLoop( void ) { double pitch = log((controls.get_throttle(0) * 14.0) + 1.0); //fprintf(stderr, "pitch1: %f ", pitch); - if (controls.get_throttle(0) > 0.0 || cur_fdm_state->v_rel_wind > 40.0) { - //fprintf(stderr, "rel_wind: %f ", cur_fdm_state->v_rel_wind); - // only add relative wind and AoA if prop is moving - // or we're really flying at idle throttle - if (pitch < 5.4) { // this needs tuning - // prop tips not breaking sound barrier - pitch += log(cur_fdm_state->v_rel_wind + 0.8)/2; - } else { - // prop tips breaking sound barrier - pitch += log(cur_fdm_state->v_rel_wind + 0.8)/10; - } - //fprintf(stderr, "pitch2: %f ", pitch); - //fprintf(stderr, "AoA: %f ", FG_Gamma_vert_rad); - - // Angle of Attack next... -x^3(e^x) is my best guess Just - // need to calculate some reasonable scaling factor and - // then clamp it on the positive aoa (neg adj) side - double aoa = cur_fdm_state->get_Gamma_vert_rad() * 2.2; - double tmp = 3.0; - double aoa_adj = pow(-aoa, tmp) * pow(M_E, aoa); - if (aoa_adj < -0.8) aoa_adj = -0.8; - pitch += aoa_adj; - //fprintf(stderr, "pitch3: %f ", pitch); - - // don't run at absurdly slow rates -- not realistic - // and sounds bad to boot. :-) - if (pitch < 0.8) pitch = 0.8; + // if (controls.get_throttle(0) > 0.0 || + // cur_fdm_state->v_rel_wind > 40.0) { + + //fprintf(stderr, "rel_wind: %f ", cur_fdm_state->v_rel_wind); + // only add relative wind and AoA if prop is moving + // or we're really flying at idle throttle + if (pitch < 5.4) { // this needs tuning + // prop tips not breaking sound barrier + pitch += log(cur_fdm_state->v_rel_wind + 0.8)/2; + } else { + // prop tips breaking sound barrier + pitch += log(cur_fdm_state->v_rel_wind + 0.8)/10; } - //fprintf(stderr, "pitch4: %f\n", pitch); + //fprintf(stderr, "pitch2: %f ", pitch); + //fprintf(stderr, "AoA: %f ", FG_Gamma_vert_rad); + + // Angle of Attack next... -x^3(e^x) is my best guess Just + // need to calculate some reasonable scaling factor and + // then clamp it on the positive aoa (neg adj) side + double aoa = cur_fdm_state->get_Gamma_vert_rad() * 2.2; + double tmp = 3.0; + double aoa_adj = pow(-aoa, tmp) * pow(M_E, aoa); + if (aoa_adj < -0.8) aoa_adj = -0.8; + pitch += aoa_adj; + //fprintf(stderr, "pitch3: %f ", pitch); + + // don't run at absurdly slow rates -- not realistic + // and sounds bad to boot. :-) + if (pitch < 0.8) pitch = 0.8; + // } + // fprintf(stderr, "pitch4: %f\n", pitch); double volume = controls.get_throttle(0) * 1.15 + 0.3 + log(cur_fdm_state->v_rel_wind + 1.0)/14.0; diff --git a/src/Time/fg_time.cxx b/src/Time/fg_time.cxx index 69b29b461..4d8f7c012 100644 --- a/src/Time/fg_time.cxx +++ b/src/Time/fg_time.cxx @@ -187,7 +187,7 @@ void FGTime::init( double lon, double lat ) { //printf("warp = %d\n", warp); break; case fgOPTIONS::FG_TIME_GMT_ABSOLUTE: - warp = timeOffset - (currGMT - systemLocalTime) - cur_time; + warp = timeOffset - currGMT; break; case fgOPTIONS::FG_TIME_LAT_ABSOLUTE: warp = timeOffset - (aircraftLocalTime - systemLocalTime) - -- 2.39.5