-#ifdef HAVE_CONFIG_H\r
+#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#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,
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 ),
return *this;
}
-
//
// draw Draws a label anywhere in the HUD
//
}
} // 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" );