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(floorf(_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 / (_input.max() - _input.min());
162 ycentre = _y + _input.min() * _h / (_input.max() - _input.min());
168 ypoint = ycentre + ((cur_value - 1.0) * range / _val_span);
170 ypoint = ycentre + (cur_value * range / _val_span);
172 xpoint = right + _marker_offset;
173 draw_line(xpoint, ycentre, xpoint, ypoint);
174 draw_line(xpoint, ypoint, xpoint - _marker_offset, ypoint);
175 draw_line(xpoint - _marker_offset, ypoint, xpoint - 5.0, ypoint + 5.0);
176 draw_line(xpoint - _marker_offset, ypoint, xpoint - 5.0, ypoint - 5.0);
181 draw_fixed_pointer(_marker_offset + marker_xe, text_y + _w / 6,
182 _marker_offset + marker_xs, text_y, _marker_offset + marker_xe,
184 } // end pointer type
186 } // end vertical/left
189 // begin vertical/right
190 // First draw capping lines and pointers
191 if (option_right()) {
194 draw_line(_x, _y, _x, marker_ye);
196 marker_xe = _x + _w / 3.0;
198 // draw_line(_x, _center_y + _w / 6, marker_xe, _center_y);
199 // draw_line(_x, _center_y - _w / 6, marker_xe, _center_y);
203 if (_pointer_type == MOVING) {
205 // type-fixed & _zoom=1, behaviour to be defined
206 // Code for Moving Type Pointer
207 float ycentre, ypoint, xpoint;
210 if (_input.min() >= 0.0)
212 else if (_input.max() + _input.min() == 0.0)
215 ycentre = _y + (1.0 - _input.min()) * _h / (_input.max() - _input.min());
217 ycentre = _y + _input.min() * _h / (_input.max() - _input.min());
222 ypoint = ycentre + ((cur_value - 1.0) * range / _val_span);
224 ypoint = ycentre + (cur_value * range / _val_span);
226 xpoint = _x - _marker_offset;
227 draw_line(xpoint, ycentre, xpoint, ypoint);
228 draw_line(xpoint, ypoint, xpoint + _marker_offset, ypoint);
229 draw_line(xpoint + _marker_offset, ypoint, xpoint + 5.0, ypoint + 5.0);
230 draw_line(xpoint + _marker_offset, ypoint, xpoint + 5.0, ypoint - 5.0);
235 draw_fixed_pointer(-_marker_offset + _x, text_y + _w / 6,
236 -_marker_offset + marker_xe, text_y, -_marker_offset + _x,
240 } // end vertical/right
243 // At this point marker x_start and x_end values are transposed.
244 // To keep this from confusing things they are now swapped.
246 marker_ye = marker_xs, marker_xs = marker_xe, marker_xe = marker_ye;
250 // Work through from bottom to top of scale. Calculating where to put
251 // minor and major ticks.
253 // draw scale or tape
255 zoomed_scale((int)vmin, (int)vmax);
259 if (_minor_divs != 0.0f)
260 div_ratio = int(_major_divs / _minor_divs + 0.5f);
262 div_ratio = 0, _minor_divs = _major_divs; // FIXME move that into Scale/Constructor ?
264 float vstart = floorf(vmin / _major_divs) * _major_divs;
265 float min_diff = _w / 6.0; // length difference between major & minor tick
267 // FIXME consider oddtype
268 for (int i = 0; ; i++) {
269 float v = vstart + i * _minor_divs;
272 if (v < _input.min())
274 else if (v > _input.max())
277 float y = _y + (v - vmin) * factor();
284 if (div_ratio && i % div_ratio) { // minor div
286 if (_tick_type == LINE) {
287 if (_tick_length == VARIABLE) {
288 draw_line(_x, y, marker_xs, y);
289 draw_line(marker_xe, y, right, y);
291 draw_line(_x, y, marker_xs, y);
292 draw_line(marker_xe, y, right, y);
295 } else { // _tick_type == CIRCLE
296 draw_bullet(_x, y, 3.0);
299 // glBegin(GL_LINES);
300 // glVertex2f(_x, y);
301 // glVertex2f(marker_xs, y);
302 // glVertex2f(marker_xe, y);
303 // glVertex2f(_x + _w, y);
305 // anything other than huds_both
307 } else if (option_left()) {
308 if (_tick_type == LINE) {
309 if (_tick_length == VARIABLE) {
310 draw_line(marker_xs + min_diff, y, marker_xe, y);
312 draw_line(marker_xs, y, marker_xe, y);
314 } else { // _tick_type == CIRCLE
315 draw_bullet(marker_xs + 4, y, 3.0);
318 } else { // if (option_right())
319 if (_tick_type == LINE) {
320 if (_tick_length == VARIABLE) {
321 draw_line(marker_xs, y, marker_xe - min_diff, y);
323 draw_line(marker_xs, y, marker_xe, y);
326 } else { // _tick_type == CIRCLE
327 draw_bullet(marker_xe - 4, y, 3.0);
331 } else { // major div
332 int display_value = int(v);
334 display_value %= _modulo;
336 snprintf(buf, BUFSIZE, "%d", display_value);
339 // draw_line(_x, y, marker_xs, y);
340 // draw_line(marker_xs, y, _x + _w, y);
341 if (_tick_type == LINE) {
342 glBegin(GL_LINE_STRIP);
344 glVertex2f(marker_xs, y);
345 glVertex2f(right, y);
348 } else { // _tick_type == CIRCLE
349 draw_bullet(_x, y, 5.0);
352 if (!option_notext())
353 draw_text(marker_xs, y, buf, HUDText::CENTER);
356 if (_tick_type == LINE)
357 draw_line(marker_xs, y, marker_xe, y);
358 else // _tick_type == CIRCLE
359 draw_bullet(marker_xs + 4, y, 5.0);
361 if (!option_notext()) {
363 draw_text(marker_xs, y, buf, HUDText::RIGHT|HUDText::VCENTER);
365 draw_text(marker_xe + 1.0, y, buf, HUDText::LEFT|HUDText::VCENTER);
367 } // End if huds-both
373 ///////////////////////////////////////////////////////////////////////////////
375 ///////////////////////////////////////////////////////////////////////////////
381 draw_line(_x, _y, _x, top);
384 if (_draw_tick_right)
385 draw_line(right, _y, right, top);
387 marker_ys = _y; // Starting point for
388 marker_ye = top; // tick y location calcs
390 marker_xs = _x + ((cur_value - vmin) * factor());
392 // glBegin(GL_LINES);
394 // glVertex2f(_x, _y);
395 // glVertex2f(_x, marker_ye);
398 // glVertex2f(marker_xe, _y);
399 // glVertex2f(marker_xe, marker_ye);
403 if (_draw_cap_bottom)
404 draw_line(_x, _y, right, _y);
407 marker_ye = _y + _h / 2;
409 // draw_line(_center_x, marker_ye, _center_x - _h / 4, _y);
410 // draw_line(_center_x, marker_ye, _center_x + _h / 4, _y);
413 if (_pointer_type == MOVING) {
415 //Code for Moving Type Pointer
417 float xcentre = _center_x;
419 float xpoint = xcentre + (cur_value * range / _val_span);
420 float ypoint = _y - _marker_offset;
421 draw_line(xcentre, ypoint, xpoint, ypoint);
422 draw_line(xpoint, ypoint, xpoint, ypoint + _marker_offset);
423 draw_line(xpoint, ypoint + _marker_offset, xpoint + 5.0, ypoint + 5.0);
424 draw_line(xpoint, ypoint + _marker_offset, xpoint - 5.0, ypoint + 5.0);
429 draw_fixed_pointer(marker_xs - _h / 4, _y, marker_xs,
430 marker_ye, marker_xs + _h / 4, _y);
433 } // End Horizontal scale/top
435 if (option_bottom()) {
437 draw_line(_x, top, right, top);
440 marker_ys = top - _h / 2;
442 // draw_line(_center_x + _h / 4, _y + _h, _center_x, marker_ys);
443 // draw_line(_center_x - _h / 4, _y + _h, _center_x , marker_ys);
447 if (_pointer_type == MOVING) {
449 //Code for Moving Type Pointer
451 float xcentre = _center_x;
454 float xpoint = xcentre + (cur_value * range / _val_span);
455 float ypoint = hgt + _marker_offset;
456 draw_line(xcentre, ypoint, xpoint, ypoint);
457 draw_line(xpoint, ypoint, xpoint, ypoint - _marker_offset);
458 draw_line(xpoint, ypoint - _marker_offset, xpoint + 5.0, ypoint - 5.0);
459 draw_line(xpoint, ypoint - _marker_offset, xpoint - 5.0, ypoint - 5.0);
462 draw_fixed_pointer(marker_xs + _h / 4, top, marker_xs, marker_ys,
463 marker_xs - _h / 4, top);
466 } //end horizontal scale bottom
470 zoomed_scale((int)vmin,(int)vmax);
472 int div_ratio; // FIXME abstract that out of hor/vert
473 if (_minor_divs != 0.0f)
474 div_ratio = int(_major_divs / _minor_divs + 0.5f);
476 div_ratio = 0, _minor_divs = _major_divs; // FIXME move that into Scale/Constructor ?
478 float vstart = floorf(vmin / _major_divs) * _major_divs;
479 float min_diff = _h / 6.0; // length difference between major & minor tick
481 // FIXME consider oddtype
482 for (int i = 0; ; i++) {
483 float v = vstart + i * _minor_divs;
486 if (v < _input.min())
488 else if (v > _input.max())
491 float x = _x + (v - vmin) * factor();
498 if (div_ratio && i % div_ratio) { // minor div
500 if (_tick_length == VARIABLE) {
501 draw_line(x, _y, x, marker_ys - 4);
502 draw_line(x, marker_ye + 4, x, top);
504 draw_line(x, _y, x, marker_ys);
505 draw_line(x, marker_ye, x, top);
507 // glBegin(GL_LINES);
508 // glVertex2f(x, _y);
509 // glVertex2f(x, marker_ys - 4);
510 // glVertex2f(x, marker_ye + 4);
511 // glVertex2f(x, _y + _h);
517 if (_tick_length == VARIABLE)
518 draw_line(x, marker_ys, x, marker_ye - min_diff);
520 draw_line(x, marker_ys, x, marker_ye);
522 } else if (_tick_length == VARIABLE) {
523 draw_line(x, marker_ys + 4, x, marker_ye);
525 draw_line(x, marker_ys, x, marker_ye);
529 } else { // major divs
530 int display_value = int(v);
532 display_value %= _modulo;
534 snprintf(buf, BUFSIZE, "%d", display_value);
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, marker_ys, buf, HUDText::CENTER);
555 draw_line(x, marker_ys, x, marker_ye);
557 if (!option_notext()) {
559 draw_text(x, top, buf, HUDText::TOP|HUDText::HCENTER);
561 draw_text(x, _y, buf, HUDText::BOTTOM|HUDText::HCENTER);
567 } // end horizontal/vertical scale
571 void HUD::Tape::draw_fixed_pointer(float x1, float y1, float x2, float y2, float x3, float y3)
573 glBegin(GL_LINE_STRIP);
581 void HUD::Tape::zoomed_scale(int first, int last)
583 const int BUFSIZE = 80;
587 float x, y, w, h, bottom;
588 float cur_value = _input.getFloatValue();
591 while (first <= last) {
592 if ((first % (int)_major_divs) == 0) {
607 float xstart, yfirst, ycentre, ysecond;
609 float hgt = bottom * 20.0 / 100.0; // 60% of height should be zoomed
610 yfirst = _center_y - hgt;
612 ysecond = _center_y + hgt;
613 float range = hgt * 2;
616 float factor = range / 10.0;
618 float hgt1 = bottom * 30.0 / 100.0;
619 int incrs = int((_val_span - _major_divs * 2.0) / _major_divs);
620 int incr = incrs / 2;
621 float factors = hgt1 / incr;
623 // moving type pointer
624 float ypoint, xpoint;
625 float ycent = _center_y;
626 float right = _x + _w;
628 if (cur_value <= data[centre + 1])
629 if (cur_value > data[centre]) {
630 ypoint = ycent + ((cur_value - data[centre]) * hgt / _major_divs);
633 if (cur_value >= data[centre - 1])
634 if (cur_value <= data[centre]) {
635 ypoint = ycent - ((data[centre] - cur_value) * hgt / _major_divs);
638 if (cur_value < data[centre - 1])
639 if (cur_value >= _input.min()) {
640 float diff = _input.min() - data[centre - 1];
641 float diff1 = cur_value - data[centre - 1];
642 float val = (diff1 * hgt1) / diff;
644 ypoint = ycent - hgt - val;
647 if (cur_value > data[centre + 1])
648 if (cur_value <= _input.max()) {
649 float diff = _input.max() - data[centre + 1];
650 float diff1 = cur_value - data[centre + 1];
651 float val = (diff1 * hgt1) / diff;
653 ypoint = ycent + hgt + val;
659 draw_line(xstart, ycentre, xstart - 5.0, ycentre); //centre tick
661 snprintf(buf, BUFSIZE, "%3.0f\n", float(data[centre] * _input.factor())); // was data_scaling() ... makes not sense at all
663 if (!option_notext())
664 draw_text(x, ycentre, buf, 0);
666 for (i = 1; i < 5; i++) {
669 draw_bullet(xstart - 2.5, yfirst, 3.0);
670 draw_bullet(xstart - 2.5, ycentre, 3.0);
673 yfirst = _center_y - hgt;
675 for (i = 0; i <= incr; i++) {
676 draw_line(xstart, yfirst, xstart - 5.0, yfirst);
677 draw_line(xstart, ysecond, xstart - 5.0, ysecond);
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, yfirst, buf, 0);
684 snprintf(buf, BUFSIZE, "%3.0f\n", float(data[centre + i + 1] * _input.factor())); // was data_scaling() ... makes no sense at all
686 if (!option_notext())
687 draw_text(x, ysecond, buf, 0);
694 //to draw moving type pointer for left option
696 xpoint = right + 10.0;
698 if (_pointer_type == MOVING) {
699 draw_line(xpoint, ycent, xpoint, ypoint);
700 draw_line(xpoint, ypoint, xpoint - 10.0, ypoint);
701 draw_line(xpoint - 10.0, ypoint, xpoint - 5.0, ypoint + 5.0);
702 draw_line(xpoint - 10.0, ypoint, xpoint - 5.0, ypoint - 5.0);
708 xstart = (x + w) / 2;
710 draw_line(xstart, ycentre, xstart + 5.0, ycentre); //centre tick
712 snprintf(buf, BUFSIZE, "%3.0f\n", float(data[centre] * _input.factor())); // was data_scaling() ... makes no sense at all
714 if (!option_notext())
715 draw_text(w, ycentre, buf, 0);
717 for (i = 1; i < 5; i++) {
720 draw_bullet(xstart + 2.5, yfirst, 3.0);
721 draw_bullet(xstart + 2.5, ycentre, 3.0);
724 yfirst = _center_y - hgt;
726 for (i = 0; i <= incr; i++) {
727 draw_line(xstart, yfirst, xstart + 5.0, yfirst);
728 draw_line(xstart, ysecond, xstart + 5.0, ysecond);
730 snprintf(buf, BUFSIZE, "%3.0f\n", float(data[centre - i - 1] * _input.factor())); // was data_scaling() ... makes no sense at all
732 if (!option_notext())
733 draw_text(w, yfirst, buf, 0);
735 snprintf(buf, BUFSIZE, "%3.0f\n", float(data[centre + i + 1] * _input.factor()));
737 if (!option_notext())
738 draw_text(w, ysecond, buf, 0);
745 // to draw moving type pointer for right option
749 if (_pointer_type == MOVING) {
750 draw_line(xpoint, ycent, xpoint, ypoint);
751 draw_line(xpoint, ypoint, xpoint + 10.0, ypoint);
752 draw_line(xpoint + 10.0, ypoint, xpoint + 5.0, ypoint + 5.0);
753 draw_line(xpoint + 10.0, ypoint, xpoint + 5.0, ypoint - 5.0);
756 }//end option_right /left
757 //end of vertical scale
767 float ystart, xfirst, xcentre, xsecond;
769 float hgt = bottom * 20.0 / 100.0; // 60% of height should be zoomed
770 xfirst = _center_x - hgt;
772 xsecond = _center_x + hgt;
773 float range = hgt * 2;
776 float factor = range / 10.0;
778 float hgt1 = bottom * 30.0 / 100.0;
779 int incrs = int((_val_span - _major_divs * 2.0) / _major_divs);
780 int incr = incrs / 2;
781 float factors = hgt1 / incr;
784 //Code for Moving Type Pointer
786 static float xcent, xpoint, ypoint; // FIXME really static?
790 if (cur_value <= data[centre + 1])
791 if (cur_value > data[centre]) {
792 xpoint = xcent + ((cur_value - data[centre]) * hgt / _major_divs);
795 if (cur_value >= data[centre - 1])
796 if (cur_value <= data[centre]) {
797 xpoint = xcent - ((data[centre] - cur_value) * hgt / _major_divs);
800 if (cur_value < data[centre - 1])
801 if (cur_value >= _input.min()) {
802 float diff = _input.min() - data[centre - 1];
803 float diff1 = cur_value - data[centre - 1];
804 float val = (diff1 * hgt1) / diff;
806 xpoint = xcent - hgt - val;
810 if (cur_value > data[centre + 1])
811 if (cur_value <= _input.max()) {
812 float diff = _input.max() - data[centre + 1];
813 float diff1 = cur_value - data[centre + 1];
814 float val = (diff1 * hgt1) / diff;
816 xpoint = xcent + hgt + val;
822 draw_line(xcentre, ystart, xcentre, ystart - 5.0); //centre tick
824 snprintf(buf, BUFSIZE, "%3.0f\n", float(data[centre] * _input.factor())); // was data_scaling() ... makes no sense at all
826 if (!option_notext())
827 draw_text(xcentre - 10.0, y, buf, 0);
829 for (i = 1; i < 5; i++) {
832 draw_bullet(xfirst, ystart - 2.5, 3.0);
833 draw_bullet(xcentre, ystart - 2.5, 3.0);
836 xfirst = _center_x - hgt;
838 for (i = 0; i <= incr; i++) {
839 draw_line(xfirst, ystart, xfirst, ystart - 5.0);
840 draw_line(xsecond, ystart, xsecond, ystart - 5.0);
842 snprintf(buf, BUFSIZE, "%3.0f\n", float(data[centre - i - 1] * _input.factor())); // was data_scaling() ... makes no sense at all
844 if (!option_notext())
845 draw_text(xfirst - 10.0, y, buf, 0);
847 snprintf(buf, BUFSIZE, "%3.0f\n", float(data[centre + i + 1] * _input.factor())); // was data_scaling() ... makes no sense at all
849 if (!option_notext())
850 draw_text(xsecond - 10.0, y, buf, 0);
856 //this is for moving pointer for top option
859 ypoint = _y + _h + 10.0;
861 if (_pointer_type == MOVING) {
862 draw_line(xcent, ypoint, xpoint, ypoint);
863 draw_line(xpoint, ypoint, xpoint, ypoint - 10.0);
864 draw_line(xpoint, ypoint - 10.0, xpoint + 5.0, ypoint - 5.0);
865 draw_line(xpoint, ypoint - 10.0, xpoint - 5.0, ypoint - 5.0);
871 ystart = (y + h) / 2;
873 //draw_line(xstart, yfirst, xstart - 5.0, yfirst);
874 draw_line(xcentre, ystart, xcentre, ystart + 5.0); //centre tick
876 snprintf(buf, BUFSIZE, "%3.0f\n", float(data[centre] * _input.factor())); // was data_scaling() ... makes no sense at all
878 if (!option_notext())
879 draw_text(xcentre - 10.0, h, buf, 0);
881 for (i = 1; i < 5; i++) {
884 draw_bullet(xfirst, ystart + 2.5, 3.0);
885 draw_bullet(xcentre, ystart + 2.5, 3.0);
888 xfirst = _center_x - hgt;
890 for (i = 0; i <= incr; i++) {
891 draw_line(xfirst, ystart, xfirst, ystart + 5.0);
892 draw_line(xsecond, ystart, xsecond, ystart + 5.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(xfirst - 10.0, h, buf, 0);
899 snprintf(buf, BUFSIZE, "%3.0f\n", float(data[centre + i + 1] * _input.factor())); // was data_scaling() ... makes no sense at all
901 if (!option_notext())
902 draw_text(xsecond - 10.0, h, buf, 0);
907 //this is for movimg pointer for bottom option
911 if (_pointer_type == MOVING) {
912 draw_line(xcent, ypoint, xpoint, ypoint);
913 draw_line(xpoint, ypoint, xpoint, ypoint + 10.0);
914 draw_line(xpoint, ypoint + 10.0, xpoint + 5.0, ypoint + 5.0);
915 draw_line(xpoint, ypoint + 10.0, xpoint - 5.0, ypoint + 5.0);
917 }//end hud_top or hud_bottom
918 } //end of horizontal/vertical scales