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;
277 if (!_modulo && (v < _input.min() || v > _input.max()))
280 float y = _y + (v - vmin) * factor();
287 if (div_ratio && i % div_ratio) { // minor div
289 if (_tick_type == LINE) {
290 if (_tick_length == VARIABLE) {
291 draw_line(_x, y, marker_xs, y);
292 draw_line(marker_xe, y, right, y);
294 draw_line(_x, y, marker_xs, y);
295 draw_line(marker_xe, y, right, y);
298 } else { // _tick_type == CIRCLE
299 draw_bullet(_x, y, 3.0);
302 // glBegin(GL_LINES);
303 // glVertex2f(_x, y);
304 // glVertex2f(marker_xs, y);
305 // glVertex2f(marker_xe, y);
306 // glVertex2f(_x + _w, y);
308 // anything other than huds_both
310 } else if (option_left()) {
311 if (_tick_type == LINE) {
312 if (_tick_length == VARIABLE) {
313 draw_line(marker_xs + min_diff, y, marker_xe, y);
315 draw_line(marker_xs, y, marker_xe, y);
317 } else { // _tick_type == CIRCLE
318 draw_bullet(marker_xs + 4, y, 3.0);
321 } else { // if (option_right())
322 if (_tick_type == LINE) {
323 if (_tick_length == VARIABLE) {
324 draw_line(marker_xs, y, marker_xe - min_diff, y);
326 draw_line(marker_xs, y, marker_xe, y);
329 } else { // _tick_type == CIRCLE
330 draw_bullet(marker_xe - 4, y, 3.0);
334 } else { // major div
335 int display_value = int(v);
337 display_value %= _modulo;
339 snprintf(buf, BUFSIZE, "%d", display_value);
340 float strwd = text_width(buf);
343 // draw_line(_x, y, marker_xs, y);
344 // draw_line(marker_xs, y, _x + _w, y);
345 if (_tick_type == LINE) {
346 glBegin(GL_LINE_STRIP);
348 glVertex2f(marker_xs, y);
349 glVertex2f(right, y);
352 } else { // _tick_type == CIRCLE
353 draw_bullet(_x, y, 5.0);
356 if (!option_notext())
357 draw_text(marker_xs + 2, y - _0_ht, buf, 0);
360 if (_tick_type == LINE)
361 draw_line(marker_xs, y, marker_xe, y);
362 else // _tick_type == CIRCLE
363 draw_bullet(marker_xs + 4, y, 5.0);
365 if (!option_notext()) {
367 draw_text(marker_xs - strwd, y - _0_ht, buf, 0);
369 draw_text(marker_xe + strwd / 2, y - _0_ht, buf, 0);
371 } // End if huds-both
377 ///////////////////////////////////////////////////////////////////////////////
379 ///////////////////////////////////////////////////////////////////////////////
385 draw_line(_x, _y, _x, top);
388 if (_draw_tick_right)
389 draw_line(right, _y, right, top);
391 marker_ys = _y; // Starting point for
392 marker_ye = top; // tick y location calcs
394 marker_xs = _x + ((cur_value - vmin) * factor());
396 // glBegin(GL_LINES);
398 // glVertex2f(_x, _y);
399 // glVertex2f(_x, marker_ye);
402 // glVertex2f(marker_xe, _y);
403 // glVertex2f(marker_xe, marker_ye);
407 if (_draw_cap_bottom)
408 draw_line(_x, _y, right, _y);
411 marker_ye = _y + _h / 2;
413 // draw_line(_center_x, marker_ye, _center_x - _h / 4, _y);
414 // draw_line(_center_x, marker_ye, _center_x + _h / 4, _y);
417 if (_pointer_type == MOVING) {
419 //Code for Moving Type Pointer
421 float xcentre = _center_x;
423 float xpoint = xcentre + (cur_value * range / _val_span);
424 float ypoint = _y - _marker_offset;
425 draw_line(xcentre, ypoint, xpoint, ypoint);
426 draw_line(xpoint, ypoint, xpoint, ypoint + _marker_offset);
427 draw_line(xpoint, ypoint + _marker_offset, xpoint + 5.0, ypoint + 5.0);
428 draw_line(xpoint, ypoint + _marker_offset, xpoint - 5.0, ypoint + 5.0);
433 fixed(marker_xs - _h / 4, _y, marker_xs,
434 marker_ye, marker_xs + _h / 4, _y);
437 } // End Horizontal scale/top
439 if (option_bottom()) {
441 draw_line(_x, top, right, top);
444 marker_ys = top - _h / 2;
446 // draw_line(_center_x + _h / 4, _y + _h, _center_x, marker_ys);
447 // draw_line(_center_x - _h / 4, _y + _h, _center_x , marker_ys);
451 if (_pointer_type == MOVING) {
453 //Code for Moving Type Pointer
455 float xcentre = _center_x;
458 float xpoint = xcentre + (cur_value * range / _val_span);
459 float ypoint = hgt + _marker_offset;
460 draw_line(xcentre, ypoint, xpoint, ypoint);
461 draw_line(xpoint, ypoint, xpoint, ypoint - _marker_offset);
462 draw_line(xpoint, ypoint - _marker_offset, xpoint + 5.0, ypoint - 5.0);
463 draw_line(xpoint, ypoint - _marker_offset, xpoint - 5.0, ypoint - 5.0);
466 fixed(marker_xs + _h / 4, top, marker_xs, marker_ys,
467 marker_xs - _h / 4, top);
470 } //end horizontal scale bottom
474 zoomed_scale((int)vmin,(int)vmax);
476 int div_ratio; // FIXME abstract that out of hor/vert
477 if (_minor_divs != 0.0f)
478 div_ratio = int(_major_divs / _minor_divs + 0.5f);
480 div_ratio = 0, _minor_divs = _major_divs; // FIXME move that into Scale/Constructor ?
482 float vstart = floorf(vmin / _major_divs) * _major_divs;
483 float min_diff = _h / 6.0; // length difference between major & minor tick
485 // FIXME consider oddtype
486 for (int i = 0; ; i++) {
487 float v = vstart + i * _minor_divs;
489 if (!_modulo && (v < _input.min() || v > _input.max()))
492 float x = _x + (v - vmin) * factor();
499 if (div_ratio && i % div_ratio) { // minor div
501 if (_tick_length == VARIABLE) {
502 draw_line(x, _y, x, marker_ys - 4);
503 draw_line(x, marker_ye + 4, x, top);
505 draw_line(x, _y, x, marker_ys);
506 draw_line(x, marker_ye, x, top);
508 // glBegin(GL_LINES);
509 // glVertex2f(x, _y);
510 // glVertex2f(x, marker_ys - 4);
511 // glVertex2f(x, marker_ye + 4);
512 // glVertex2f(x, _y + _h);
518 if (_tick_length == VARIABLE)
519 draw_line(x, marker_ys, x, marker_ye - min_diff);
521 draw_line(x, marker_ys, x, marker_ye);
523 } else if (_tick_length == VARIABLE) {
524 draw_line(x, marker_ys + 4, x, marker_ye);
526 draw_line(x, marker_ys, x, marker_ye);
530 } else { // major divs
531 int display_value = int(v);
533 display_value %= _modulo;
535 snprintf(buf, BUFSIZE, "%d", display_value);
536 float strwd = text_width(buf);
538 // Draw major ticks and text only if far enough from the edge. // FIXME
539 if (x < _x + 10 || x + 10 > _x + _w)
545 // draw_line(x, marker_ye,
547 glBegin(GL_LINE_STRIP);
549 glVertex2f(x, marker_ye);
553 if (!option_notext())
554 draw_text(x - strwd / 2.0, marker_ys + 4, buf, 0);
557 draw_line(x, marker_ys, x, marker_ye);
559 if (!option_notext()) {
561 draw_text(x - strwd / 2.0, top - 10, buf, 0);
563 draw_text(x - strwd / 2.0, _y, buf, 0);
569 } // end horizontal/vertical scale
574 void HUD::Tape::fixed(float x1, float y1, float x2, float y2, float x3, float y3)
576 glBegin(GL_LINE_STRIP);
584 void HUD::Tape::zoomed_scale(int first, int last)
586 const int BUFSIZE = 80;
590 float x, y, w, h, bottom;
591 float cur_value = _input.getFloatValue();
594 while (first <= last) {
595 if ((first % (int)_major_divs) == 0) {
610 float xstart, yfirst, ycentre, ysecond;
612 float hgt = bottom * 20.0 / 100.0; // 60% of height should be zoomed
613 yfirst = _center_y - hgt;
615 ysecond = _center_y + hgt;
616 float range = hgt * 2;
619 float factor = range / 10.0;
621 float hgt1 = bottom * 30.0 / 100.0;
622 int incrs = int((_val_span - _major_divs * 2.0) / _major_divs);
623 int incr = incrs / 2;
624 float factors = hgt1 / incr;
627 //this is for moving type pointer
628 static float ycent, ypoint, xpoint; // FIXME really static?
634 if (cur_value <= data[centre + 1])
635 if (cur_value > data[centre]) {
636 ypoint = ycent + ((cur_value - data[centre]) * hgt / _major_divs);
639 if (cur_value >= data[centre - 1])
640 if (cur_value <= data[centre]) {
641 ypoint = ycent - ((data[centre] - cur_value) * hgt / _major_divs);
644 if (cur_value < data[centre - 1])
645 if (cur_value >= _input.min()) {
646 float diff = _input.min() - data[centre - 1];
647 float diff1 = cur_value - data[centre - 1];
648 float val = (diff1 * hgt1) / diff;
650 ypoint = ycent - hgt - val;
653 if (cur_value > data[centre + 1])
654 if (cur_value <= _input.max()) {
655 float diff = _input.max() - data[centre + 1];
656 float diff1 = cur_value - data[centre + 1];
657 float val = (diff1 * hgt1) / diff;
659 ypoint = ycent + hgt + val;
665 draw_line(xstart, ycentre, xstart - 5.0, ycentre); //centre tick
667 snprintf(buf, BUFSIZE, "%3.0f\n", float(data[centre] * _input.factor())); // was data_scaling() ... makes not sense at all
669 if (!option_notext())
670 draw_text(x, ycentre, buf, 0);
672 for (i = 1; i < 5; i++) {
675 draw_bullet(xstart - 2.5, yfirst, 3.0);
676 draw_bullet(xstart - 2.5, ycentre, 3.0);
679 yfirst = _center_y - hgt;
681 for (i = 0; i <= incr; i++) {
682 draw_line(xstart, yfirst, xstart - 5.0, yfirst);
683 draw_line(xstart, ysecond, xstart - 5.0, ysecond);
685 snprintf(buf, BUFSIZE, "%3.0f\n", float(data[centre - i - 1] * _input.factor())); // was data_scaling() ... makes no sense at all
687 if (!option_notext())
688 draw_text(x, yfirst, buf, 0);
690 snprintf(buf, BUFSIZE, "%3.0f\n", float(data[centre + i + 1] * _input.factor())); // was data_scaling() ... makes no sense at all
692 if (!option_notext())
693 draw_text(x, ysecond, buf, 0);
700 //to draw moving type pointer for left option
704 if (_pointer_type == MOVING) {
705 draw_line(xpoint, ycent, xpoint, ypoint);
706 draw_line(xpoint, ypoint, xpoint - 10.0, ypoint);
707 draw_line(xpoint - 10.0, ypoint, xpoint - 5.0, ypoint + 5.0);
708 draw_line(xpoint - 10.0, ypoint, xpoint - 5.0, ypoint - 5.0);
714 xstart = (x + w) / 2;
716 draw_line(xstart, ycentre, xstart + 5.0, ycentre); //centre tick
718 snprintf(buf, BUFSIZE, "%3.0f\n", float(data[centre] * _input.factor())); // was data_scaling() ... makes no sense at all
720 if (!option_notext())
721 draw_text(w, ycentre, buf, 0);
723 for (i = 1; i < 5; i++) {
726 draw_bullet(xstart + 2.5, yfirst, 3.0);
727 draw_bullet(xstart + 2.5, ycentre, 3.0);
730 yfirst = _center_y - hgt;
732 for (i = 0; i <= incr; i++) {
733 draw_line(xstart, yfirst, xstart + 5.0, yfirst);
734 draw_line(xstart, ysecond, xstart + 5.0, ysecond);
736 snprintf(buf, BUFSIZE, "%3.0f\n", float(data[centre - i - 1] * _input.factor())); // was data_scaling() ... makes no sense at all
738 if (!option_notext())
739 draw_text(w, yfirst, buf, 0);
741 snprintf(buf, BUFSIZE, "%3.0f\n", float(data[centre + i + 1] * _input.factor()));
743 if (!option_notext())
744 draw_text(w, ysecond, buf, 0);
751 // to draw moving type pointer for right option
755 if (_pointer_type == MOVING) {
756 draw_line(xpoint, ycent, xpoint, ypoint);
757 draw_line(xpoint, ypoint, xpoint + 10.0, ypoint);
758 draw_line(xpoint + 10.0, ypoint, xpoint + 5.0, ypoint + 5.0);
759 draw_line(xpoint + 10.0, ypoint, xpoint + 5.0, ypoint - 5.0);
762 }//end option_right /left
763 //end of vertical scale
773 float ystart, xfirst, xcentre, xsecond;
775 float hgt = bottom * 20.0 / 100.0; // 60% of height should be zoomed
776 xfirst = _center_x - hgt;
778 xsecond = _center_x + hgt;
779 float range = hgt * 2;
782 float factor = range / 10.0;
784 float hgt1 = bottom * 30.0 / 100.0;
785 int incrs = int((_val_span - _major_divs * 2.0) / _major_divs);
786 int incr = incrs / 2;
787 float factors = hgt1 / incr;
790 //Code for Moving Type Pointer
792 static float xcent, xpoint, ypoint; // FIXME really static?
796 if (cur_value <= data[centre + 1])
797 if (cur_value > data[centre]) {
798 xpoint = xcent + ((cur_value - data[centre]) * hgt / _major_divs);
801 if (cur_value >= data[centre - 1])
802 if (cur_value <= data[centre]) {
803 xpoint = xcent - ((data[centre] - cur_value) * hgt / _major_divs);
806 if (cur_value < data[centre - 1])
807 if (cur_value >= _input.min()) {
808 float diff = _input.min() - data[centre - 1];
809 float diff1 = cur_value - data[centre - 1];
810 float val = (diff1 * hgt1) / diff;
812 xpoint = xcent - hgt - val;
816 if (cur_value > data[centre + 1])
817 if (cur_value <= _input.max()) {
818 float diff = _input.max() - data[centre + 1];
819 float diff1 = cur_value - data[centre + 1];
820 float val = (diff1 * hgt1) / diff;
822 xpoint = xcent + hgt + val;
828 draw_line(xcentre, ystart, xcentre, ystart - 5.0); //centre tick
830 snprintf(buf, BUFSIZE, "%3.0f\n", float(data[centre] * _input.factor())); // was data_scaling() ... makes no sense at all
832 if (!option_notext())
833 draw_text(xcentre - 10.0, y, buf, 0);
835 for (i = 1; i < 5; i++) {
838 draw_bullet(xfirst, ystart - 2.5, 3.0);
839 draw_bullet(xcentre, ystart - 2.5, 3.0);
842 xfirst = _center_x - hgt;
844 for (i = 0; i <= incr; i++) {
845 draw_line(xfirst, ystart, xfirst, ystart - 5.0);
846 draw_line(xsecond, ystart, xsecond, ystart - 5.0);
848 snprintf(buf, BUFSIZE, "%3.0f\n", float(data[centre - i - 1] * _input.factor())); // was data_scaling() ... makes no sense at all
850 if (!option_notext())
851 draw_text(xfirst - 10.0, y, buf, 0);
853 snprintf(buf, BUFSIZE, "%3.0f\n", float(data[centre + i + 1] * _input.factor())); // was data_scaling() ... makes no sense at all
855 if (!option_notext())
856 draw_text(xsecond - 10.0, y, buf, 0);
862 //this is for moving pointer for top option
865 ypoint = _y + _h + 10.0;
867 if (_pointer_type == MOVING) {
868 draw_line(xcent, ypoint, xpoint, ypoint);
869 draw_line(xpoint, ypoint, xpoint, ypoint - 10.0);
870 draw_line(xpoint, ypoint - 10.0, xpoint + 5.0, ypoint - 5.0);
871 draw_line(xpoint, ypoint - 10.0, xpoint - 5.0, ypoint - 5.0);
877 ystart = (y + h) / 2;
879 //draw_line(xstart, yfirst, xstart - 5.0, yfirst);
880 draw_line(xcentre, ystart, xcentre, ystart + 5.0); //centre tick
882 snprintf(buf, BUFSIZE, "%3.0f\n", float(data[centre] * _input.factor())); // was data_scaling() ... makes no sense at all
884 if (!option_notext())
885 draw_text(xcentre - 10.0, h, buf, 0);
887 for (i = 1; i < 5; i++) {
890 draw_bullet(xfirst, ystart + 2.5, 3.0);
891 draw_bullet(xcentre, ystart + 2.5, 3.0);
894 xfirst = _center_x - hgt;
896 for (i = 0; i <= incr; i++) {
897 draw_line(xfirst, ystart, xfirst, ystart + 5.0);
898 draw_line(xsecond, ystart, xsecond, ystart + 5.0);
900 snprintf(buf, BUFSIZE, "%3.0f\n", float(data[centre - i - 1] * _input.factor())); // was data_scaling() ... makes no sense at all
902 if (!option_notext())
903 draw_text(xfirst - 10.0, h, buf, 0);
905 snprintf(buf, BUFSIZE, "%3.0f\n", float(data[centre + i + 1] * _input.factor())); // was data_scaling() ... makes no sense at all
907 if (!option_notext())
908 draw_text(xsecond - 10.0, h, buf, 0);
913 //this is for movimg pointer for bottom option
917 if (_pointer_type == MOVING) {
918 draw_line(xcent, ypoint, xpoint, ypoint);
919 draw_line(xpoint, ypoint, xpoint, ypoint + 10.0);
920 draw_line(xpoint, ypoint + 10.0, xpoint + 5.0, ypoint + 5.0);
921 draw_line(xpoint, ypoint + 10.0, xpoint - 5.0, ypoint + 5.0);
923 }//end hud_top or hud_bottom
924 } //end of horizontal/vertical scales