From fa2387c05bf5c64ab980848e2a79ffc2bf81af08 Mon Sep 17 00:00:00 2001 From: mfranz Date: Tue, 5 Aug 2008 05:22:05 +0000 Subject: [PATCH] - fix function argument order (top & bottom were swapped) - drop wrong and superfluous rounding (sprintf() rounds already) - remove redundant default values to property getters (default is 0 already) --- src/Instrumentation/HUD/HUD.cxx | 4 +--- src/Instrumentation/HUD/HUD_tape.cxx | 8 ++++---- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/Instrumentation/HUD/HUD.cxx b/src/Instrumentation/HUD/HUD.cxx index 4a42d47ef..4f480b47e 100644 --- a/src/Instrumentation/HUD/HUD.cxx +++ b/src/Instrumentation/HUD/HUD.cxx @@ -462,10 +462,8 @@ void HUD::setColor() const } - - void HUD::textAlign(fntRenderer *rend, const char *s, int align, - float *x, float *y, float *l, float *r, float *t, float *b) + float *x, float *y, float *l, float *r, float *b, float *t) { fntFont *font = rend->getFont(); float gap = font->getGap(); diff --git a/src/Instrumentation/HUD/HUD_tape.cxx b/src/Instrumentation/HUD/HUD_tape.cxx index 15909f819..db9e68fef 100644 --- a/src/Instrumentation/HUD/HUD_tape.cxx +++ b/src/Instrumentation/HUD/HUD_tape.cxx @@ -32,8 +32,8 @@ HUD::Tape::Tape(HUD *hud, const SGPropertyNode *n, float x, float y) : _draw_cap_top(n->getBoolValue("cap-top", false)), _draw_cap_right(n->getBoolValue("cap-right", false)), _draw_cap_left(n->getBoolValue("cap-left", false)), - _marker_offset(n->getFloatValue("marker-offset", 0.0)), - _label_gap(n->getFloatValue("label-gap-width", 0.0) / 2.0), + _marker_offset(n->getFloatValue("marker-offset")), + _label_gap(n->getFloatValue("label-gap-width") / 2.0), _pointer(n->getBoolValue("enable-pointer", true)), _format(n->getStringValue("format", "%d")) { @@ -531,9 +531,9 @@ char *HUD::Tape::format_value(float v) v = 0.0f; if (_label_fmt == INT) - snprintf(_buf, BUFSIZE, _format.c_str(), int(v + 0.5f)); + snprintf(_buf, BUFSIZE, _format.c_str(), int(v)); else if (_label_fmt == LONG) - snprintf(_buf, BUFSIZE, _format.c_str(), long(v + 0.5f)); + snprintf(_buf, BUFSIZE, _format.c_str(), long(v)); else if (_label_fmt == FLOAT) snprintf(_buf, BUFSIZE, _format.c_str(), v); else // _label_fmt == DOUBLE