_mode = check_format(_format.c_str());
if (_mode == INVALID) {
- SG_LOG(SG_INPUT, SG_ALERT, "HUD: invalid format '" << _format.c_str() << '\'');
+ SG_LOG(SG_INPUT, SG_ALERT, "HUD: invalid format '" << _format.c_str()
+ << "' in <label> '" << _name << '\'');
_format = "INVALID";
_mode = NONE;
}
_label_fmt = check_format(_format.c_str());
if (_label_fmt != INT && _label_fmt != LONG
&& _label_fmt != FLOAT && _label_fmt != DOUBLE) {
+ SG_LOG(SG_INPUT, SG_ALERT, "HUD: invalid <format> '" << _format.c_str()
+ << "' in <tape> '" << _name << "' (must be number format)");
_label_fmt = INT;
_format = "%d";
}
char *HUD::Tape::format_value(float v)
{
+ if (fabsf(v) < 1e-8)
+ v = 0.0f;
+
if (_label_fmt == INT)
snprintf(_buf, BUFSIZE, _format.c_str(), int(v + 0.5f));
else if (_label_fmt == LONG)