1
0
Fork 0

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).
This commit is contained in:
curt 2000-06-17 03:41:03 +00:00
parent bb61414e04
commit 9adf2456e2
4 changed files with 32 additions and 31 deletions

View file

@ -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}
}}
}},

View file

@ -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();
}

View file

@ -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);
// if (controls.get_throttle(0) > 0.0 ||
// cur_fdm_state->v_rel_wind > 40.0) {
// 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, "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;

View file

@ -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) -