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) {
56 SG_LOG(SG_INPUT, SG_ALERT, "HUD: invalid <format> '" << _format.c_str()
57 << "' in <tape> '" << _name << "' (must be number format)");
64 void HUD::Tape::draw(void) // (HUD_scale * pscale)
66 if (!_input.isValid())
69 float vmin = 0.0, vmax = 0.0;
76 // int k; //odd or even values for ticks // FIXME odd scale
78 float cur_value = _input.getFloatValue();
80 if (int(floorf(_input.max() + 0.5)) & 1)
81 oddtype = 1; //draw ticks at odd values
83 oddtype = 0; //draw ticks at even values
86 float right = _x + _w;
90 vmin = cur_value - _half_width_units; // width units == needle travel
91 vmax = cur_value + _half_width_units; // or picture unit span.
94 } else if (_pointer_type == MOVING) {
99 vmin = cur_value - _half_width_units; // width units == needle travel
100 vmax = cur_value + _half_width_units; // or picture unit span.
105 ///////////////////////////////////////////////////////////////////////////////
107 ///////////////////////////////////////////////////////////////////////////////
109 // Draw the basic markings for the scale...
111 if (option_vert()) { // Vertical scale
113 if (_draw_tick_bottom)
114 draw_line(_x, _y, right, _y);
118 draw_line(_x, top, right, top);
120 marker_xs = _x; // x start
121 marker_xe = right; // x extent
124 // We do not use else in the following so that combining the
125 // two options produces a "caged" display with double
126 // carrots. The same is done for horizontal card indicators.
128 // begin vertical/left
129 //First draw capping lines and pointers
130 if (option_left()) { // Calculate x marker offset
133 draw_line(marker_xe, _y, marker_xe, marker_ye);
135 marker_xs = marker_xe - _w / 3.0;
137 // draw_line(marker_xs, _center_y, marker_xe, _center_y + _w / 6);
138 // draw_line(marker_xs, _center_y, marker_xe, _center_y - _w / 6);
142 if (_pointer_type == MOVING) {
144 //Code for Moving Type Pointer
145 float ycentre, ypoint, xpoint;
148 if (_input.min() >= 0.0)
150 else if (_input.max() + _input.min() == 0.0)
153 ycentre = _y + (1.0 - _input.min()) * _h / (_input.max() - _input.min());
155 ycentre = _y + _input.min() * _h / (_input.max() - _input.min());
161 ypoint = ycentre + ((cur_value - 1.0) * range / _val_span);
163 ypoint = ycentre + (cur_value * range / _val_span);
165 xpoint = right + _marker_offset;
166 draw_line(xpoint, ycentre, xpoint, ypoint);
167 draw_line(xpoint, ypoint, xpoint - _marker_offset, ypoint);
168 draw_line(xpoint - _marker_offset, ypoint, xpoint - 5.0, ypoint + 5.0);
169 draw_line(xpoint - _marker_offset, ypoint, xpoint - 5.0, ypoint - 5.0);
174 draw_fixed_pointer(_marker_offset + marker_xe, text_y + _w / 6,
175 _marker_offset + marker_xs, text_y, _marker_offset + marker_xe,
177 } // end pointer type
179 } // end vertical/left
182 // begin vertical/right
183 // First draw capping lines and pointers
184 if (option_right()) {
187 draw_line(_x, _y, _x, marker_ye);
189 marker_xe = _x + _w / 3.0;
191 // draw_line(_x, _center_y + _w / 6, marker_xe, _center_y);
192 // draw_line(_x, _center_y - _w / 6, marker_xe, _center_y);
196 if (_pointer_type == MOVING) {
198 // type-fixed & _zoom=1, behaviour to be defined
199 // Code for Moving Type Pointer
200 float ycentre, ypoint, xpoint;
203 if (_input.min() >= 0.0)
205 else if (_input.max() + _input.min() == 0.0)
208 ycentre = _y + (1.0 - _input.min()) * _h / (_input.max() - _input.min());
210 ycentre = _y + _input.min() * _h / (_input.max() - _input.min());
215 ypoint = ycentre + ((cur_value - 1.0) * range / _val_span);
217 ypoint = ycentre + (cur_value * range / _val_span);
219 xpoint = _x - _marker_offset;
220 draw_line(xpoint, ycentre, xpoint, ypoint);
221 draw_line(xpoint, ypoint, xpoint + _marker_offset, ypoint);
222 draw_line(xpoint + _marker_offset, ypoint, xpoint + 5.0, ypoint + 5.0);
223 draw_line(xpoint + _marker_offset, ypoint, xpoint + 5.0, ypoint - 5.0);
228 draw_fixed_pointer(-_marker_offset + _x, text_y + _w / 6,
229 -_marker_offset + marker_xe, text_y, -_marker_offset + _x,
233 } // end vertical/right
236 // At this point marker x_start and x_end values are transposed.
237 // To keep this from confusing things they are now swapped.
239 marker_ye = marker_xs, marker_xs = marker_xe, marker_xe = marker_ye;
243 // Work through from bottom to top of scale. Calculating where to put
244 // minor and major ticks.
246 // draw scale or tape
248 zoomed_scale((int)vmin, (int)vmax);
252 if (_minor_divs != 0.0f)
253 div_ratio = int(_major_divs / _minor_divs + 0.5f);
255 div_ratio = 0, _minor_divs = _major_divs; // FIXME move that into Scale/Constructor ?
257 float vstart = floorf(vmin / _major_divs) * _major_divs;
258 float min_diff = _w / 6.0; // length difference between major & minor tick
260 // FIXME consider oddtype
261 for (int i = 0; ; i++) {
262 float v = vstart + i * _minor_divs;
265 if (v < _input.min())
267 else if (v > _input.max())
270 float y = _y + (v - vmin) * factor();
277 if (div_ratio && i % div_ratio) { // minor div
279 if (_tick_type == LINE) {
280 if (_tick_length == VARIABLE) {
281 draw_line(_x, y, marker_xs, y);
282 draw_line(marker_xe, y, right, y);
284 draw_line(_x, y, marker_xs, y);
285 draw_line(marker_xe, y, right, y);
288 } else { // _tick_type == CIRCLE
289 draw_bullet(_x, y, 3.0);
292 } else if (option_left()) {
293 if (_tick_type == LINE) {
294 if (_tick_length == VARIABLE) {
295 draw_line(marker_xs + min_diff, y, marker_xe, y);
297 draw_line(marker_xs, y, marker_xe, y);
299 } else { // _tick_type == CIRCLE
300 draw_bullet(marker_xs + 4, y, 3.0);
303 } else { // if (option_right())
304 if (_tick_type == LINE) {
305 if (_tick_length == VARIABLE) {
306 draw_line(marker_xs, y, marker_xe - min_diff, y);
308 draw_line(marker_xs, y, marker_xe, y);
311 } else { // _tick_type == CIRCLE
312 draw_bullet(marker_xe - 4, y, 3.0);
316 } else { // major div
318 v = fmodf(v + _modulo, _modulo);
324 if (_tick_type == LINE) {
325 draw_line(_x, y, marker_xs, y);
326 draw_line(marker_xs, y, right, y);
328 } else { // _tick_type == CIRCLE
329 draw_bullet(_x, y, 5.0);
332 x = marker_xs, align = CENTER;
335 if (_tick_type == LINE)
336 draw_line(marker_xs, y, marker_xe, y);
337 else // _tick_type == CIRCLE
338 draw_bullet(marker_xs + 4, y, 5.0);
341 x = marker_xs, align = RIGHT|VCENTER;
343 x = marker_xe, align = LEFT|VCENTER;
346 if (!option_notext()) {
347 char *s = format_value(v);
350 _hud->_text_list.align(s, align, &x, &y, &l, &r, &b, &t);
352 if (b < _y || t > top)
355 if (_label_gap == 0.0
356 || b < _center_y - _label_gap && t < _center_y - _label_gap
357 || b > _center_y + _label_gap && t > _center_y + _label_gap) {
366 ///////////////////////////////////////////////////////////////////////////////
368 ///////////////////////////////////////////////////////////////////////////////
374 draw_line(_x, _y, _x, top);
377 if (_draw_tick_right)
378 draw_line(right, _y, right, top);
380 marker_ys = _y; // Starting point for
381 marker_ye = top; // tick y location calcs
383 marker_xs = _x + ((cur_value - vmin) * factor());
386 if (_draw_cap_bottom)
387 draw_line(_x, _y, right, _y);
390 marker_ye = _y + _h / 2;
392 // draw_line(_center_x, marker_ye, _center_x - _h / 4, _y);
393 // draw_line(_center_x, marker_ye, _center_x + _h / 4, _y);
396 if (_pointer_type == MOVING) {
398 //Code for Moving Type Pointer
400 float xcentre = _center_x;
402 float xpoint = xcentre + (cur_value * range / _val_span);
403 float ypoint = _y - _marker_offset;
404 draw_line(xcentre, ypoint, xpoint, ypoint);
405 draw_line(xpoint, ypoint, xpoint, ypoint + _marker_offset);
406 draw_line(xpoint, ypoint + _marker_offset, xpoint + 5.0, ypoint + 5.0);
407 draw_line(xpoint, ypoint + _marker_offset, xpoint - 5.0, ypoint + 5.0);
412 draw_fixed_pointer(marker_xs - _h / 4, _y, marker_xs,
413 marker_ye, marker_xs + _h / 4, _y);
416 } // End Horizontal scale/top
418 if (option_bottom()) {
420 draw_line(_x, top, right, top);
423 marker_ys = top - _h / 2;
425 // draw_line(_center_x + _h / 4, _y + _h, _center_x, marker_ys);
426 // draw_line(_center_x - _h / 4, _y + _h, _center_x , marker_ys);
430 if (_pointer_type == MOVING) {
432 //Code for Moving Type Pointer
434 float xcentre = _center_x;
437 float xpoint = xcentre + (cur_value * range / _val_span);
438 float ypoint = hgt + _marker_offset;
439 draw_line(xcentre, ypoint, xpoint, ypoint);
440 draw_line(xpoint, ypoint, xpoint, ypoint - _marker_offset);
441 draw_line(xpoint, ypoint - _marker_offset, xpoint + 5.0, ypoint - 5.0);
442 draw_line(xpoint, ypoint - _marker_offset, xpoint - 5.0, ypoint - 5.0);
445 draw_fixed_pointer(marker_xs + _h / 4, top, marker_xs, marker_ys,
446 marker_xs - _h / 4, top);
449 } //end horizontal scale bottom
453 zoomed_scale((int)vmin,(int)vmax);
455 int div_ratio; // FIXME abstract that out of hor/vert
456 if (_minor_divs != 0.0f)
457 div_ratio = int(_major_divs / _minor_divs + 0.5f);
459 div_ratio = 0, _minor_divs = _major_divs; // FIXME move that into Scale/Constructor ?
461 float vstart = floorf(vmin / _major_divs) * _major_divs;
462 float min_diff = _h / 6.0; // length difference between major & minor tick
464 // FIXME consider oddtype
465 for (int i = 0; ; i++) {
466 float v = vstart + i * _minor_divs;
469 if (v < _input.min())
471 else if (v > _input.max())
474 float x = _x + (v - vmin) * factor();
481 if (div_ratio && i % div_ratio) { // minor div
483 if (_tick_length == VARIABLE) {
484 draw_line(x, _y, x, marker_ys - 4);
485 draw_line(x, marker_ye + 4, x, top);
487 draw_line(x, _y, x, marker_ys);
488 draw_line(x, marker_ye, x, top);
494 if (_tick_length == VARIABLE)
495 draw_line(x, marker_ys, x, marker_ye - min_diff);
497 draw_line(x, marker_ys, x, marker_ye);
499 } else if (_tick_length == VARIABLE) {
500 draw_line(x, marker_ys + 4, x, marker_ye);
502 draw_line(x, marker_ys, x, marker_ye);
506 } else { // major divs
508 v = fmodf(v + _modulo, _modulo);
514 draw_line(x, _y, x, marker_ye);
515 draw_line(x, marker_ye, x, _y + _h);
516 y = marker_ys, align = CENTER;
519 draw_line(x, marker_ys, x, marker_ye);
522 y = top, align = TOP|HCENTER;
524 y = _y, align = BOTTOM|HCENTER;
527 if (!option_notext()) {
528 char *s = format_value(v);
531 _hud->_text_list.align(s, align, &x, &y, &l, &r, &b, &t);
533 if (l < _x || r > right)
536 if (_label_gap == 0.0
537 || l < _center_x - _label_gap && r < _center_x - _label_gap
538 || l > _center_x + _label_gap && r > _center_x + _label_gap) {
545 } // end horizontal/vertical scale
549 char *HUD::Tape::format_value(float v)
554 if (_label_fmt == INT)
555 snprintf(_buf, BUFSIZE, _format.c_str(), int(v + 0.5f));
556 else if (_label_fmt == LONG)
557 snprintf(_buf, BUFSIZE, _format.c_str(), long(v + 0.5f));
558 else if (_label_fmt == FLOAT)
559 snprintf(_buf, BUFSIZE, _format.c_str(), v);
560 else // _label_fmt == DOUBLE
561 snprintf(_buf, BUFSIZE, _format.c_str(), double(v));
566 void HUD::Tape::draw_fixed_pointer(float x1, float y1, float x2, float y2, float x3, float y3)
568 glBegin(GL_LINE_STRIP);
576 void HUD::Tape::zoomed_scale(int first, int last)
578 const int BUFSIZE = 80;
582 float x, y, w, h, bottom;
583 float cur_value = _input.getFloatValue();
586 while (first <= last) {
587 if ((first % (int)_major_divs) == 0) {
602 float xstart, yfirst, ycentre, ysecond;
604 float hgt = bottom * 20.0 / 100.0; // 60% of height should be zoomed
605 yfirst = _center_y - hgt;
607 ysecond = _center_y + hgt;
608 float range = hgt * 2;
611 float factor = range / 10.0;
613 float hgt1 = bottom * 30.0 / 100.0;
614 int incrs = int((_val_span - _major_divs * 2.0) / _major_divs);
615 int incr = incrs / 2;
616 float factors = hgt1 / incr;
618 // moving type pointer
619 float ypoint, xpoint;
620 float ycent = _center_y;
621 float right = _x + _w;
623 if (cur_value <= data[centre + 1])
624 if (cur_value > data[centre]) {
625 ypoint = ycent + ((cur_value - data[centre]) * hgt / _major_divs);
628 if (cur_value >= data[centre - 1])
629 if (cur_value <= data[centre]) {
630 ypoint = ycent - ((data[centre] - cur_value) * hgt / _major_divs);
633 if (cur_value < data[centre - 1])
634 if (cur_value >= _input.min()) {
635 float diff = _input.min() - data[centre - 1];
636 float diff1 = cur_value - data[centre - 1];
637 float val = (diff1 * hgt1) / diff;
639 ypoint = ycent - hgt - val;
642 if (cur_value > data[centre + 1])
643 if (cur_value <= _input.max()) {
644 float diff = _input.max() - data[centre + 1];
645 float diff1 = cur_value - data[centre + 1];
646 float val = (diff1 * hgt1) / diff;
648 ypoint = ycent + hgt + val;
654 draw_line(xstart, ycentre, xstart - 5.0, ycentre); //centre tick
656 snprintf(buf, BUFSIZE, "%3.0f\n", float(data[centre] * _input.factor())); // was data_scaling() ... makes not sense at all
658 if (!option_notext())
659 draw_text(x, ycentre, buf, 0);
661 for (i = 1; i < 5; i++) {
664 draw_bullet(xstart - 2.5, yfirst, 3.0);
665 draw_bullet(xstart - 2.5, ycentre, 3.0);
668 yfirst = _center_y - hgt;
670 for (i = 0; i <= incr; i++) {
671 draw_line(xstart, yfirst, xstart - 5.0, yfirst);
672 draw_line(xstart, ysecond, xstart - 5.0, ysecond);
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, yfirst, buf, 0);
679 snprintf(buf, BUFSIZE, "%3.0f\n", float(data[centre + i + 1] * _input.factor())); // was data_scaling() ... makes no sense at all
681 if (!option_notext())
682 draw_text(x, ysecond, buf, 0);
689 //to draw moving type pointer for left option
691 xpoint = right + 10.0;
693 if (_pointer_type == MOVING) {
694 draw_line(xpoint, ycent, xpoint, ypoint);
695 draw_line(xpoint, ypoint, xpoint - 10.0, ypoint);
696 draw_line(xpoint - 10.0, ypoint, xpoint - 5.0, ypoint + 5.0);
697 draw_line(xpoint - 10.0, ypoint, xpoint - 5.0, ypoint - 5.0);
703 xstart = (x + w) / 2;
705 draw_line(xstart, ycentre, xstart + 5.0, ycentre); //centre tick
707 snprintf(buf, BUFSIZE, "%3.0f\n", float(data[centre] * _input.factor())); // was data_scaling() ... makes no sense at all
709 if (!option_notext())
710 draw_text(w, ycentre, buf, 0);
712 for (i = 1; i < 5; i++) {
715 draw_bullet(xstart + 2.5, yfirst, 3.0);
716 draw_bullet(xstart + 2.5, ycentre, 3.0);
719 yfirst = _center_y - hgt;
721 for (i = 0; i <= incr; i++) {
722 draw_line(xstart, yfirst, xstart + 5.0, yfirst);
723 draw_line(xstart, ysecond, xstart + 5.0, ysecond);
725 snprintf(buf, BUFSIZE, "%3.0f\n", float(data[centre - i - 1] * _input.factor())); // was data_scaling() ... makes no sense at all
727 if (!option_notext())
728 draw_text(w, yfirst, buf, 0);
730 snprintf(buf, BUFSIZE, "%3.0f\n", float(data[centre + i + 1] * _input.factor()));
732 if (!option_notext())
733 draw_text(w, ysecond, buf, 0);
740 // to draw moving type pointer for right option
744 if (_pointer_type == MOVING) {
745 draw_line(xpoint, ycent, xpoint, ypoint);
746 draw_line(xpoint, ypoint, xpoint + 10.0, ypoint);
747 draw_line(xpoint + 10.0, ypoint, xpoint + 5.0, ypoint + 5.0);
748 draw_line(xpoint + 10.0, ypoint, xpoint + 5.0, ypoint - 5.0);
751 }//end option_right /left
752 //end of vertical scale
762 float ystart, xfirst, xcentre, xsecond;
764 float hgt = bottom * 20.0 / 100.0; // 60% of height should be zoomed
765 xfirst = _center_x - hgt;
767 xsecond = _center_x + hgt;
768 float range = hgt * 2;
771 float factor = range / 10.0;
773 float hgt1 = bottom * 30.0 / 100.0;
774 int incrs = int((_val_span - _major_divs * 2.0) / _major_divs);
775 int incr = incrs / 2;
776 float factors = hgt1 / incr;
779 // Code for Moving Type Pointer
780 float xpoint, ypoint;
781 float xcent = _center_x;
783 if (cur_value <= data[centre + 1]) {
784 if (cur_value > data[centre]) {
785 xpoint = xcent + ((cur_value - data[centre]) * hgt / _major_divs);
789 if (cur_value >= data[centre - 1]) {
790 if (cur_value <= data[centre]) {
791 xpoint = xcent - ((data[centre] - cur_value) * hgt / _major_divs);
795 if (cur_value < data[centre - 1]) {
796 if (cur_value >= _input.min()) {
797 float diff = _input.min() - data[centre - 1];
798 float diff1 = cur_value - data[centre - 1];
799 float val = (diff1 * hgt1) / diff;
801 xpoint = xcent - hgt - val;
805 if (cur_value > data[centre + 1]) {
806 if (cur_value <= _input.max()) {
807 float diff = _input.max() - data[centre + 1];
808 float diff1 = cur_value - data[centre + 1];
809 float val = (diff1 * hgt1) / diff;
811 xpoint = xcent + hgt + val;
814 // end moving pointer
818 draw_line(xcentre, ystart, xcentre, ystart - 5.0); //centre tick
820 snprintf(buf, BUFSIZE, "%3.0f\n", float(data[centre] * _input.factor())); // was data_scaling() ... makes no sense at all
822 if (!option_notext())
823 draw_text(xcentre - 10.0, y, buf, 0);
825 for (i = 1; i < 5; i++) {
828 draw_bullet(xfirst, ystart - 2.5, 3.0);
829 draw_bullet(xcentre, ystart - 2.5, 3.0);
832 xfirst = _center_x - hgt;
834 for (i = 0; i <= incr; i++) {
835 draw_line(xfirst, ystart, xfirst, ystart - 5.0);
836 draw_line(xsecond, ystart, xsecond, ystart - 5.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(xfirst - 10.0, y, buf, 0);
843 snprintf(buf, BUFSIZE, "%3.0f\n", float(data[centre + i + 1] * _input.factor())); // was data_scaling() ... makes no sense at all
845 if (!option_notext())
846 draw_text(xsecond - 10.0, y, buf, 0);
853 // moving pointer for top option
854 ypoint = _y + _h + 10.0;
856 if (_pointer_type == MOVING) {
857 draw_line(xcent, ypoint, xpoint, ypoint);
858 draw_line(xpoint, ypoint, xpoint, ypoint - 10.0);
859 draw_line(xpoint, ypoint - 10.0, xpoint + 5.0, ypoint - 5.0);
860 draw_line(xpoint, ypoint - 10.0, xpoint - 5.0, ypoint - 5.0);
866 ystart = (y + h) / 2;
868 //draw_line(xstart, yfirst, xstart - 5.0, yfirst);
869 draw_line(xcentre, ystart, xcentre, ystart + 5.0); //centre tick
871 snprintf(buf, BUFSIZE, "%3.0f\n", float(data[centre] * _input.factor())); // was data_scaling() ... makes no sense at all
873 if (!option_notext())
874 draw_text(xcentre - 10.0, h, buf, 0);
876 for (i = 1; i < 5; i++) {
879 draw_bullet(xfirst, ystart + 2.5, 3.0);
880 draw_bullet(xcentre, ystart + 2.5, 3.0);
883 xfirst = _center_x - hgt;
885 for (i = 0; i <= incr; i++) {
886 draw_line(xfirst, ystart, xfirst, ystart + 5.0);
887 draw_line(xsecond, ystart, xsecond, ystart + 5.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(xfirst - 10.0, h, buf, 0);
894 snprintf(buf, BUFSIZE, "%3.0f\n", float(data[centre + i + 1] * _input.factor())); // was data_scaling() ... makes no sense at all
896 if (!option_notext())
897 draw_text(xsecond - 10.0, h, buf, 0);
903 // movimg pointer for bottom option
905 if (_pointer_type == MOVING) {
906 draw_line(xcent, ypoint, xpoint, ypoint);
907 draw_line(xpoint, ypoint, xpoint, ypoint + 10.0);
908 draw_line(xpoint, ypoint + 10.0, xpoint + 5.0, ypoint + 5.0);
909 draw_line(xpoint, ypoint + 10.0, xpoint - 5.0, ypoint + 5.0);
911 }//end hud_top or hud_bottom
912 } //end of horizontal/vertical scales