1
0
Fork 0

Autopilot altitude increment fixes.

Screen snapshot fixes.
$FG_SCENERY fixes
FGIOChannel api tweaks.
This commit is contained in:
curt 2000-07-14 21:19:18 +00:00
parent 71747eb892
commit a7357e2de0
5 changed files with 40 additions and 19 deletions

View file

@ -780,8 +780,21 @@ void FGAutopilot::AltitudeAdjust( double inc )
target_agl = TargetAGL;
}
target_alt = ( int ) ( target_alt / inc ) * inc + inc;
target_agl = ( int ) ( target_agl / inc ) * inc + inc;
// cout << "target_agl = " << target_agl << endl;
// cout << "target_agl / inc = " << target_agl / inc << endl;
// cout << "(int)(target_agl / inc) = " << (int)(target_agl / inc) << endl;
if ( fabs((int)(target_alt / inc) * inc - target_alt) < FG_EPSILON ) {
target_alt += inc;
} else {
target_alt = ( int ) ( target_alt / inc ) * inc + inc;
}
if ( fabs((int)(target_agl / inc) * inc - target_agl) < FG_EPSILON ) {
target_agl += inc;
} else {
target_agl = ( int ) ( target_agl / inc ) * inc + inc;
}
if ( current_options.get_units() == fgOPTIONS::FG_UNITS_FEET ) {
target_alt *= FEET_TO_METER;

View file

@ -972,6 +972,10 @@ void dumpSnapShot ( puObject *obj ) {
void fgDumpSnapShot () {
bool show_pu_cursor = false;
int freeze = globals->get_freeze();
if(!freeze)
globals->set_freeze( true );
mainMenuBar->hide();
TurnCursorOff();
if ( !puCursorIsHidden() ) {
@ -980,7 +984,7 @@ void fgDumpSnapShot () {
}
fgInitVisuals();
fgReshape( current_options.get_xsize(), current_options.get_ysize() );
fgReshape( current_view.get_winWidth(), current_view.get_winHeight() );
// we need two render frames here to clear the menu and cursor
// ... not sure why but doing an extra fgFenderFrame() shoulnd't
@ -1003,6 +1007,8 @@ void fgDumpSnapShot () {
mainMenuBar->reveal();
}
if(!freeze)
globals->set_freeze( false );
}

View file

@ -132,31 +132,29 @@ static FGProtocol *parse_port_config( const string& config )
FG_LOG( FG_IO, FG_INFO, " hertz = " << hertz );
if ( medium == "serial" ) {
SGSerial *ch = new SGSerial;
io->set_io_channel( ch );
// device name
end = config.find(",", begin);
if ( end == string::npos ) {
return NULL;
}
ch->set_device( config.substr(begin, end - begin) );
string device = config.substr(begin, end - begin);
begin = end + 1;
FG_LOG( FG_IO, FG_INFO, " device = " << ch->get_device() );
FG_LOG( FG_IO, FG_INFO, " device = " << device );
// baud
ch->set_baud( config.substr(begin) );
FG_LOG( FG_IO, FG_INFO, " baud = " << ch->get_baud() );
string baud = config.substr(begin);
FG_LOG( FG_IO, FG_INFO, " baud = " << baud );
SGSerial *ch = new SGSerial( device, baud );
io->set_io_channel( ch );
} else if ( medium == "file" ) {
SGFile *ch = new SGFile;
io->set_io_channel( ch );
// file name
ch->set_file_name( config.substr(begin) );
FG_LOG( FG_IO, FG_INFO, " file name = " << ch->get_file_name() );
string file = config.substr(begin);
FG_LOG( FG_IO, FG_INFO, " file name = " << file );
SGFile *ch = new SGFile( file );
io->set_io_channel( ch );
} else if ( medium == "socket" ) {
// hostname
end = config.find(",", begin);

View file

@ -230,9 +230,7 @@ fgOPTIONS::fgOPTIONS() :
fg_scenery = envp;
} else {
// Otherwise, default to Scenery being in $FG_ROOT/Scenery
FGPath tmp( fg_root );
tmp.append( "Scenery" );
fg_scenery = tmp.str();
fg_scenery = "";
}
airport_id = ""; // default airport id

View file

@ -169,7 +169,13 @@ FGTileCache::fill_in( int index, const FGBucket& p )
tile_cache[index].range_ptr = new ssgRangeSelector;
tile_cache[index].tile_bucket = p;
FGPath tile_path( current_options.get_fg_scenery() );
FGPath tile_path;
if ( current_options.get_fg_scenery() != "" ) {
tile_path.set( current_options.get_fg_scenery() );
} else {
tile_path.set( current_options.get_fg_root() );
tile_path.append( "Scenery" );
}
tile_path.append( p.gen_base_path() );
// Load the appropriate data file