]> git.mxchange.org Git - flightgear.git/blobdiff - src/Instrumentation/HUD/HUD_label.cxx
Quiet some log output.
[flightgear.git] / src / Instrumentation / HUD / HUD_label.cxx
index 431b8ae985e244263aef2151d6fe70980fb522eb..5414cf02fdd05a307858087ecd187c8cda7a246d 100644 (file)
 #  include <config.h>
 #endif
 
-#include <simgear/props/condition.hxx>
 #include "HUD.hxx"
+#include "HUD_private.hxx"
 
+#include <Main/globals.hxx>
 
 HUD::Label::Label(HUD *hud, const SGPropertyNode *n, float x, float y) :
     Item(hud, n, x, y),
@@ -81,7 +82,7 @@ HUD::Label::Label(HUD *hud, const SGPropertyNode *n, float x, float y) :
 
 void HUD::Label::draw(void)
 {
-    if (!(_mode == NONE || _input.isValid() && blink()))
+    if (!((_mode == NONE || _input.isValid()) && blink()))
         return;
 
     if (_box) {
@@ -90,7 +91,7 @@ void HUD::Label::draw(void)
 
         l = _center_x - pw;
         r = _center_x + pw;
-        bool draw_parallel = fabsf(_pointer_width - _w) > 2.0; // draw lines left and right of arrow?
+        bool draw_parallel = fabs(_pointer_width - _w) > 2.0; // draw lines left and right of arrow?
 
         if (option_bottom()) {
             if (draw_parallel) {
@@ -116,7 +117,7 @@ void HUD::Label::draw(void)
 
         l = _center_y - pw;
         r = _center_y + pw;
-        draw_parallel = fabsf(_pointer_width - _h) > 2.0;
+        draw_parallel = fabs(_pointer_width - _h) > 2.0;
 
         if (option_left()) {
             if (draw_parallel) {
@@ -145,7 +146,7 @@ void HUD::Label::draw(void)
     char buf[BUFSIZE+1];
        buf[ BUFSIZE] = '\0';  // Be sure to terminate properly
     if (_mode == NONE)
-        snprintf(buf, BUFSIZE, _format.c_str());
+        snprintf(buf, BUFSIZE, _format.c_str(), 0);
     else if (_mode == STRING)
         snprintf(buf, BUFSIZE, _format.c_str(), _input.getStringValue());
     else if (_mode == INT)