]> git.mxchange.org Git - flightgear.git/blobdiff - src/Cockpit/hud.cxx
Updates to vacuum system model from Alex Perry.
[flightgear.git] / src / Cockpit / hud.cxx
index c76f684d06177245e58b3eca79fbee1e63a6daef..0d773c8c945164775639ab5045c98e6011530dc8 100644 (file)
 #  include <values.h>  // for MAXINT
 #endif
 
+#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 <Debug/logstream.hxx>
 #include <GUI/gui.h>
-#include <Include/fg_constants.h>
 #include <Main/options.hxx>
-#include <Math/fg_random.h>
-#include <Math/mat3.h>
-#include <Math/polar3d.hxx>
-#include <Network/network.h>
+#ifdef FG_NETWORK_OLK
+#include <NetworkOLK/network.h>
+#endif
 #include <Scenery/scenery.hxx>
 #include <Time/fg_timer.hxx>
 
@@ -184,7 +186,7 @@ int fgHUDInit( fgAIRCRAFT * /* current_aircraft */ )
 //  int index;
   int font_size;
 
-  int off = 50;
+//  int off = 50;
   int min_x = 25; //off/2;
   int max_x = 615; //640-(off/2);
 //  int min_y = off;
@@ -221,8 +223,8 @@ int fgHUDInit( fgAIRCRAFT * /* current_aircraft */ )
 //  fgHUDSetBrightness( hud, BRT_LIGHT );
 
 //      case 0:     // TBI
-  int x = 290; /*cen_x-30*/
-  int y = 45;  /*off-5*/
+//  int x = 290; /*cen_x-30*/
+//  int y = 45;  /*off-5*/
 //  HIptr = (instr_item *) new fgTBI_instr( x, y, ladr_w2, text_h );
   HIptr = (instr_item *) new fgTBI_instr( 290, 45, 60, 10 );  
   HUD_deque.insert( HUD_deque.begin(), HIptr);
@@ -333,6 +335,26 @@ int fgHUDInit( fgAIRCRAFT * /* current_aircraft */ )
                                        50.0,
                                        true);
 
+  
+  HUD_deque.insert( HUD_deque.begin(), HIptr);
+    
+
+//      case 10:    // Digital Mach number
+        HIptr = (instr_item *) new instr_label ( min_x , //same as speed tape
+                                                 cen_y-(compass_w/2) -10, //below speed tape
+                                                  40,
+                                                  30,
+                                                 get_mach,
+                                                 "%4.2f",
+                                                 "",
+                                                 NULL,
+                                                 1.0,
+                                                 HUDS_TOP,
+                                                 RIGHT_JUST,
+                                                 font_size,
+                                                 0,
+                                                 TRUE );
   HUD_deque.insert( HUD_deque.begin(), HIptr);
 
 //      case 9:
@@ -647,10 +669,10 @@ int fgHUDInit2( fgAIRCRAFT * /* current_aircraft */ )
 //  int min_y = off;
     int max_y = 480-off;
     int cen_x = 640 / 2;
-//  int cen_y = 480 / 2;
+    int cen_y = 480 / 2;
     int text_h = 10;
     int ladr_w2 = 60;
-//  int ladr_h2 = 90;
+    int ladr_h2 = 90;
 //  int ladr_t = 35;
     int compass_w = 200;
 //  int gap = 10;
@@ -681,6 +703,9 @@ int fgHUDInit2( fgAIRCRAFT * /* current_aircraft */ )
 
     instr_item* p;
 
+    p = new HudLadder( cen_x-ladr_w2, cen_y-ladr_h2, 2*ladr_w2, 2*ladr_h2, 1 );
+    HUD_deque.push_front( p );
+
 //      case 4:    // GYRO COMPASS
     p =new hud_card( cen_x-(compass_w/2),
                      max_y,
@@ -754,7 +779,7 @@ int fgHUDInit2( fgAIRCRAFT * /* current_aircraft */ )
                          0, 
                          TRUE );
     HUD_deque.push_front( p );
-
+#if 0
     p = new instr_label( x_pos, 40, 120, 10,
                          get_vfc_tris_culled,
                          "%7.0f",
@@ -780,8 +805,10 @@ int fgHUDInit2( fgAIRCRAFT * /* current_aircraft */ )
                          0,
                          TRUE );
     HUD_deque.push_front( p );
-    
-    p = new instr_label( x_pos, 70, 90, 10,
+#endif // 0
+       
+//    p = new instr_label( x_pos, 70, 90, 10,
+    p = new instr_label( x_pos, 40, 90, 10,
                          get_fov,
                          "%7.1f",
                          "FOV          = ",
@@ -1249,6 +1276,13 @@ void fgUpdateHUD( void ) {
   char *gmt_str = get_formated_gmt_time();
   HUD_TextList.add( fgText(40, 10, gmt_str) );
 
+#ifdef FG_NETWORK_OLK
+  if ( net_hud_display ) {
+      net_hud_update();
+  }
+#endif
+
+
   // temporary
   extern bool fgAPAltitudeEnabled( void );
   extern bool fgAPHeadingEnabled( void );
@@ -1259,7 +1293,7 @@ void fgUpdateHUD( void ) {
   extern char *fgAPget_TargetLatLonStr( void );
 
   int apY = 480 - 80;
-  char scratch[128];
+//  char scratch[128];
 //  HUD_TextList.add( fgText( "AUTOPILOT", 20, apY) );
 //  apY -= 15;
   if( fgAPHeadingEnabled() ) {