]> git.mxchange.org Git - flightgear.git/blobdiff - src/Cockpit/hud_lat.cxx
Added write-all parameter to save command. If set to true, the
[flightgear.git] / src / Cockpit / hud_lat.cxx
index ea9e61f71d5cfa2dcd5540e5466bf07494f5501a..e9e6a45203e7d6e8388c8623bbcea2d0c7082d97 100644 (file)
@@ -1,30 +1,11 @@
-#ifdef HAVE_CONFIG_H
-#  include <config.h>
-#endif
-
-#ifdef HAVE_WINDOWS_H
-#  include <windows.h>
-#endif
-
-#include <stdlib.h>
-#include <string.h>
-
-#include <simgear/constants.h>
-#include <simgear/math/fg_random.h>
-#include <simgear/math/polar3d.hxx>
-
-#include <Aircraft/aircraft.hxx>
-#include <GUI/gui.h>
-#include <Scenery/scenery.hxx>
-#include <Time/fg_timer.hxx>
 
 #include "hud.hxx"
 
 
 #ifdef USE_HUD_TextList
-#define textString( x , y, text, font )  TextString( text, x , y )
+#define textString( x , y, text, font,digit )  TextString( text, x , y,digit ) //suma
 #else
-#define textString( x , y, text, font )  puDrawString ( guiFnt, text, x, y );
+#define textString( x , y, text, font,digit )  puDrawString ( guiFnt, text, x, y ); //suma
 #endif
 
 //======================= Top of instr_label class =========================
@@ -42,9 +23,10 @@ lat_label ::
                       fgLabelJust   justification,
                       int           font_size,
                       int           blinking,
-                      bool          working ):
+                      bool          working ,
+                                         int                   digit): //suma
                            instr_item( x, y, width, height,
-                                       data_source, scale_data,options, working ),
+                                       data_source, scale_data,options, working,digit), //suma
                            pformat  ( label_format      ),
                            pre_str  ( pre_label_string  ),
                            post_str ( post_label_string ),
@@ -126,41 +108,42 @@ draw( void )       // Required method in base class
   int posincr;
   int lenstr;
   RECT  scrn_rect = get_location();
-  float lat = get_value();
+//  float lat = get_value();
   
   if( data_available() ) {
-     sprintf( label_buffer, format_buffer, coord_format_lat(lat) );
+//       sprintf( label_buffer, format_buffer, coord_format_lat(lat) );
+         sprintf( label_buffer, format_buffer,
+                          coord_format_lat( get_value()) );
     }
   else {
      sprintf( label_buffer, format_buffer );
-    }
+  }
     
 #ifdef DEBUGHUD
-  fgPrintf( FG_COCKPIT, FG_DEBUG,  format_buffer );
-  fgPrintf( FG_COCKPIT, FG_DEBUG,  "\n" );
-  fgPrintf( FG_COCKPIT, FG_DEBUG, label_buffer );
-  fgPrintf( FG_COCKPIT, FG_DEBUG, "\n" );
+  fgPrintf( SG_COCKPIT, SG_DEBUG,  format_buffer );
+  fgPrintf( SG_COCKPIT, SG_DEBUG,  "\n" );
+  fgPrintf( SG_COCKPIT, SG_DEBUG, label_buffer );
+  fgPrintf( SG_COCKPIT, SG_DEBUG, "\n" );
 #endif
 
-       lenstr = getStringWidth(label_buffer);
+  lenstr = getStringWidth(label_buffer);
                                                
   if( justify == RIGHT_JUST ) {
          posincr = scrn_rect.right - lenstr;
   }else if( justify == CENTER_JUST ) {
-         posincr = get_span() - (lenstr/2); //  -lenstr*4;
-  }  else {
-      //  justify == LEFT_JUST
+         posincr = get_span() - (lenstr/2);
+  }  else {  //  justify == LEFT_JUST
       posincr = 0;  // 0;
   }
   
   if( fontSize == SMALL ) {
     textString( scrn_rect.left + posincr, scrn_rect.top,
-                label_buffer, GLUT_BITMAP_8_BY_13);
+                label_buffer, GLUT_BITMAP_8_BY_13, get_digits()); //suma
     }
   else  {
     if( fontSize == LARGE ) {
       textString( scrn_rect.left + posincr, scrn_rect.top,
-                  label_buffer, GLUT_BITMAP_9_BY_15);
+                  label_buffer, GLUT_BITMAP_9_BY_15,get_digits()); //suma
       }
     }
 }