1 // HUD_tape.cxx -- HUD Tape Instrument
3 // Written by Michele America, started September 1997.
5 // Copyright (C) 1997 Michele F. America [micheleamerica#geocities:com]
6 // Copyright (C) 2006 Melchior FRANZ [mfranz#aon:at]
8 // This program is free software; you can redistribute it and/or
9 // modify it under the terms of the GNU General Public License as
10 // published by the Free Software Foundation; either version 2 of the
11 // License, or (at your option) any later version.
13 // This program is distributed in the hope that it will be useful, but
14 // WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // General Public License for more details.
18 // You should have received a copy of the GNU General Public License
19 // along with this program; if not, write to the Free Software
20 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
25 HUD::Tape::Tape(HUD *hud, const SGPropertyNode *n, float x, float y) :
27 _draw_tick_bottom(n->getBoolValue("tick-bottom", false)),
28 _draw_tick_top(n->getBoolValue("tick-top", false)),
29 _draw_tick_right(n->getBoolValue("tick-right", false)),
30 _draw_tick_left(n->getBoolValue("tick-left", false)),
31 _draw_cap_bottom(n->getBoolValue("cap-bottom", false)),
32 _draw_cap_top(n->getBoolValue("cap-top", false)),
33 _draw_cap_right(n->getBoolValue("cap-right", false)),
34 _draw_cap_left(n->getBoolValue("cap-left", false)),
35 _marker_offset(n->getFloatValue("marker-offset", 0.0)),
36 _label_gap(n->getFloatValue("label-gap-width", 0.0) / 2.0),
37 _pointer(n->getBoolValue("enable-pointer", true)),
38 _format(n->getStringValue("format", "%d")),
39 _zoom(n->getIntValue("zoom"))
41 _half_width_units = range_to_show() / 2.0;
44 s = n->getStringValue("pointer-type");
45 _pointer_type = strcmp(s, "moving") ? FIXED : MOVING; // "fixed", "moving"
47 s = n->getStringValue("tick-type");
48 _tick_type = strcmp(s, "circle") ? LINE : CIRCLE; // "circle", "line"
50 s = n->getStringValue("tick-length"); // "variable", "constant"
51 _tick_length = strcmp(s, "constant") ? VARIABLE : CONSTANT;
53 _label_fmt = check_format(_format.c_str());
54 if (_label_fmt != INT && _label_fmt != LONG
55 && _label_fmt != FLOAT && _label_fmt != DOUBLE) {
62 void HUD::Tape::draw(void) // (HUD_scale * pscale)
64 if (!_input.isValid())
67 float vmin = 0.0, vmax = 0.0;
74 // int k; //odd or even values for ticks // FIXME odd scale
76 float cur_value = _input.getFloatValue();
78 if (int(floorf(_input.max() + 0.5)) & 1)
79 oddtype = 1; //draw ticks at odd values
81 oddtype = 0; //draw ticks at even values
84 float right = _x + _w;
88 vmin = cur_value - _half_width_units; // width units == needle travel
89 vmax = cur_value + _half_width_units; // or picture unit span.
92 } else if (_pointer_type == MOVING) {
97 vmin = cur_value - _half_width_units; // width units == needle travel
98 vmax = cur_value + _half_width_units; // or picture unit span.
103 ///////////////////////////////////////////////////////////////////////////////
105 ///////////////////////////////////////////////////////////////////////////////
107 // Draw the basic markings for the scale...
109 if (option_vert()) { // Vertical scale
111 if (_draw_tick_bottom)
112 draw_line(_x, _y, right, _y);
116 draw_line(_x, top, right, top);
118 marker_xs = _x; // x start
119 marker_xe = right; // x extent
122 // We do not use else in the following so that combining the
123 // two options produces a "caged" display with double
124 // carrots. The same is done for horizontal card indicators.
126 // begin vertical/left
127 //First draw capping lines and pointers
128 if (option_left()) { // Calculate x marker offset
131 draw_line(marker_xe, _y, marker_xe, marker_ye);
133 marker_xs = marker_xe - _w / 3.0;
135 // draw_line(marker_xs, _center_y, marker_xe, _center_y + _w / 6);
136 // draw_line(marker_xs, _center_y, marker_xe, _center_y - _w / 6);
140 if (_pointer_type == MOVING) {
142 //Code for Moving Type Pointer
143 float ycentre, ypoint, xpoint;
146 if (_input.min() >= 0.0)
148 else if (_input.max() + _input.min() == 0.0)
151 ycentre = _y + (1.0 - _input.min()) * _h / (_input.max() - _input.min());
153 ycentre = _y + _input.min() * _h / (_input.max() - _input.min());
159 ypoint = ycentre + ((cur_value - 1.0) * range / _val_span);
161 ypoint = ycentre + (cur_value * range / _val_span);
163 xpoint = right + _marker_offset;
164 draw_line(xpoint, ycentre, xpoint, ypoint);
165 draw_line(xpoint, ypoint, xpoint - _marker_offset, ypoint);
166 draw_line(xpoint - _marker_offset, ypoint, xpoint - 5.0, ypoint + 5.0);
167 draw_line(xpoint - _marker_offset, ypoint, xpoint - 5.0, ypoint - 5.0);
172 draw_fixed_pointer(_marker_offset + marker_xe, text_y + _w / 6,
173 _marker_offset + marker_xs, text_y, _marker_offset + marker_xe,
175 } // end pointer type
177 } // end vertical/left
180 // begin vertical/right
181 // First draw capping lines and pointers
182 if (option_right()) {
185 draw_line(_x, _y, _x, marker_ye);
187 marker_xe = _x + _w / 3.0;
189 // draw_line(_x, _center_y + _w / 6, marker_xe, _center_y);
190 // draw_line(_x, _center_y - _w / 6, marker_xe, _center_y);
194 if (_pointer_type == MOVING) {
196 // type-fixed & _zoom=1, behaviour to be defined
197 // Code for Moving Type Pointer
198 float ycentre, ypoint, xpoint;
201 if (_input.min() >= 0.0)
203 else if (_input.max() + _input.min() == 0.0)
206 ycentre = _y + (1.0 - _input.min()) * _h / (_input.max() - _input.min());
208 ycentre = _y + _input.min() * _h / (_input.max() - _input.min());
213 ypoint = ycentre + ((cur_value - 1.0) * range / _val_span);
215 ypoint = ycentre + (cur_value * range / _val_span);
217 xpoint = _x - _marker_offset;
218 draw_line(xpoint, ycentre, xpoint, ypoint);
219 draw_line(xpoint, ypoint, xpoint + _marker_offset, ypoint);
220 draw_line(xpoint + _marker_offset, ypoint, xpoint + 5.0, ypoint + 5.0);
221 draw_line(xpoint + _marker_offset, ypoint, xpoint + 5.0, ypoint - 5.0);
226 draw_fixed_pointer(-_marker_offset + _x, text_y + _w / 6,
227 -_marker_offset + marker_xe, text_y, -_marker_offset + _x,
231 } // end vertical/right
234 // At this point marker x_start and x_end values are transposed.
235 // To keep this from confusing things they are now swapped.
237 marker_ye = marker_xs, marker_xs = marker_xe, marker_xe = marker_ye;
241 // Work through from bottom to top of scale. Calculating where to put
242 // minor and major ticks.
244 // draw scale or tape
246 zoomed_scale((int)vmin, (int)vmax);
250 if (_minor_divs != 0.0f)
251 div_ratio = int(_major_divs / _minor_divs + 0.5f);
253 div_ratio = 0, _minor_divs = _major_divs; // FIXME move that into Scale/Constructor ?
255 float vstart = floorf(vmin / _major_divs) * _major_divs;
256 float min_diff = _w / 6.0; // length difference between major & minor tick
258 // FIXME consider oddtype
259 for (int i = 0; ; i++) {
260 float v = vstart + i * _minor_divs;
263 if (v < _input.min())
265 else if (v > _input.max())
268 float y = _y + (v - vmin) * factor();
275 if (div_ratio && i % div_ratio) { // minor div
277 if (_tick_type == LINE) {
278 if (_tick_length == VARIABLE) {
279 draw_line(_x, y, marker_xs, y);
280 draw_line(marker_xe, y, right, y);
282 draw_line(_x, y, marker_xs, y);
283 draw_line(marker_xe, y, right, y);
286 } else { // _tick_type == CIRCLE
287 draw_bullet(_x, y, 3.0);
290 } else if (option_left()) {
291 if (_tick_type == LINE) {
292 if (_tick_length == VARIABLE) {
293 draw_line(marker_xs + min_diff, y, marker_xe, y);
295 draw_line(marker_xs, y, marker_xe, y);
297 } else { // _tick_type == CIRCLE
298 draw_bullet(marker_xs + 4, y, 3.0);
301 } else { // if (option_right())
302 if (_tick_type == LINE) {
303 if (_tick_length == VARIABLE) {
304 draw_line(marker_xs, y, marker_xe - min_diff, y);
306 draw_line(marker_xs, y, marker_xe, y);
309 } else { // _tick_type == CIRCLE
310 draw_bullet(marker_xe - 4, y, 3.0);
314 } else { // major div
316 v = fmodf(v + _modulo, _modulo);
322 if (_tick_type == LINE) {
323 draw_line(_x, y, marker_xs, y);
324 draw_line(marker_xs, y, right, y);
326 } else { // _tick_type == CIRCLE
327 draw_bullet(_x, y, 5.0);
330 x = marker_xs, align = CENTER;
333 if (_tick_type == LINE)
334 draw_line(marker_xs, y, marker_xe, y);
335 else // _tick_type == CIRCLE
336 draw_bullet(marker_xs + 4, y, 5.0);
339 x = marker_xs, align = RIGHT|VCENTER;
341 x = marker_xe, align = LEFT|VCENTER;
344 if (!option_notext()) {
345 char *s = format_value(v);
348 _hud->_text_list.align(s, align, &x, &y, &l, &r, &b, &t);
350 if (b < _y || t > top)
353 if (_label_gap == 0.0
354 || b < _center_y - _label_gap && t < _center_y - _label_gap
355 || b > _center_y + _label_gap && t > _center_y + _label_gap) {
364 ///////////////////////////////////////////////////////////////////////////////
366 ///////////////////////////////////////////////////////////////////////////////
372 draw_line(_x, _y, _x, top);
375 if (_draw_tick_right)
376 draw_line(right, _y, right, top);
378 marker_ys = _y; // Starting point for
379 marker_ye = top; // tick y location calcs
381 marker_xs = _x + ((cur_value - vmin) * factor());
384 if (_draw_cap_bottom)
385 draw_line(_x, _y, right, _y);
388 marker_ye = _y + _h / 2;
390 // draw_line(_center_x, marker_ye, _center_x - _h / 4, _y);
391 // draw_line(_center_x, marker_ye, _center_x + _h / 4, _y);
394 if (_pointer_type == MOVING) {
396 //Code for Moving Type Pointer
398 float xcentre = _center_x;
400 float xpoint = xcentre + (cur_value * range / _val_span);
401 float ypoint = _y - _marker_offset;
402 draw_line(xcentre, ypoint, xpoint, ypoint);
403 draw_line(xpoint, ypoint, xpoint, ypoint + _marker_offset);
404 draw_line(xpoint, ypoint + _marker_offset, xpoint + 5.0, ypoint + 5.0);
405 draw_line(xpoint, ypoint + _marker_offset, xpoint - 5.0, ypoint + 5.0);
410 draw_fixed_pointer(marker_xs - _h / 4, _y, marker_xs,
411 marker_ye, marker_xs + _h / 4, _y);
414 } // End Horizontal scale/top
416 if (option_bottom()) {
418 draw_line(_x, top, right, top);
421 marker_ys = top - _h / 2;
423 // draw_line(_center_x + _h / 4, _y + _h, _center_x, marker_ys);
424 // draw_line(_center_x - _h / 4, _y + _h, _center_x , marker_ys);
428 if (_pointer_type == MOVING) {
430 //Code for Moving Type Pointer
432 float xcentre = _center_x;
435 float xpoint = xcentre + (cur_value * range / _val_span);
436 float ypoint = hgt + _marker_offset;
437 draw_line(xcentre, ypoint, xpoint, ypoint);
438 draw_line(xpoint, ypoint, xpoint, ypoint - _marker_offset);
439 draw_line(xpoint, ypoint - _marker_offset, xpoint + 5.0, ypoint - 5.0);
440 draw_line(xpoint, ypoint - _marker_offset, xpoint - 5.0, ypoint - 5.0);
443 draw_fixed_pointer(marker_xs + _h / 4, top, marker_xs, marker_ys,
444 marker_xs - _h / 4, top);
447 } //end horizontal scale bottom
451 zoomed_scale((int)vmin,(int)vmax);
453 int div_ratio; // FIXME abstract that out of hor/vert
454 if (_minor_divs != 0.0f)
455 div_ratio = int(_major_divs / _minor_divs + 0.5f);
457 div_ratio = 0, _minor_divs = _major_divs; // FIXME move that into Scale/Constructor ?
459 float vstart = floorf(vmin / _major_divs) * _major_divs;
460 float min_diff = _h / 6.0; // length difference between major & minor tick
462 // FIXME consider oddtype
463 for (int i = 0; ; i++) {
464 float v = vstart + i * _minor_divs;
467 if (v < _input.min())
469 else if (v > _input.max())
472 float x = _x + (v - vmin) * factor();
479 if (div_ratio && i % div_ratio) { // minor div
481 if (_tick_length == VARIABLE) {
482 draw_line(x, _y, x, marker_ys - 4);
483 draw_line(x, marker_ye + 4, x, top);
485 draw_line(x, _y, x, marker_ys);
486 draw_line(x, marker_ye, x, top);
492 if (_tick_length == VARIABLE)
493 draw_line(x, marker_ys, x, marker_ye - min_diff);
495 draw_line(x, marker_ys, x, marker_ye);
497 } else if (_tick_length == VARIABLE) {
498 draw_line(x, marker_ys + 4, x, marker_ye);
500 draw_line(x, marker_ys, x, marker_ye);
504 } else { // major divs
506 v = fmodf(v + _modulo, _modulo);
512 draw_line(x, _y, x, marker_ye);
513 draw_line(x, marker_ye, x, _y + _h);
514 y = marker_ys, align = CENTER;
517 draw_line(x, marker_ys, x, marker_ye);
520 y = top, align = TOP|HCENTER;
522 y = _y, align = BOTTOM|HCENTER;
525 if (!option_notext()) {
526 char *s = format_value(v);
529 _hud->_text_list.align(s, align, &x, &y, &l, &r, &b, &t);
531 if (l < _x || r > right)
534 if (_label_gap == 0.0
535 || l < _center_x - _label_gap && r < _center_x - _label_gap
536 || l > _center_x + _label_gap && r > _center_x + _label_gap) {
543 } // end horizontal/vertical scale
547 char *HUD::Tape::format_value(float v)
549 if (_label_fmt == INT)
550 snprintf(_buf, BUFSIZE, _format.c_str(), int(v + 0.5f));
551 else if (_label_fmt == LONG)
552 snprintf(_buf, BUFSIZE, _format.c_str(), long(v + 0.5f));
553 else if (_label_fmt == FLOAT)
554 snprintf(_buf, BUFSIZE, _format.c_str(), v);
555 else // _label_fmt == DOUBLE
556 snprintf(_buf, BUFSIZE, _format.c_str(), double(v));
561 void HUD::Tape::draw_fixed_pointer(float x1, float y1, float x2, float y2, float x3, float y3)
563 glBegin(GL_LINE_STRIP);
571 void HUD::Tape::zoomed_scale(int first, int last)
573 const int BUFSIZE = 80;
577 float x, y, w, h, bottom;
578 float cur_value = _input.getFloatValue();
581 while (first <= last) {
582 if ((first % (int)_major_divs) == 0) {
597 float xstart, yfirst, ycentre, ysecond;
599 float hgt = bottom * 20.0 / 100.0; // 60% of height should be zoomed
600 yfirst = _center_y - hgt;
602 ysecond = _center_y + hgt;
603 float range = hgt * 2;
606 float factor = range / 10.0;
608 float hgt1 = bottom * 30.0 / 100.0;
609 int incrs = int((_val_span - _major_divs * 2.0) / _major_divs);
610 int incr = incrs / 2;
611 float factors = hgt1 / incr;
613 // moving type pointer
614 float ypoint, xpoint;
615 float ycent = _center_y;
616 float right = _x + _w;
618 if (cur_value <= data[centre + 1])
619 if (cur_value > data[centre]) {
620 ypoint = ycent + ((cur_value - data[centre]) * hgt / _major_divs);
623 if (cur_value >= data[centre - 1])
624 if (cur_value <= data[centre]) {
625 ypoint = ycent - ((data[centre] - cur_value) * hgt / _major_divs);
628 if (cur_value < data[centre - 1])
629 if (cur_value >= _input.min()) {
630 float diff = _input.min() - data[centre - 1];
631 float diff1 = cur_value - data[centre - 1];
632 float val = (diff1 * hgt1) / diff;
634 ypoint = ycent - hgt - val;
637 if (cur_value > data[centre + 1])
638 if (cur_value <= _input.max()) {
639 float diff = _input.max() - data[centre + 1];
640 float diff1 = cur_value - data[centre + 1];
641 float val = (diff1 * hgt1) / diff;
643 ypoint = ycent + hgt + val;
649 draw_line(xstart, ycentre, xstart - 5.0, ycentre); //centre tick
651 snprintf(buf, BUFSIZE, "%3.0f\n", float(data[centre] * _input.factor())); // was data_scaling() ... makes not sense at all
653 if (!option_notext())
654 draw_text(x, ycentre, buf, 0);
656 for (i = 1; i < 5; i++) {
659 draw_bullet(xstart - 2.5, yfirst, 3.0);
660 draw_bullet(xstart - 2.5, ycentre, 3.0);
663 yfirst = _center_y - hgt;
665 for (i = 0; i <= incr; i++) {
666 draw_line(xstart, yfirst, xstart - 5.0, yfirst);
667 draw_line(xstart, ysecond, xstart - 5.0, ysecond);
669 snprintf(buf, BUFSIZE, "%3.0f\n", float(data[centre - i - 1] * _input.factor())); // was data_scaling() ... makes no sense at all
671 if (!option_notext())
672 draw_text(x, yfirst, buf, 0);
674 snprintf(buf, BUFSIZE, "%3.0f\n", float(data[centre + i + 1] * _input.factor())); // was data_scaling() ... makes no sense at all
676 if (!option_notext())
677 draw_text(x, ysecond, buf, 0);
684 //to draw moving type pointer for left option
686 xpoint = right + 10.0;
688 if (_pointer_type == MOVING) {
689 draw_line(xpoint, ycent, xpoint, ypoint);
690 draw_line(xpoint, ypoint, xpoint - 10.0, ypoint);
691 draw_line(xpoint - 10.0, ypoint, xpoint - 5.0, ypoint + 5.0);
692 draw_line(xpoint - 10.0, ypoint, xpoint - 5.0, ypoint - 5.0);
698 xstart = (x + w) / 2;
700 draw_line(xstart, ycentre, xstart + 5.0, ycentre); //centre tick
702 snprintf(buf, BUFSIZE, "%3.0f\n", float(data[centre] * _input.factor())); // was data_scaling() ... makes no sense at all
704 if (!option_notext())
705 draw_text(w, ycentre, buf, 0);
707 for (i = 1; i < 5; i++) {
710 draw_bullet(xstart + 2.5, yfirst, 3.0);
711 draw_bullet(xstart + 2.5, ycentre, 3.0);
714 yfirst = _center_y - hgt;
716 for (i = 0; i <= incr; i++) {
717 draw_line(xstart, yfirst, xstart + 5.0, yfirst);
718 draw_line(xstart, ysecond, xstart + 5.0, ysecond);
720 snprintf(buf, BUFSIZE, "%3.0f\n", float(data[centre - i - 1] * _input.factor())); // was data_scaling() ... makes no sense at all
722 if (!option_notext())
723 draw_text(w, yfirst, buf, 0);
725 snprintf(buf, BUFSIZE, "%3.0f\n", float(data[centre + i + 1] * _input.factor()));
727 if (!option_notext())
728 draw_text(w, ysecond, buf, 0);
735 // to draw moving type pointer for right option
739 if (_pointer_type == MOVING) {
740 draw_line(xpoint, ycent, xpoint, ypoint);
741 draw_line(xpoint, ypoint, xpoint + 10.0, ypoint);
742 draw_line(xpoint + 10.0, ypoint, xpoint + 5.0, ypoint + 5.0);
743 draw_line(xpoint + 10.0, ypoint, xpoint + 5.0, ypoint - 5.0);
746 }//end option_right /left
747 //end of vertical scale
757 float ystart, xfirst, xcentre, xsecond;
759 float hgt = bottom * 20.0 / 100.0; // 60% of height should be zoomed
760 xfirst = _center_x - hgt;
762 xsecond = _center_x + hgt;
763 float range = hgt * 2;
766 float factor = range / 10.0;
768 float hgt1 = bottom * 30.0 / 100.0;
769 int incrs = int((_val_span - _major_divs * 2.0) / _major_divs);
770 int incr = incrs / 2;
771 float factors = hgt1 / incr;
774 // Code for Moving Type Pointer
775 float xpoint, ypoint;
776 float xcent = _center_x;
778 if (cur_value <= data[centre + 1]) {
779 if (cur_value > data[centre]) {
780 xpoint = xcent + ((cur_value - data[centre]) * hgt / _major_divs);
784 if (cur_value >= data[centre - 1]) {
785 if (cur_value <= data[centre]) {
786 xpoint = xcent - ((data[centre] - cur_value) * hgt / _major_divs);
790 if (cur_value < data[centre - 1]) {
791 if (cur_value >= _input.min()) {
792 float diff = _input.min() - data[centre - 1];
793 float diff1 = cur_value - data[centre - 1];
794 float val = (diff1 * hgt1) / diff;
796 xpoint = xcent - hgt - val;
800 if (cur_value > data[centre + 1]) {
801 if (cur_value <= _input.max()) {
802 float diff = _input.max() - data[centre + 1];
803 float diff1 = cur_value - data[centre + 1];
804 float val = (diff1 * hgt1) / diff;
806 xpoint = xcent + hgt + val;
809 // end moving pointer
813 draw_line(xcentre, ystart, xcentre, ystart - 5.0); //centre tick
815 snprintf(buf, BUFSIZE, "%3.0f\n", float(data[centre] * _input.factor())); // was data_scaling() ... makes no sense at all
817 if (!option_notext())
818 draw_text(xcentre - 10.0, y, buf, 0);
820 for (i = 1; i < 5; i++) {
823 draw_bullet(xfirst, ystart - 2.5, 3.0);
824 draw_bullet(xcentre, ystart - 2.5, 3.0);
827 xfirst = _center_x - hgt;
829 for (i = 0; i <= incr; i++) {
830 draw_line(xfirst, ystart, xfirst, ystart - 5.0);
831 draw_line(xsecond, ystart, xsecond, ystart - 5.0);
833 snprintf(buf, BUFSIZE, "%3.0f\n", float(data[centre - i - 1] * _input.factor())); // was data_scaling() ... makes no sense at all
835 if (!option_notext())
836 draw_text(xfirst - 10.0, y, buf, 0);
838 snprintf(buf, BUFSIZE, "%3.0f\n", float(data[centre + i + 1] * _input.factor())); // was data_scaling() ... makes no sense at all
840 if (!option_notext())
841 draw_text(xsecond - 10.0, y, buf, 0);
848 // moving pointer for top option
849 ypoint = _y + _h + 10.0;
851 if (_pointer_type == MOVING) {
852 draw_line(xcent, ypoint, xpoint, ypoint);
853 draw_line(xpoint, ypoint, xpoint, ypoint - 10.0);
854 draw_line(xpoint, ypoint - 10.0, xpoint + 5.0, ypoint - 5.0);
855 draw_line(xpoint, ypoint - 10.0, xpoint - 5.0, ypoint - 5.0);
861 ystart = (y + h) / 2;
863 //draw_line(xstart, yfirst, xstart - 5.0, yfirst);
864 draw_line(xcentre, ystart, xcentre, ystart + 5.0); //centre tick
866 snprintf(buf, BUFSIZE, "%3.0f\n", float(data[centre] * _input.factor())); // was data_scaling() ... makes no sense at all
868 if (!option_notext())
869 draw_text(xcentre - 10.0, h, buf, 0);
871 for (i = 1; i < 5; i++) {
874 draw_bullet(xfirst, ystart + 2.5, 3.0);
875 draw_bullet(xcentre, ystart + 2.5, 3.0);
878 xfirst = _center_x - hgt;
880 for (i = 0; i <= incr; i++) {
881 draw_line(xfirst, ystart, xfirst, ystart + 5.0);
882 draw_line(xsecond, ystart, xsecond, ystart + 5.0);
884 snprintf(buf, BUFSIZE, "%3.0f\n", float(data[centre - i - 1] * _input.factor())); // was data_scaling() ... makes no sense at all
886 if (!option_notext())
887 draw_text(xfirst - 10.0, h, buf, 0);
889 snprintf(buf, BUFSIZE, "%3.0f\n", float(data[centre + i + 1] * _input.factor())); // was data_scaling() ... makes no sense at all
891 if (!option_notext())
892 draw_text(xsecond - 10.0, h, buf, 0);
898 // movimg pointer for bottom option
900 if (_pointer_type == MOVING) {
901 draw_line(xcent, ypoint, xpoint, ypoint);
902 draw_line(xpoint, ypoint, xpoint, ypoint + 10.0);
903 draw_line(xpoint, ypoint + 10.0, xpoint + 5.0, ypoint + 5.0);
904 draw_line(xpoint, ypoint + 10.0, xpoint - 5.0, ypoint + 5.0);
906 }//end hud_top or hud_bottom
907 } //end of horizontal/vertical scales