]> git.mxchange.org Git - flightgear.git/blobdiff - src/Cockpit/cockpit.cxx
Tweaks for Mips Irix compilers.
[flightgear.git] / src / Cockpit / cockpit.cxx
index 1a608409e11b5b183ed1a3210785732fa7195960..81f40ddb9060dee026df286c34df5ff55f63f53f 100644 (file)
 
 #include <simgear/constants.h>
 #include <simgear/debug/logstream.hxx>
-#include <simgear/math/fg_random.h>
 #include <simgear/math/polar3d.hxx>
 
 #include <Aircraft/aircraft.hxx>
 #include <Include/general.hxx>
 #include <FDM/ADA.hxx>
 #include <Main/globals.hxx>
+#include <Main/fg_props.hxx>
 #include <Scenery/scenery.hxx>
 #include <Time/fg_timer.hxx>
 #include <GUI/gui.h>
@@ -155,7 +155,7 @@ float get_speed( void )
 {
     // Make an explicit function call.
     float speed = current_aircraft.fdm_state->get_V_calibrated_kts()
-       * globals->get_options()->get_speed_up();
+       * fgGetInt("/sim/speed-up"); // FIXME: inefficient
     return( speed );
 }
 
@@ -199,7 +199,7 @@ float get_altitude( void )
     //                         f->get_Latitude()  * RAD_TO_ARCSEC);
     float altitude;
 
-    if ( globals->get_options()->get_units() == FGOptions::FG_UNITS_FEET ) {
+    if ( fgGetString("/sim/startup/units") == "feet" ) {
         altitude = current_aircraft.fdm_state->get_Altitude();
     } else {
         altitude = (current_aircraft.fdm_state->get_Altitude() * FEET_TO_METER);
@@ -211,7 +211,7 @@ float get_agl( void )
 {
     float agl;
 
-    if ( globals->get_options()->get_units() == FGOptions::FG_UNITS_FEET ) {
+    if ( fgGetString("/sim/startup/units") == "feet" ) {
         agl = (current_aircraft.fdm_state->get_Altitude()
                - scenery.cur_elev * METER_TO_FEET);
     } else {
@@ -263,7 +263,7 @@ float get_vfc_tris_culled   ( void )
 float get_climb_rate( void )
 {
     float climb_rate;
-    if ( globals->get_options()->get_units() == FGOptions::FG_UNITS_FEET ) {
+    if ( fgGetString("/sim/startup/units") == "feet" ) {
         climb_rate = current_aircraft.fdm_state->get_Climb_Rate() * 60.0;
     } else {
         climb_rate = current_aircraft.fdm_state->get_Climb_Rate() * FEET_TO_METER * 60.0;
@@ -287,22 +287,28 @@ float get_view_direction( void )
 }
 
 // $$$ begin - added, VS Renganathan 13 Oct 2K
-#ifdef FIGHTER_HUD
+// #ifdef FIGHTER_HUD
 float get_Vx   ( void )
 {
-    float Vxx = current_aircraft.fdm_state->get_V_north_rel_ground();
+    // CLO - 5 Jan 2000 - something needs to get addressed here
+    // float Vxx = current_aircraft.fdm_state->get_V_north_rel_ground();
+    float Vxx = 0;
     return (Vxx);
 }
 
 float get_Vy   ( void )
 {
-    float Vyy = current_aircraft.fdm_state->get_V_east_rel_ground();
+    // CLO - 5 Jan 2000 - something needs to get addressed here
+    // float Vyy = current_aircraft.fdm_state->get_V_east_rel_ground();
+    float Vyy = 0;
     return (Vyy);
 }
 
 float get_Vz   ( void )
 {
-    float Vzz = current_aircraft.fdm_state->get_V_down_rel_ground();
+    // CLO - 5 Jan 2000 - something needs to get addressed here
+    // float Vzz = current_aircraft.fdm_state->get_V_down_rel_ground();
+    float Vzz = 0;
     return (Vzz);
 }
 
@@ -509,7 +515,7 @@ float get_aux18 (void)
     FGADA *fdm = (FGADA *)current_aircraft.fdm_state;
     return fdm->get_aux18();
 }
-#endif
+// #endif
 // $$$ end - added, VS Renganathan 13 Oct 2K
 
 
@@ -699,12 +705,15 @@ void fgCockpitUpdate( void ) {
         "Cockpit: code " << ac_cockpit->code() << " status " 
         << ac_cockpit->status() );
 
-       int iwidth   = globals->get_options()->get_xsize();
-       int iheight  = globals->get_options()->get_ysize();
+                               // FIXME: inefficient
+       int iwidth   = fgGetInt("/sim/startup/xsize");
+                               // FIXME: inefficient
+       int iheight  = fgGetInt("/sim/startup/ysize");
        float width  = iwidth;
        float height = iheight;
 
-    if ( globals->get_options()->get_hud_status() ) {
+                               // FIXME: inefficient
+    if ( fgGetBool("/sim/hud/visibility") ) {
         // This will check the global hud linked list pointer.
         // If these is anything to draw it will.
         fgUpdateHUD();
@@ -723,8 +732,8 @@ void fgCockpitUpdate( void ) {
         glMatrixMode( GL_PROJECTION );
         glPushMatrix();
         glLoadIdentity();
-        gluOrtho2D( 0, globals->get_options()->get_xsize(),
-                   0, globals->get_options()->get_ysize() );
+        gluOrtho2D( 0, fgGetInt("/sim/startup/xsize"),
+                   0, fgGetInt("/sim/startup/ysize") );
         glMatrixMode( GL_MODELVIEW );
         glPushMatrix();
         glLoadIdentity();
@@ -747,9 +756,7 @@ void fgCockpitUpdate( void ) {
 #endif // #ifdef DISPLAY_COUNTER
     
     glViewport( 0, 0, 
-               globals->get_options()->get_xsize(),
-               globals->get_options()->get_ysize() );
+               fgGetInt("/sim/startup/xsize"),
+               fgGetInt("/sim/startup/ysize") );
 
-    if (current_panel != 0)
-      current_panel->update();
 }