option.
// rough_elev = mesh_altitude(FG_Longitude * RAD_TO_ARCSEC,
// FG_Latitude * RAD_TO_ARCSEC);
- return( FG_Altitude * FEET_TO_METER /* -rough_elev */ );
+ if ( current_options.get_units() == fgOPTIONS::FG_UNITS_FEET ) {
+ return FG_Altitude;
+ } else {
+ return FG_Altitude * FEET_TO_METER;
+ }
}
double get_agl( void )
{
fgFLIGHT *f;
- double agl;
f = current_aircraft.flight;
- agl = FG_Altitude * FEET_TO_METER - scenery.cur_elev;
- return( agl );
+ if ( current_options.get_units() == fgOPTIONS::FG_UNITS_FEET ) {
+ return FG_Altitude - scenery.cur_elev * METER_TO_FEET;
+ } else {
+ return FG_Altitude * FEET_TO_METER - scenery.cur_elev;
+ }
}
double get_sideslip( void )
f = current_aircraft.flight;
- return( FG_Climb_Rate * FEET_TO_METER * 60.0 );
+ if ( current_options.get_units() == fgOPTIONS::FG_UNITS_FEET ) {
+ return FG_Climb_Rate * 60.0;
+ } else {
+ return FG_Climb_Rate * FEET_TO_METER * 60.0;
+ }
}
// $Log$
+// Revision 1.21 1998/11/02 23:04:02 curt
+// HUD units now display in feet by default with meters being a command line
+// option.
+//
// Revision 1.20 1998/10/25 14:08:40 curt
// Turned "struct fgCONTROLS" into a class, with inlined accessor functions.
//
tile_diameter(5),
// HUD options
+ units(FG_UNITS_FEET),
tris_or_culled(0),
// Time options
wireframe = false;
} else if ( arg == "--enable-wireframe" ) {
wireframe = true;
+ } else if ( arg == "--units-feet" ) {
+ units = FG_UNITS_FEET;
+ } else if ( arg == "--units-meters" ) {
+ units = FG_UNITS_METERS;
} else if ( arg.find( "--tile-radius=" ) != string::npos ) {
tile_radius = parse_tile_radius( arg.substr(14) );
tile_diameter = tile_radius * 2 + 1;
printf("\n");
printf("Hud Options:\n");
+ printf("\t--units-feet: Hud displays units in feet\n");
+ printf("\t--units-meters: Hud displays units in meters\n");
printf("\t--hud-tris: Hud displays number of triangles rendered\n");
printf("\t--hud-culled: Hud displays percentage of triangles culled\n");
// $Log$
+// Revision 1.27 1998/11/02 23:04:04 curt
+// HUD units now display in feet by default with meters being a command line
+// option.
+//
// Revision 1.26 1998/10/17 01:34:24 curt
// C++ ifying ...
//
FG_OPTIONS_ERROR = 2
};
+ enum
+ {
+ FG_UNITS_FEET = 0,
+ FG_UNITS_METERS = 1
+ };
+
enum fgFogKind
{
FG_FOG_DISABLED = 0,
// further away.
// HUD options
+ int units; // feet or meters
int tris_or_culled;
// Time options
inline int get_tile_radius() const { return tile_radius; }
inline int get_tile_diameter() const { return tile_diameter; }
inline int get_time_offset() const { return time_offset; }
+ inline int get_units() const { return units; }
inline int get_tris_or_culled() const { return tris_or_culled; }
// Update functions
// $Log$
+// Revision 1.20 1998/11/02 23:04:05 curt
+// HUD units now display in feet by default with meters being a command line
+// option.
+//
// Revision 1.19 1998/10/25 14:08:49 curt
// Turned "struct fgCONTROLS" into a class, with inlined accessor functions.
//