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;
void fgDumpSnapShot () {
bool show_pu_cursor = false;
+ int freeze = globals->get_freeze();
+ if(!freeze)
+ globals->set_freeze( true );
+
mainMenuBar->hide();
TurnCursorOff();
if ( !puCursorIsHidden() ) {
}
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
mainMenuBar->reveal();
}
+ if(!freeze)
+ globals->set_freeze( false );
}
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);
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