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 _pointer(n->getBoolValue("enable-pointer", true)),
37 _zoom(n->getIntValue("zoom"))
39 _half_width_units = range_to_show() / 2.0;
42 s = n->getStringValue("pointer-type");
43 _pointer_type = strcmp(s, "moving") ? FIXED : MOVING; // "fixed", "moving"
45 s = n->getStringValue("tick-type");
46 _tick_type = strcmp(s, "circle") ? LINE : CIRCLE; // "circle", "line"
48 s = n->getStringValue("tick-length"); // "variable", "constant"
49 _tick_length = strcmp(s, "constant") ? VARIABLE : CONSTANT;
52 _hud->_font->getBBox("0", _hud->_font_size, 0.0, 0, 0, 0, &top);
53 _0_ht = top / 2.0; // half 0 height
57 void HUD::Tape::draw(void) // (HUD_scale * pscale)
59 if (!_input.isValid())
62 float vmin = 0.0, vmax = 0.0;
67 float text_x = 0.0, text_y = 0.0;
68 const int BUFSIZE = 80;
71 // int k; //odd or even values for ticks // FIXME odd scale
73 float cur_value = _input.getFloatValue();
75 if (int(floor(_input.max() + 0.5)) & 1)
76 oddtype = 1; //draw ticks at odd values
78 oddtype = 0; //draw ticks at even values
81 float right = _x + _w;
85 if (_pointer_type == MOVING) {
90 vmin = cur_value - _half_width_units; // width units == needle travel
91 vmax = cur_value + _half_width_units; // or picture unit span.
97 vmin = cur_value - _half_width_units; // width units == needle travel
98 vmax = cur_value + _half_width_units; // or picture unit span.
104 ///////////////////////////////////////////////////////////////////////////////
106 ///////////////////////////////////////////////////////////////////////////////
108 // Draw the basic markings for the scale...
110 if (option_vert()) { // Vertical scale
112 if (_draw_tick_bottom)
113 draw_line(_x, _y, right, _y);
117 draw_line(_x, top, right, top);
119 marker_xs = _x; // x start
120 marker_xe = right; // x extent
123 // glBegin(GL_LINES);
126 // glVertex2f(marker_xs, _y);
127 // glVertex2f(marker_xe, _y);
130 // glVertex2f(marker_xs, marker_ye);
131 // glVertex2f(marker_xe, marker_ye);
135 // We do not use else in the following so that combining the
136 // two options produces a "caged" display with double
137 // carrots. The same is done for horizontal card indicators.
139 // begin vertical/left
140 //First draw capping lines and pointers
141 if (option_left()) { // Calculate x marker offset
144 draw_line(marker_xe, _y, marker_xe, marker_ye);
146 marker_xs = marker_xe - _w / 3.0;
148 // draw_line(marker_xs, _center_y, marker_xe, _center_y + _w / 6);
149 // draw_line(marker_xs, _center_y, marker_xe, _center_y - _w / 6);
153 if (_pointer_type == MOVING) {
155 //Code for Moving Type Pointer
156 float ycentre, ypoint, xpoint;
159 if (_input.min() >= 0.0)
161 else if (_input.max() + _input.min() == 0.0)
164 ycentre = _y + (1.0 - _input.min()) * _h
165 / (_input.max() - _input.min());
167 ycentre = _y + _input.min() * _h
168 / (_input.max() - _input.min());
174 ypoint = ycentre + ((cur_value - 1.0) * range / _val_span);
176 ypoint = ycentre + (cur_value * range / _val_span);
178 xpoint = wth + _marker_offset;
179 draw_line(xpoint, ycentre, xpoint, ypoint);
180 draw_line(xpoint, ypoint, xpoint - _marker_offset, ypoint);
181 draw_line(xpoint - _marker_offset, ypoint, xpoint - 5.0, ypoint + 5.0);
182 draw_line(xpoint - _marker_offset, ypoint, xpoint - 5.0, ypoint - 5.0);
187 fixed(_marker_offset + marker_xe, text_y + _w / 6,
188 _marker_offset + marker_xs, text_y, _marker_offset + marker_xe,
190 } // end pointer type
192 } // end vertical/left
195 // begin vertical/right
196 // First draw capping lines and pointers
197 if (option_right()) {
200 draw_line(_x, _y, _x, marker_ye);
202 marker_xe = _x + _w / 3.0;
204 // draw_line(_x, _center_y + _w / 6, marker_xe, _center_y);
205 // draw_line(_x, _center_y - _w / 6, marker_xe, _center_y);
209 if (_pointer_type == MOVING) {
211 // type-fixed & _zoom=1, behaviour to be defined
212 // Code for Moving Type Pointer
213 float ycentre, ypoint, xpoint;
216 if (_input.min() >= 0.0)
218 else if (_input.max() + _input.min() == 0.0)
221 ycentre = _y + (1.0 - _input.min()) * _h / (_input.max() - _input.min());
223 ycentre = _y + _input.min() * _h / (_input.max() - _input.min());
228 ypoint = ycentre + ((cur_value - 1.0) * range / _val_span);
230 ypoint = ycentre + (cur_value * range / _val_span);
232 xpoint = _x - _marker_offset;
233 draw_line(xpoint, ycentre, xpoint, ypoint);
234 draw_line(xpoint, ypoint, xpoint + _marker_offset, ypoint);
235 draw_line(xpoint + _marker_offset, ypoint, xpoint + 5.0, ypoint + 5.0);
236 draw_line(xpoint + _marker_offset, ypoint, xpoint + 5.0, ypoint - 5.0);
241 fixed(-_marker_offset + _x, text_y + _w / 6,
242 -_marker_offset + marker_xe, text_y, -_marker_offset + _x,
246 } // end vertical/right
249 // At this point marker x_start and x_end values are transposed.
250 // To keep this from confusing things they are now swapped.
252 marker_ye = marker_xs, marker_xs = marker_xe, marker_xe = marker_ye;
256 // Work through from bottom to top of scale. Calculating where to put
257 // minor and major ticks.
259 // draw scale or tape
261 zoomed_scale((int)vmin, (int)vmax);
265 if (_minor_divs != 0.0f)
266 div_ratio = int(_major_divs / _minor_divs + 0.5f);
268 div_ratio = 0, _minor_divs = _major_divs; // FIXME move that into Scale/Constructor ?
270 float vstart = floorf(vmin / _major_divs) * _major_divs;
271 float min_diff = _w / 6.0; // length difference between major & minor tick
273 // FIXME consider oddtype
274 for (int i = 0; ; i++) {
275 float v = vstart + i * _minor_divs;
278 if (v < _input.min())
280 else if (v > _input.max())
283 float y = _y + (v - vmin) * factor();
290 if (div_ratio && i % div_ratio) { // minor div
292 if (_tick_type == LINE) {
293 if (_tick_length == VARIABLE) {
294 draw_line(_x, y, marker_xs, y);
295 draw_line(marker_xe, y, right, y);
297 draw_line(_x, y, marker_xs, y);
298 draw_line(marker_xe, y, right, y);
301 } else { // _tick_type == CIRCLE
302 draw_bullet(_x, y, 3.0);
305 // glBegin(GL_LINES);
306 // glVertex2f(_x, y);
307 // glVertex2f(marker_xs, y);
308 // glVertex2f(marker_xe, y);
309 // glVertex2f(_x + _w, y);
311 // anything other than huds_both
313 } else if (option_left()) {
314 if (_tick_type == LINE) {
315 if (_tick_length == VARIABLE) {
316 draw_line(marker_xs + min_diff, y, marker_xe, y);
318 draw_line(marker_xs, y, marker_xe, y);
320 } else { // _tick_type == CIRCLE
321 draw_bullet(marker_xs + 4, y, 3.0);
324 } else { // if (option_right())
325 if (_tick_type == LINE) {
326 if (_tick_length == VARIABLE) {
327 draw_line(marker_xs, y, marker_xe - min_diff, y);
329 draw_line(marker_xs, y, marker_xe, y);
332 } else { // _tick_type == CIRCLE
333 draw_bullet(marker_xe - 4, y, 3.0);
337 } else { // major div
338 int display_value = int(v);
340 display_value %= _modulo;
342 snprintf(buf, BUFSIZE, "%d", display_value);
343 float strwd = text_width(buf);
346 // draw_line(_x, y, marker_xs, y);
347 // draw_line(marker_xs, y, _x + _w, y);
348 if (_tick_type == LINE) {
349 glBegin(GL_LINE_STRIP);
351 glVertex2f(marker_xs, y);
352 glVertex2f(right, y);
355 } else { // _tick_type == CIRCLE
356 draw_bullet(_x, y, 5.0);
359 if (!option_notext())
360 draw_text(marker_xs + 2, y - _0_ht, buf, 0);
363 if (_tick_type == LINE)
364 draw_line(marker_xs, y, marker_xe, y);
365 else // _tick_type == CIRCLE
366 draw_bullet(marker_xs + 4, y, 5.0);
368 if (!option_notext()) {
370 draw_text(marker_xs - strwd, y - _0_ht, buf, 0);
372 draw_text(marker_xe + strwd / 2, y - _0_ht, buf, 0);
374 } // End if huds-both
380 ///////////////////////////////////////////////////////////////////////////////
382 ///////////////////////////////////////////////////////////////////////////////
388 draw_line(_x, _y, _x, top);
391 if (_draw_tick_right)
392 draw_line(right, _y, right, top);
394 marker_ys = _y; // Starting point for
395 marker_ye = top; // tick y location calcs
397 marker_xs = _x + ((cur_value - vmin) * factor());
399 // glBegin(GL_LINES);
401 // glVertex2f(_x, _y);
402 // glVertex2f(_x, marker_ye);
405 // glVertex2f(marker_xe, _y);
406 // glVertex2f(marker_xe, marker_ye);
410 if (_draw_cap_bottom)
411 draw_line(_x, _y, right, _y);
414 marker_ye = _y + _h / 2;
416 // draw_line(_center_x, marker_ye, _center_x - _h / 4, _y);
417 // draw_line(_center_x, marker_ye, _center_x + _h / 4, _y);
420 if (_pointer_type == MOVING) {
422 //Code for Moving Type Pointer
424 float xcentre = _center_x;
426 float xpoint = xcentre + (cur_value * range / _val_span);
427 float ypoint = _y - _marker_offset;
428 draw_line(xcentre, ypoint, xpoint, ypoint);
429 draw_line(xpoint, ypoint, xpoint, ypoint + _marker_offset);
430 draw_line(xpoint, ypoint + _marker_offset, xpoint + 5.0, ypoint + 5.0);
431 draw_line(xpoint, ypoint + _marker_offset, xpoint - 5.0, ypoint + 5.0);
436 fixed(marker_xs - _h / 4, _y, marker_xs,
437 marker_ye, marker_xs + _h / 4, _y);
440 } // End Horizontal scale/top
442 if (option_bottom()) {
444 draw_line(_x, top, right, top);
447 marker_ys = top - _h / 2;
449 // draw_line(_center_x + _h / 4, _y + _h, _center_x, marker_ys);
450 // draw_line(_center_x - _h / 4, _y + _h, _center_x , marker_ys);
454 if (_pointer_type == MOVING) {
456 //Code for Moving Type Pointer
458 float xcentre = _center_x;
461 float xpoint = xcentre + (cur_value * range / _val_span);
462 float ypoint = hgt + _marker_offset;
463 draw_line(xcentre, ypoint, xpoint, ypoint);
464 draw_line(xpoint, ypoint, xpoint, ypoint - _marker_offset);
465 draw_line(xpoint, ypoint - _marker_offset, xpoint + 5.0, ypoint - 5.0);
466 draw_line(xpoint, ypoint - _marker_offset, xpoint - 5.0, ypoint - 5.0);
469 fixed(marker_xs + _h / 4, top, marker_xs, marker_ys,
470 marker_xs - _h / 4, top);
473 } //end horizontal scale bottom
477 zoomed_scale((int)vmin,(int)vmax);
479 int div_ratio; // FIXME abstract that out of hor/vert
480 if (_minor_divs != 0.0f)
481 div_ratio = int(_major_divs / _minor_divs + 0.5f);
483 div_ratio = 0, _minor_divs = _major_divs; // FIXME move that into Scale/Constructor ?
485 float vstart = floorf(vmin / _major_divs) * _major_divs;
486 float min_diff = _h / 6.0; // length difference between major & minor tick
488 // FIXME consider oddtype
489 for (int i = 0; ; i++) {
490 float v = vstart + i * _minor_divs;
493 if (v < _input.min())
495 else if (v > _input.max())
498 float x = _x + (v - vmin) * factor();
505 if (div_ratio && i % div_ratio) { // minor div
507 if (_tick_length == VARIABLE) {
508 draw_line(x, _y, x, marker_ys - 4);
509 draw_line(x, marker_ye + 4, x, top);
511 draw_line(x, _y, x, marker_ys);
512 draw_line(x, marker_ye, x, top);
514 // glBegin(GL_LINES);
515 // glVertex2f(x, _y);
516 // glVertex2f(x, marker_ys - 4);
517 // glVertex2f(x, marker_ye + 4);
518 // glVertex2f(x, _y + _h);
524 if (_tick_length == VARIABLE)
525 draw_line(x, marker_ys, x, marker_ye - min_diff);
527 draw_line(x, marker_ys, x, marker_ye);
529 } else if (_tick_length == VARIABLE) {
530 draw_line(x, marker_ys + 4, x, marker_ye);
532 draw_line(x, marker_ys, x, marker_ye);
536 } else { // major divs
537 int display_value = int(v);
539 display_value %= _modulo;
541 snprintf(buf, BUFSIZE, "%d", display_value);
542 float strwd = text_width(buf);
544 // Draw major ticks and text only if far enough from the edge. // FIXME
545 if (x < _x + 10 || x + 10 > _x + _w)
551 // draw_line(x, marker_ye,
553 glBegin(GL_LINE_STRIP);
555 glVertex2f(x, marker_ye);
559 if (!option_notext())
560 draw_text(x - strwd / 2.0, marker_ys + 4, buf, 0);
563 draw_line(x, marker_ys, x, marker_ye);
565 if (!option_notext()) {
567 draw_text(x - strwd / 2.0, top - 10, buf, 0);
569 draw_text(x - strwd / 2.0, _y, buf, 0);
575 } // end horizontal/vertical scale
580 void HUD::Tape::fixed(float x1, float y1, float x2, float y2, float x3, float y3)
582 glBegin(GL_LINE_STRIP);
590 void HUD::Tape::zoomed_scale(int first, int last)
592 const int BUFSIZE = 80;
596 float x, y, w, h, bottom;
597 float cur_value = _input.getFloatValue();
600 while (first <= last) {
601 if ((first % (int)_major_divs) == 0) {
616 float xstart, yfirst, ycentre, ysecond;
618 float hgt = bottom * 20.0 / 100.0; // 60% of height should be zoomed
619 yfirst = _center_y - hgt;
621 ysecond = _center_y + hgt;
622 float range = hgt * 2;
625 float factor = range / 10.0;
627 float hgt1 = bottom * 30.0 / 100.0;
628 int incrs = int((_val_span - _major_divs * 2.0) / _major_divs);
629 int incr = incrs / 2;
630 float factors = hgt1 / incr;
633 //this is for moving type pointer
634 static float ycent, ypoint, xpoint; // FIXME really static?
640 if (cur_value <= data[centre + 1])
641 if (cur_value > data[centre]) {
642 ypoint = ycent + ((cur_value - data[centre]) * hgt / _major_divs);
645 if (cur_value >= data[centre - 1])
646 if (cur_value <= data[centre]) {
647 ypoint = ycent - ((data[centre] - cur_value) * hgt / _major_divs);
650 if (cur_value < data[centre - 1])
651 if (cur_value >= _input.min()) {
652 float diff = _input.min() - data[centre - 1];
653 float diff1 = cur_value - data[centre - 1];
654 float val = (diff1 * hgt1) / diff;
656 ypoint = ycent - hgt - val;
659 if (cur_value > data[centre + 1])
660 if (cur_value <= _input.max()) {
661 float diff = _input.max() - data[centre + 1];
662 float diff1 = cur_value - data[centre + 1];
663 float val = (diff1 * hgt1) / diff;
665 ypoint = ycent + hgt + val;
671 draw_line(xstart, ycentre, xstart - 5.0, ycentre); //centre tick
673 snprintf(buf, BUFSIZE, "%3.0f\n", float(data[centre] * _input.factor())); // was data_scaling() ... makes not sense at all
675 if (!option_notext())
676 draw_text(x, ycentre, buf, 0);
678 for (i = 1; i < 5; i++) {
681 draw_bullet(xstart - 2.5, yfirst, 3.0);
682 draw_bullet(xstart - 2.5, ycentre, 3.0);
685 yfirst = _center_y - hgt;
687 for (i = 0; i <= incr; i++) {
688 draw_line(xstart, yfirst, xstart - 5.0, yfirst);
689 draw_line(xstart, ysecond, xstart - 5.0, ysecond);
691 snprintf(buf, BUFSIZE, "%3.0f\n", float(data[centre - i - 1] * _input.factor())); // was data_scaling() ... makes no sense at all
693 if (!option_notext())
694 draw_text(x, yfirst, buf, 0);
696 snprintf(buf, BUFSIZE, "%3.0f\n", float(data[centre + i + 1] * _input.factor())); // was data_scaling() ... makes no sense at all
698 if (!option_notext())
699 draw_text(x, ysecond, buf, 0);
706 //to draw moving type pointer for left option
710 if (_pointer_type == MOVING) {
711 draw_line(xpoint, ycent, xpoint, ypoint);
712 draw_line(xpoint, ypoint, xpoint - 10.0, ypoint);
713 draw_line(xpoint - 10.0, ypoint, xpoint - 5.0, ypoint + 5.0);
714 draw_line(xpoint - 10.0, ypoint, xpoint - 5.0, ypoint - 5.0);
720 xstart = (x + w) / 2;
722 draw_line(xstart, ycentre, xstart + 5.0, ycentre); //centre tick
724 snprintf(buf, BUFSIZE, "%3.0f\n", float(data[centre] * _input.factor())); // was data_scaling() ... makes no sense at all
726 if (!option_notext())
727 draw_text(w, ycentre, buf, 0);
729 for (i = 1; i < 5; i++) {
732 draw_bullet(xstart + 2.5, yfirst, 3.0);
733 draw_bullet(xstart + 2.5, ycentre, 3.0);
736 yfirst = _center_y - hgt;
738 for (i = 0; i <= incr; i++) {
739 draw_line(xstart, yfirst, xstart + 5.0, yfirst);
740 draw_line(xstart, ysecond, xstart + 5.0, ysecond);
742 snprintf(buf, BUFSIZE, "%3.0f\n", float(data[centre - i - 1] * _input.factor())); // was data_scaling() ... makes no sense at all
744 if (!option_notext())
745 draw_text(w, yfirst, buf, 0);
747 snprintf(buf, BUFSIZE, "%3.0f\n", float(data[centre + i + 1] * _input.factor()));
749 if (!option_notext())
750 draw_text(w, ysecond, buf, 0);
757 // to draw moving type pointer for right option
761 if (_pointer_type == MOVING) {
762 draw_line(xpoint, ycent, xpoint, ypoint);
763 draw_line(xpoint, ypoint, xpoint + 10.0, ypoint);
764 draw_line(xpoint + 10.0, ypoint, xpoint + 5.0, ypoint + 5.0);
765 draw_line(xpoint + 10.0, ypoint, xpoint + 5.0, ypoint - 5.0);
768 }//end option_right /left
769 //end of vertical scale
779 float ystart, xfirst, xcentre, xsecond;
781 float hgt = bottom * 20.0 / 100.0; // 60% of height should be zoomed
782 xfirst = _center_x - hgt;
784 xsecond = _center_x + hgt;
785 float range = hgt * 2;
788 float factor = range / 10.0;
790 float hgt1 = bottom * 30.0 / 100.0;
791 int incrs = int((_val_span - _major_divs * 2.0) / _major_divs);
792 int incr = incrs / 2;
793 float factors = hgt1 / incr;
796 //Code for Moving Type Pointer
798 static float xcent, xpoint, ypoint; // FIXME really static?
802 if (cur_value <= data[centre + 1])
803 if (cur_value > data[centre]) {
804 xpoint = xcent + ((cur_value - data[centre]) * hgt / _major_divs);
807 if (cur_value >= data[centre - 1])
808 if (cur_value <= data[centre]) {
809 xpoint = xcent - ((data[centre] - cur_value) * hgt / _major_divs);
812 if (cur_value < data[centre - 1])
813 if (cur_value >= _input.min()) {
814 float diff = _input.min() - data[centre - 1];
815 float diff1 = cur_value - data[centre - 1];
816 float val = (diff1 * hgt1) / diff;
818 xpoint = xcent - hgt - val;
822 if (cur_value > data[centre + 1])
823 if (cur_value <= _input.max()) {
824 float diff = _input.max() - data[centre + 1];
825 float diff1 = cur_value - data[centre + 1];
826 float val = (diff1 * hgt1) / diff;
828 xpoint = xcent + hgt + val;
834 draw_line(xcentre, ystart, xcentre, ystart - 5.0); //centre tick
836 snprintf(buf, BUFSIZE, "%3.0f\n", float(data[centre] * _input.factor())); // was data_scaling() ... makes no sense at all
838 if (!option_notext())
839 draw_text(xcentre - 10.0, y, buf, 0);
841 for (i = 1; i < 5; i++) {
844 draw_bullet(xfirst, ystart - 2.5, 3.0);
845 draw_bullet(xcentre, ystart - 2.5, 3.0);
848 xfirst = _center_x - hgt;
850 for (i = 0; i <= incr; i++) {
851 draw_line(xfirst, ystart, xfirst, ystart - 5.0);
852 draw_line(xsecond, ystart, xsecond, ystart - 5.0);
854 snprintf(buf, BUFSIZE, "%3.0f\n", float(data[centre - i - 1] * _input.factor())); // was data_scaling() ... makes no sense at all
856 if (!option_notext())
857 draw_text(xfirst - 10.0, y, buf, 0);
859 snprintf(buf, BUFSIZE, "%3.0f\n", float(data[centre + i + 1] * _input.factor())); // was data_scaling() ... makes no sense at all
861 if (!option_notext())
862 draw_text(xsecond - 10.0, y, buf, 0);
868 //this is for moving pointer for top option
871 ypoint = _y + _h + 10.0;
873 if (_pointer_type == MOVING) {
874 draw_line(xcent, ypoint, xpoint, ypoint);
875 draw_line(xpoint, ypoint, xpoint, ypoint - 10.0);
876 draw_line(xpoint, ypoint - 10.0, xpoint + 5.0, ypoint - 5.0);
877 draw_line(xpoint, ypoint - 10.0, xpoint - 5.0, ypoint - 5.0);
883 ystart = (y + h) / 2;
885 //draw_line(xstart, yfirst, xstart - 5.0, yfirst);
886 draw_line(xcentre, ystart, xcentre, ystart + 5.0); //centre tick
888 snprintf(buf, BUFSIZE, "%3.0f\n", float(data[centre] * _input.factor())); // was data_scaling() ... makes no sense at all
890 if (!option_notext())
891 draw_text(xcentre - 10.0, h, buf, 0);
893 for (i = 1; i < 5; i++) {
896 draw_bullet(xfirst, ystart + 2.5, 3.0);
897 draw_bullet(xcentre, ystart + 2.5, 3.0);
900 xfirst = _center_x - hgt;
902 for (i = 0; i <= incr; i++) {
903 draw_line(xfirst, ystart, xfirst, ystart + 5.0);
904 draw_line(xsecond, ystart, xsecond, ystart + 5.0);
906 snprintf(buf, BUFSIZE, "%3.0f\n", float(data[centre - i - 1] * _input.factor())); // was data_scaling() ... makes no sense at all
908 if (!option_notext())
909 draw_text(xfirst - 10.0, h, buf, 0);
911 snprintf(buf, BUFSIZE, "%3.0f\n", float(data[centre + i + 1] * _input.factor())); // was data_scaling() ... makes no sense at all
913 if (!option_notext())
914 draw_text(xsecond - 10.0, h, buf, 0);
919 //this is for movimg pointer for bottom option
923 if (_pointer_type == MOVING) {
924 draw_line(xcent, ypoint, xpoint, ypoint);
925 draw_line(xpoint, ypoint, xpoint, ypoint + 10.0);
926 draw_line(xpoint, ypoint + 10.0, xpoint + 5.0, ypoint + 5.0);
927 draw_line(xpoint, ypoint + 10.0, xpoint - 5.0, ypoint + 5.0);
929 }//end hud_top or hud_bottom
930 } //end of horizontal/vertical scales