]> git.mxchange.org Git - flightgear.git/blobdiff - Cockpit/hud_labl.cxx
C++-ifying.
[flightgear.git] / Cockpit / hud_labl.cxx
index 5ff5fa72e23d011dd726ecde638a6a1232c5e260..e98e1df1ff24332a532a673b39c32afc451e047c 100644 (file)
@@ -1,4 +1,4 @@
-#ifdef HAVE_CONFIG_H\r
+#ifdef HAVE_CONFIG_H
 #  include <config.h>
 #endif
 
@@ -7,20 +7,20 @@
 #endif
 #include <stdlib.h>
 #include <string.h>
-#include <Aircraft/aircraft.h>
+#include <Aircraft/aircraft.hxx>
 #include <Debug/fg_debug.h>
 #include <Include/fg_constants.h>
 #include <Math/fg_random.h>
 #include <Math/mat3.h>
-#include <Math/polar3d.h>
+#include <Math/polar3d.hxx>
 #include <Scenery/scenery.hxx>
 #include <Time/fg_timer.hxx>
 #include <Weather/weather.h>
 
 
 #include "hud.hxx"
-\r
-//======================= Top of instr_label class =========================\r
+
+//======================= Top of instr_label class =========================
 instr_label ::
          instr_label( int           x,
                       int           y,
@@ -30,13 +30,14 @@ instr_label ::
                       const char   *label_format,
                       const char   *pre_label_string,
                       const char   *post_label_string,
+                      double        scale_data,
                       UINT          options,
                       fgLabelJust   justification,
                       int           font_size,
                       int           blinking,
                       bool          working ):
                            instr_item( x, y, width, height,
-                                       data_source, options, working ),
+                                       data_source, scale_data,options, working ),
                            pformat  ( label_format      ),
                            pre_str  ( pre_label_string  ),
                            post_str ( post_label_string ),
@@ -78,7 +79,6 @@ instr_label & instr_label ::operator = (const instr_label & rhs )
        return *this;
 }
 
-
 //
 // draw                    Draws a label anywhere in the HUD
 //
@@ -106,7 +106,13 @@ draw( void )       // Required method in base class
       }
     } // else do nothing if both pre and post strings are nulls. Interesting.
 
-  sprintf( label_buffer, format_buffer, get_value() );
+  if( data_available() ) {
+    sprintf( label_buffer, format_buffer, get_value() );
+    }
+  else {
+    sprintf( label_buffer, format_buffer );
+    }
+    
 #ifdef DEBUGHUD
        fgPrintf( FG_COCKPIT, FG_DEBUG,  format_buffer );
        fgPrintf( FG_COCKPIT, FG_DEBUG,  "\n" );