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;
53 void HUD::Tape::draw(void) // (HUD_scale * pscale)
55 if (!_input.isValid())
58 float vmin = 0.0, vmax = 0.0;
63 float text_x = 0.0, text_y = 0.0;
64 const int BUFSIZE = 80;
67 // int k; //odd or even values for ticks // FIXME odd scale
69 float cur_value = _input.getFloatValue();
71 if (int(floor(_input.max() + 0.5)) & 1)
72 oddtype = 1; //draw ticks at odd values
74 oddtype = 0; //draw ticks at even values
77 float right = _x + _w;
81 if (_pointer_type == MOVING) {
86 vmin = cur_value - _half_width_units; // width units == needle travel
87 vmax = cur_value + _half_width_units; // or picture unit span.
93 vmin = cur_value - _half_width_units; // width units == needle travel
94 vmax = cur_value + _half_width_units; // or picture unit span.
100 ///////////////////////////////////////////////////////////////////////////////
102 ///////////////////////////////////////////////////////////////////////////////
104 // Draw the basic markings for the scale...
106 if (option_vert()) { // Vertical scale
108 if (_draw_tick_bottom)
109 draw_line(_x, _y, right, _y);
113 draw_line(_x, top, right, top);
115 marker_xs = _x; // x start
116 marker_xe = right; // x extent
119 // glBegin(GL_LINES);
122 // glVertex2f(marker_xs, _y);
123 // glVertex2f(marker_xe, _y);
126 // glVertex2f(marker_xs, marker_ye);
127 // glVertex2f(marker_xe, marker_ye);
131 // We do not use else in the following so that combining the
132 // two options produces a "caged" display with double
133 // carrots. The same is done for horizontal card indicators.
135 // begin vertical/left
136 //First draw capping lines and pointers
137 if (option_left()) { // Calculate x marker offset
140 draw_line(marker_xe, _y, marker_xe, marker_ye);
142 marker_xs = marker_xe - _w / 3.0;
144 // draw_line(marker_xs, _center_y, marker_xe, _center_y + _w / 6);
145 // draw_line(marker_xs, _center_y, marker_xe, _center_y - _w / 6);
149 if (_pointer_type == MOVING) {
151 //Code for Moving Type Pointer
152 float ycentre, ypoint, xpoint;
155 if (_input.min() >= 0.0)
157 else if (_input.max() + _input.min() == 0.0)
160 ycentre = _y + (1.0 - _input.min()) * _h
161 / (_input.max() - _input.min());
163 ycentre = _y + _input.min() * _h
164 / (_input.max() - _input.min());
170 ypoint = ycentre + ((cur_value - 1.0) * range / _val_span);
172 ypoint = ycentre + (cur_value * range / _val_span);
174 xpoint = wth + _marker_offset;
175 draw_line(xpoint, ycentre, xpoint, ypoint);
176 draw_line(xpoint, ypoint, xpoint - _marker_offset, ypoint);
177 draw_line(xpoint - _marker_offset, ypoint, xpoint - 5.0, ypoint + 5.0);
178 draw_line(xpoint - _marker_offset, ypoint, xpoint - 5.0, ypoint - 5.0);
183 fixed(_marker_offset + marker_xe, text_y + _w / 6,
184 _marker_offset + marker_xs, text_y, _marker_offset + marker_xe,
186 } // end pointer type
188 } // end vertical/left
191 // begin vertical/right
192 // First draw capping lines and pointers
193 if (option_right()) {
196 draw_line(_x, _y, _x, marker_ye);
198 marker_xe = _x + _w / 3.0;
200 // draw_line(_x, _center_y + _w / 6, marker_xe, _center_y);
201 // draw_line(_x, _center_y - _w / 6, marker_xe, _center_y);
205 if (_pointer_type == MOVING) {
207 // type-fixed & _zoom=1, behaviour to be defined
208 // Code for Moving Type Pointer
209 float ycentre, ypoint, xpoint;
212 if (_input.min() >= 0.0)
214 else if (_input.max() + _input.min() == 0.0)
217 ycentre = _y + (1.0 - _input.min()) * _h / (_input.max() - _input.min());
219 ycentre = _y + _input.min() * _h / (_input.max() - _input.min());
224 ypoint = ycentre + ((cur_value - 1.0) * range / _val_span);
226 ypoint = ycentre + (cur_value * range / _val_span);
228 xpoint = _x - _marker_offset;
229 draw_line(xpoint, ycentre, xpoint, ypoint);
230 draw_line(xpoint, ypoint, xpoint + _marker_offset, ypoint);
231 draw_line(xpoint + _marker_offset, ypoint, xpoint + 5.0, ypoint + 5.0);
232 draw_line(xpoint + _marker_offset, ypoint, xpoint + 5.0, ypoint - 5.0);
237 fixed(-_marker_offset + _x, text_y + _w / 6,
238 -_marker_offset + marker_xe, text_y, -_marker_offset + _x,
242 } // end vertical/right
245 // At this point marker x_start and x_end values are transposed.
246 // To keep this from confusing things they are now swapped.
248 marker_ye = marker_xs, marker_xs = marker_xe, marker_xe = marker_ye;
252 // Work through from bottom to top of scale. Calculating where to put
253 // minor and major ticks.
255 // draw scale or tape
257 zoomed_scale((int)vmin, (int)vmax);
261 if (_minor_divs != 0.0f)
262 div_ratio = int(_major_divs / _minor_divs + 0.5f);
264 div_ratio = 0, _minor_divs = _major_divs; // FIXME move that into Scale/Constructor ?
266 float vstart = floorf(vmin / _major_divs) * _major_divs;
267 float min_diff = _w / 6.0; // length difference between major & minor tick
269 // FIXME consider oddtype
270 for (int i = 0; ; i++) {
271 float v = vstart + i * _minor_divs;
273 if (!_modulo && (v < _input.min() || v > _input.max()))
276 float y = _y + (v - vmin) * factor();
283 if (div_ratio && i % div_ratio) { // minor div
285 if (_tick_type == LINE) {
286 if (_tick_length == VARIABLE) {
287 draw_line(_x, y, marker_xs, y);
288 draw_line(marker_xe, y, right, y);
290 draw_line(_x, y, marker_xs, y);
291 draw_line(marker_xe, y, right, y);
294 } else { // _tick_type == CIRCLE
295 draw_bullet(_x, y, 3.0);
298 // glBegin(GL_LINES);
299 // glVertex2f(_x, y);
300 // glVertex2f(marker_xs, y);
301 // glVertex2f(marker_xe, y);
302 // glVertex2f(_x + _w, y);
304 // anything other than huds_both
306 } else if (option_left()) {
307 if (_tick_type == LINE) {
308 if (_tick_length == VARIABLE) {
309 draw_line(marker_xs + min_diff, y, marker_xe, y);
311 draw_line(marker_xs, y, marker_xe, y);
313 } else { // _tick_type == CIRCLE
314 draw_bullet(marker_xs + 4, y, 3.0);
317 } else { // if (option_right())
318 if (_tick_type == LINE) {
319 if (_tick_length == VARIABLE) {
320 draw_line(marker_xs, y, marker_xe - min_diff, y);
322 draw_line(marker_xs, y, marker_xe, y);
325 } else { // _tick_type == CIRCLE
326 draw_bullet(marker_xe - 4, y, 3.0);
330 } else { // major div
331 int display_value = int(v);
333 display_value %= _modulo;
335 snprintf(buf, BUFSIZE, "%d", display_value);
336 float strwd = text_width(buf);
337 float strht = _hud->_font_size;
340 // draw_line(_x, y, marker_xs, y);
341 // draw_line(marker_xs, y, _x + _w, y);
342 if (_tick_type == LINE) {
343 glBegin(GL_LINE_STRIP);
345 glVertex2f(marker_xs, y);
346 glVertex2f(right, y);
349 } else { // _tick_type == CIRCLE
350 draw_bullet(_x, y, 5.0);
353 if (!option_notext())
354 draw_text(marker_xs + 2, y, buf, 0);
357 if (_tick_type == LINE)
358 draw_line(marker_xs, y, marker_xe, y);
359 else // _tick_type == CIRCLE
360 draw_bullet(marker_xs + 4, y, 5.0);
362 if (!option_notext()) {
364 draw_text(marker_xs - strwd, y - 4, buf, 0);
366 draw_text(marker_xe + strwd / 2, y - 4, buf, 0);
368 } // End if huds-both
374 ///////////////////////////////////////////////////////////////////////////////
376 ///////////////////////////////////////////////////////////////////////////////
382 draw_line(_x, _y, _x, top);
385 if (_draw_tick_right)
386 draw_line(right, _y, right, top);
388 marker_ys = _y; // Starting point for
389 marker_ye = top; // tick y location calcs
391 marker_xs = _x + ((cur_value - vmin) * factor());
393 // glBegin(GL_LINES);
395 // glVertex2f(_x, _y);
396 // glVertex2f(_x, marker_ye);
399 // glVertex2f(marker_xe, _y);
400 // glVertex2f(marker_xe, marker_ye);
404 if (_draw_cap_bottom)
405 draw_line(_x, _y, right, _y);
408 marker_ye = _y + _h / 2;
410 // draw_line(_center_x, marker_ye, _center_x - _h / 4, _y);
411 // draw_line(_center_x, marker_ye, _center_x + _h / 4, _y);
414 if (_pointer_type == MOVING) {
416 //Code for Moving Type Pointer
418 float xcentre = _center_x;
420 float xpoint = xcentre + (cur_value * range / _val_span);
421 float ypoint = _y - _marker_offset;
422 draw_line(xcentre, ypoint, xpoint, ypoint);
423 draw_line(xpoint, ypoint, xpoint, ypoint + _marker_offset);
424 draw_line(xpoint, ypoint + _marker_offset, xpoint + 5.0, ypoint + 5.0);
425 draw_line(xpoint, ypoint + _marker_offset, xpoint - 5.0, ypoint + 5.0);
430 fixed(marker_xs - _h / 4, _y, marker_xs,
431 marker_ye, marker_xs + _h / 4, _y);
434 } // End Horizontal scale/top
436 if (option_bottom()) {
438 draw_line(_x, top, right, top);
441 marker_ys = top - _h / 2;
443 // draw_line(_center_x + _h / 4, _y + _h, _center_x, marker_ys);
444 // draw_line(_center_x - _h / 4, _y + _h, _center_x , marker_ys);
448 if (_pointer_type == MOVING) {
450 //Code for Moving Type Pointer
452 float xcentre = _center_x;
455 float xpoint = xcentre + (cur_value * range / _val_span);
456 float ypoint = hgt + _marker_offset;
457 draw_line(xcentre, ypoint, xpoint, ypoint);
458 draw_line(xpoint, ypoint, xpoint, ypoint - _marker_offset);
459 draw_line(xpoint, ypoint - _marker_offset, xpoint + 5.0, ypoint - 5.0);
460 draw_line(xpoint, ypoint - _marker_offset, xpoint - 5.0, ypoint - 5.0);
463 fixed(marker_xs + _h / 4, top, marker_xs, marker_ys,
464 marker_xs - _h / 4, top);
467 } //end horizontal scale bottom
471 zoomed_scale((int)vmin,(int)vmax);
473 int div_ratio; // FIXME abstract that out of hor/vert
474 if (_minor_divs != 0.0f)
475 div_ratio = int(_major_divs / _minor_divs + 0.5f);
477 div_ratio = 0, _minor_divs = _major_divs; // FIXME move that into Scale/Constructor ?
479 float vstart = floorf(vmin / _major_divs) * _major_divs;
480 float min_diff = _h / 6.0; // length difference between major & minor tick
482 // FIXME consider oddtype
483 for (int i = 0; ; i++) {
484 float v = vstart + i * _minor_divs;
486 if (!_modulo && (v < _input.min() || v > _input.max()))
489 float x = _x + (v - vmin) * factor();
496 if (div_ratio && i % div_ratio) { // minor div
498 if (_tick_length == VARIABLE) {
499 draw_line(x, _y, x, marker_ys - 4);
500 draw_line(x, marker_ye + 4, x, top);
502 draw_line(x, _y, x, marker_ys);
503 draw_line(x, marker_ye, x, top);
505 // glBegin(GL_LINES);
506 // glVertex2f(x, _y);
507 // glVertex2f(x, marker_ys - 4);
508 // glVertex2f(x, marker_ye + 4);
509 // glVertex2f(x, _y + _h);
515 if (_tick_length == VARIABLE)
516 draw_line(x, marker_ys, x, marker_ye - min_diff);
518 draw_line(x, marker_ys, x, marker_ye);
520 } else if (_tick_length == VARIABLE) {
521 draw_line(x, marker_ys + 4, x, marker_ye);
523 draw_line(x, marker_ys, x, marker_ye);
527 } else { // major divs
528 int display_value = int(v);
530 display_value %= _modulo;
532 snprintf(buf, BUFSIZE, "%d", display_value);
533 float strwd = text_width(buf);
534 float strht = _hud->_font_size;
536 // Draw major ticks and text only if far enough from the edge. // FIXME
537 if (x < _x + 10 || x + 10 > _x + _w)
543 // draw_line(x, marker_ye,
545 glBegin(GL_LINE_STRIP);
547 glVertex2f(x, marker_ye);
551 if (!option_notext())
552 draw_text(x - strwd / 2.0, marker_ys + 4, buf, 0);
555 draw_line(x, marker_ys, x, marker_ye);
557 if (!option_notext()) {
559 draw_text(x - strwd / 2.0, top - 10, buf, 0);
561 draw_text(x - strwd / 2.0, _y, buf, 0);
567 } // end horizontal/vertical scale
572 void HUD::Tape::fixed(float x1, float y1, float x2, float y2, float x3, float y3)
574 glBegin(GL_LINE_STRIP);
582 void HUD::Tape::zoomed_scale(int first, int last)
584 const int BUFSIZE = 80;
588 float x, y, w, h, bottom;
589 float cur_value = _input.getFloatValue();
592 while (first <= last) {
593 if ((first % (int)_major_divs) == 0) {
608 float xstart, yfirst, ycentre, ysecond;
610 float hgt = bottom * 20.0 / 100.0; // 60% of height should be zoomed
611 yfirst = _center_y - hgt;
613 ysecond = _center_y + hgt;
614 float range = hgt * 2;
617 float factor = range / 10.0;
619 float hgt1 = bottom * 30.0 / 100.0;
620 int incrs = int((_val_span - _major_divs * 2.0) / _major_divs);
621 int incr = incrs / 2;
622 float factors = hgt1 / incr;
625 //this is for moving type pointer
626 static float ycent, ypoint, xpoint; // FIXME really static?
632 if (cur_value <= data[centre + 1])
633 if (cur_value > data[centre]) {
634 ypoint = ycent + ((cur_value - data[centre]) * hgt / _major_divs);
637 if (cur_value >= data[centre - 1])
638 if (cur_value <= data[centre]) {
639 ypoint = ycent - ((data[centre] - cur_value) * hgt / _major_divs);
642 if (cur_value < data[centre - 1])
643 if (cur_value >= _input.min()) {
644 float diff = _input.min() - data[centre - 1];
645 float diff1 = cur_value - data[centre - 1];
646 float val = (diff1 * hgt1) / diff;
648 ypoint = ycent - hgt - val;
651 if (cur_value > data[centre + 1])
652 if (cur_value <= _input.max()) {
653 float diff = _input.max() - data[centre + 1];
654 float diff1 = cur_value - data[centre + 1];
655 float val = (diff1 * hgt1) / diff;
657 ypoint = ycent + hgt + val;
663 draw_line(xstart, ycentre, xstart - 5.0, ycentre); //centre tick
665 snprintf(buf, BUFSIZE, "%3.0f\n", float(data[centre] * _input.factor())); // was data_scaling() ... makes not sense at all
667 if (!option_notext())
668 draw_text(x, ycentre, buf, 0);
670 for (i = 1; i < 5; i++) {
673 draw_bullet(xstart - 2.5, yfirst, 3.0);
674 draw_bullet(xstart - 2.5, ycentre, 3.0);
677 yfirst = _center_y - hgt;
679 for (i = 0; i <= incr; i++) {
680 draw_line(xstart, yfirst, xstart - 5.0, yfirst);
681 draw_line(xstart, ysecond, xstart - 5.0, ysecond);
683 snprintf(buf, BUFSIZE, "%3.0f\n", float(data[centre - i - 1] * _input.factor())); // was data_scaling() ... makes no sense at all
685 if (!option_notext())
686 draw_text(x, yfirst, buf, 0);
688 snprintf(buf, BUFSIZE, "%3.0f\n", float(data[centre + i + 1] * _input.factor())); // was data_scaling() ... makes no sense at all
690 if (!option_notext())
691 draw_text(x, ysecond, buf, 0);
698 //to draw moving type pointer for left option
702 if (_pointer_type == MOVING) {
703 draw_line(xpoint, ycent, xpoint, ypoint);
704 draw_line(xpoint, ypoint, xpoint - 10.0, ypoint);
705 draw_line(xpoint - 10.0, ypoint, xpoint - 5.0, ypoint + 5.0);
706 draw_line(xpoint - 10.0, ypoint, xpoint - 5.0, ypoint - 5.0);
712 xstart = (x + w) / 2;
714 draw_line(xstart, ycentre, xstart + 5.0, ycentre); //centre tick
716 snprintf(buf, BUFSIZE, "%3.0f\n", float(data[centre] * _input.factor())); // was data_scaling() ... makes no sense at all
718 if (!option_notext())
719 draw_text(w, ycentre, buf, 0);
721 for (i = 1; i < 5; i++) {
724 draw_bullet(xstart + 2.5, yfirst, 3.0);
725 draw_bullet(xstart + 2.5, ycentre, 3.0);
728 yfirst = _center_y - hgt;
730 for (i = 0; i <= incr; i++) {
731 draw_line(xstart, yfirst, xstart + 5.0, yfirst);
732 draw_line(xstart, ysecond, xstart + 5.0, ysecond);
734 snprintf(buf, BUFSIZE, "%3.0f\n", float(data[centre - i - 1] * _input.factor())); // was data_scaling() ... makes no sense at all
736 if (!option_notext())
737 draw_text(w, yfirst, buf, 0);
739 snprintf(buf, BUFSIZE, "%3.0f\n", float(data[centre + i + 1] * _input.factor()));
741 if (!option_notext())
742 draw_text(w, ysecond, buf, 0);
749 // to draw moving type pointer for right option
753 if (_pointer_type == MOVING) {
754 draw_line(xpoint, ycent, xpoint, ypoint);
755 draw_line(xpoint, ypoint, xpoint + 10.0, ypoint);
756 draw_line(xpoint + 10.0, ypoint, xpoint + 5.0, ypoint + 5.0);
757 draw_line(xpoint + 10.0, ypoint, xpoint + 5.0, ypoint - 5.0);
760 }//end option_right /left
761 //end of vertical scale
771 float ystart, xfirst, xcentre, xsecond;
773 float hgt = bottom * 20.0 / 100.0; // 60% of height should be zoomed
774 xfirst = _center_x - hgt;
776 xsecond = _center_x + hgt;
777 float range = hgt * 2;
780 float factor = range / 10.0;
782 float hgt1 = bottom * 30.0 / 100.0;
783 int incrs = int((_val_span - _major_divs * 2.0) / _major_divs);
784 int incr = incrs / 2;
785 float factors = hgt1 / incr;
788 //Code for Moving Type Pointer
790 static float xcent, xpoint, ypoint; // FIXME really static?
794 if (cur_value <= data[centre + 1])
795 if (cur_value > data[centre]) {
796 xpoint = xcent + ((cur_value - data[centre]) * hgt / _major_divs);
799 if (cur_value >= data[centre - 1])
800 if (cur_value <= data[centre]) {
801 xpoint = xcent - ((data[centre] - cur_value) * hgt / _major_divs);
804 if (cur_value < data[centre - 1])
805 if (cur_value >= _input.min()) {
806 float diff = _input.min() - data[centre - 1];
807 float diff1 = cur_value - data[centre - 1];
808 float val = (diff1 * hgt1) / diff;
810 xpoint = xcent - hgt - val;
814 if (cur_value > data[centre + 1])
815 if (cur_value <= _input.max()) {
816 float diff = _input.max() - data[centre + 1];
817 float diff1 = cur_value - data[centre + 1];
818 float val = (diff1 * hgt1) / diff;
820 xpoint = xcent + hgt + val;
826 draw_line(xcentre, ystart, xcentre, ystart - 5.0); //centre tick
828 snprintf(buf, BUFSIZE, "%3.0f\n", float(data[centre] * _input.factor())); // was data_scaling() ... makes no sense at all
830 if (!option_notext())
831 draw_text(xcentre - 10.0, y, buf, 0);
833 for (i = 1; i < 5; i++) {
836 draw_bullet(xfirst, ystart - 2.5, 3.0);
837 draw_bullet(xcentre, ystart - 2.5, 3.0);
840 xfirst = _center_x - hgt;
842 for (i = 0; i <= incr; i++) {
843 draw_line(xfirst, ystart, xfirst, ystart - 5.0);
844 draw_line(xsecond, ystart, xsecond, ystart - 5.0);
846 snprintf(buf, BUFSIZE, "%3.0f\n", float(data[centre - i - 1] * _input.factor())); // was data_scaling() ... makes no sense at all
848 if (!option_notext())
849 draw_text(xfirst - 10.0, y, buf, 0);
851 snprintf(buf, BUFSIZE, "%3.0f\n", float(data[centre + i + 1] * _input.factor())); // was data_scaling() ... makes no sense at all
853 if (!option_notext())
854 draw_text(xsecond - 10.0, y, buf, 0);
860 //this is for moving pointer for top option
863 ypoint = _y + _h + 10.0;
865 if (_pointer_type == MOVING) {
866 draw_line(xcent, ypoint, xpoint, ypoint);
867 draw_line(xpoint, ypoint, xpoint, ypoint - 10.0);
868 draw_line(xpoint, ypoint - 10.0, xpoint + 5.0, ypoint - 5.0);
869 draw_line(xpoint, ypoint - 10.0, xpoint - 5.0, ypoint - 5.0);
875 ystart = (y + h) / 2;
877 //draw_line(xstart, yfirst, xstart - 5.0, yfirst);
878 draw_line(xcentre, ystart, xcentre, ystart + 5.0); //centre tick
880 snprintf(buf, BUFSIZE, "%3.0f\n", float(data[centre] * _input.factor())); // was data_scaling() ... makes no sense at all
882 if (!option_notext())
883 draw_text(xcentre - 10.0, h, buf, 0);
885 for (i = 1; i < 5; i++) {
888 draw_bullet(xfirst, ystart + 2.5, 3.0);
889 draw_bullet(xcentre, ystart + 2.5, 3.0);
892 xfirst = _center_x - hgt;
894 for (i = 0; i <= incr; i++) {
895 draw_line(xfirst, ystart, xfirst, ystart + 5.0);
896 draw_line(xsecond, ystart, xsecond, ystart + 5.0);
898 snprintf(buf, BUFSIZE, "%3.0f\n", float(data[centre - i - 1] * _input.factor())); // was data_scaling() ... makes no sense at all
900 if (!option_notext())
901 draw_text(xfirst - 10.0, h, buf, 0);
903 snprintf(buf, BUFSIZE, "%3.0f\n", float(data[centre + i + 1] * _input.factor())); // was data_scaling() ... makes no sense at all
905 if (!option_notext())
906 draw_text(xsecond - 10.0, h, buf, 0);
911 //this is for movimg pointer for bottom option
915 if (_pointer_type == MOVING) {
916 draw_line(xcent, ypoint, xpoint, ypoint);
917 draw_line(xpoint, ypoint, xpoint, ypoint + 10.0);
918 draw_line(xpoint, ypoint + 10.0, xpoint + 5.0, ypoint + 5.0);
919 draw_line(xpoint, ypoint + 10.0, xpoint - 5.0, ypoint + 5.0);
921 }//end hud_top or hud_bottom
922 } //end of horizontal/vertical scales