]> git.mxchange.org Git - flightgear.git/blobdiff - Cockpit/hud_guag.cxx
C++-ifying.
[flightgear.git] / Cockpit / hud_guag.cxx
index 7cc985bc22494ccb04bd2e189c8e5dcfe7d84295..cbc9fde6e923c6e54332c7bece9650fe5c555349 100644 (file)
@@ -1,4 +1,4 @@
-#ifdef HAVE_CONFIG_H\r
+#ifdef HAVE_CONFIG_H
 #  include <config.h>
 #endif
 
@@ -7,7 +7,7 @@
 #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>
@@ -19,7 +19,7 @@
 
 
 #include "hud.hxx"
-//============== Top of guage_instr class member definitions ==============\r
+//============== Top of guage_instr class member definitions ==============
 
 guage_instr ::
     guage_instr( int          x,
@@ -180,7 +180,7 @@ void guage_instr :: draw (void)
 
             if( !(options & HUDS_NOTEXT)) {
               disp_val = i;
-              sprintf( TextScale, "%d", disp_val );
+              sprintf( TextScale, "%d",disp_val  * (int)(data_scaling() +.5));
 
               if((options & HUDS_LEFT) && (options && HUDS_RIGHT)) {
                 text_x = mid_scr.x -  2 - ((3 * strlen( TextScale ))>>1);
@@ -209,16 +209,16 @@ void guage_instr :: draw (void)
 //    text_x = marker_xs - scrn_rect.left;
 
     if( options & HUDS_RIGHT ) {
-      drawOneLine(scrn_rect.left, text_y,
-                  marker_xe, text_y + 5);
-      drawOneLine(scrn_rect.left, text_y,
-                  marker_xe, text_y - 5);
+      drawOneLine(scrn_rect.left, text_y + 5,
+                  marker_xe,      text_y);
+      drawOneLine(scrn_rect.left, text_y - 5,
+                  marker_xe,      text_y);
       }
     if( options & HUDS_LEFT ) {
-      drawOneLine(scrn_rect.left + scrn_rect.right, text_y,
-                  marker_xs, text_y + 5);
-      drawOneLine(scrn_rect.left + scrn_rect.right, text_y,
-                  marker_xs, text_y - 5);
+      drawOneLine(scrn_rect.left + scrn_rect.right, text_y + 5,
+                  marker_xs,                        text_y);
+      drawOneLine(scrn_rect.left + scrn_rect.right, text_y - 5,
+                  marker_xs,                        text_y);
       }
     }  // End if VERTICAL SCALE TYPE
   else {                                // Horizontal scale by default
@@ -315,7 +315,7 @@ void guage_instr :: draw (void)
             else {
               disp_val = i;
               }
-            sprintf( TextScale, "%d", disp_val );
+            sprintf( TextScale, "%d", (int)(disp_val  * data_scaling() +.5));
             // Draw major ticks and text only if far enough from the edge.
             if(( (marker_xs - 10)> scrn_rect.left ) &&
                ( (marker_xs + 10) < (scrn_rect.left + scrn_rect.right))){