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;
274 if (v < _input.min())
276 else if (v > _input.max())
279 float y = _y + (v - vmin) * factor();
286 if (div_ratio && i % div_ratio) { // minor div
288 if (_tick_type == LINE) {
289 if (_tick_length == VARIABLE) {
290 draw_line(_x, y, marker_xs, y);
291 draw_line(marker_xe, y, right, y);
293 draw_line(_x, y, marker_xs, y);
294 draw_line(marker_xe, y, right, y);
297 } else { // _tick_type == CIRCLE
298 draw_bullet(_x, y, 3.0);
301 // glBegin(GL_LINES);
302 // glVertex2f(_x, y);
303 // glVertex2f(marker_xs, y);
304 // glVertex2f(marker_xe, y);
305 // glVertex2f(_x + _w, y);
307 // anything other than huds_both
309 } else if (option_left()) {
310 if (_tick_type == LINE) {
311 if (_tick_length == VARIABLE) {
312 draw_line(marker_xs + min_diff, y, marker_xe, y);
314 draw_line(marker_xs, y, marker_xe, y);
316 } else { // _tick_type == CIRCLE
317 draw_bullet(marker_xs + 4, y, 3.0);
320 } else { // if (option_right())
321 if (_tick_type == LINE) {
322 if (_tick_length == VARIABLE) {
323 draw_line(marker_xs, y, marker_xe - min_diff, y);
325 draw_line(marker_xs, y, marker_xe, y);
328 } else { // _tick_type == CIRCLE
329 draw_bullet(marker_xe - 4, y, 3.0);
333 } else { // major div
334 int display_value = int(v);
336 display_value %= _modulo;
338 snprintf(buf, BUFSIZE, "%d", display_value);
341 // draw_line(_x, y, marker_xs, y);
342 // draw_line(marker_xs, y, _x + _w, y);
343 if (_tick_type == LINE) {
344 glBegin(GL_LINE_STRIP);
346 glVertex2f(marker_xs, y);
347 glVertex2f(right, y);
350 } else { // _tick_type == CIRCLE
351 draw_bullet(_x, y, 5.0);
354 if (!option_notext())
355 draw_text(marker_xs, y, buf, HUDText::CENTER);
358 if (_tick_type == LINE)
359 draw_line(marker_xs, y, marker_xe, y);
360 else // _tick_type == CIRCLE
361 draw_bullet(marker_xs + 4, y, 5.0);
363 if (!option_notext()) {
365 draw_text(marker_xs, y, buf, HUDText::RIGHT|HUDText::VCENTER);
367 draw_text(marker_xe + 1.0, y, buf, HUDText::LEFT|HUDText::VCENTER);
369 } // End if huds-both
375 ///////////////////////////////////////////////////////////////////////////////
377 ///////////////////////////////////////////////////////////////////////////////
383 draw_line(_x, _y, _x, top);
386 if (_draw_tick_right)
387 draw_line(right, _y, right, top);
389 marker_ys = _y; // Starting point for
390 marker_ye = top; // tick y location calcs
392 marker_xs = _x + ((cur_value - vmin) * factor());
394 // glBegin(GL_LINES);
396 // glVertex2f(_x, _y);
397 // glVertex2f(_x, marker_ye);
400 // glVertex2f(marker_xe, _y);
401 // glVertex2f(marker_xe, marker_ye);
405 if (_draw_cap_bottom)
406 draw_line(_x, _y, right, _y);
409 marker_ye = _y + _h / 2;
411 // draw_line(_center_x, marker_ye, _center_x - _h / 4, _y);
412 // draw_line(_center_x, marker_ye, _center_x + _h / 4, _y);
415 if (_pointer_type == MOVING) {
417 //Code for Moving Type Pointer
419 float xcentre = _center_x;
421 float xpoint = xcentre + (cur_value * range / _val_span);
422 float ypoint = _y - _marker_offset;
423 draw_line(xcentre, ypoint, xpoint, ypoint);
424 draw_line(xpoint, ypoint, xpoint, ypoint + _marker_offset);
425 draw_line(xpoint, ypoint + _marker_offset, xpoint + 5.0, ypoint + 5.0);
426 draw_line(xpoint, ypoint + _marker_offset, xpoint - 5.0, ypoint + 5.0);
431 fixed(marker_xs - _h / 4, _y, marker_xs,
432 marker_ye, marker_xs + _h / 4, _y);
435 } // End Horizontal scale/top
437 if (option_bottom()) {
439 draw_line(_x, top, right, top);
442 marker_ys = top - _h / 2;
444 // draw_line(_center_x + _h / 4, _y + _h, _center_x, marker_ys);
445 // draw_line(_center_x - _h / 4, _y + _h, _center_x , marker_ys);
449 if (_pointer_type == MOVING) {
451 //Code for Moving Type Pointer
453 float xcentre = _center_x;
456 float xpoint = xcentre + (cur_value * range / _val_span);
457 float ypoint = hgt + _marker_offset;
458 draw_line(xcentre, ypoint, xpoint, ypoint);
459 draw_line(xpoint, ypoint, xpoint, ypoint - _marker_offset);
460 draw_line(xpoint, ypoint - _marker_offset, xpoint + 5.0, ypoint - 5.0);
461 draw_line(xpoint, ypoint - _marker_offset, xpoint - 5.0, ypoint - 5.0);
464 fixed(marker_xs + _h / 4, top, marker_xs, marker_ys,
465 marker_xs - _h / 4, top);
468 } //end horizontal scale bottom
472 zoomed_scale((int)vmin,(int)vmax);
474 int div_ratio; // FIXME abstract that out of hor/vert
475 if (_minor_divs != 0.0f)
476 div_ratio = int(_major_divs / _minor_divs + 0.5f);
478 div_ratio = 0, _minor_divs = _major_divs; // FIXME move that into Scale/Constructor ?
480 float vstart = floorf(vmin / _major_divs) * _major_divs;
481 float min_diff = _h / 6.0; // length difference between major & minor tick
483 // FIXME consider oddtype
484 for (int i = 0; ; i++) {
485 float v = vstart + i * _minor_divs;
488 if (v < _input.min())
490 else if (v > _input.max())
493 float x = _x + (v - vmin) * factor();
500 if (div_ratio && i % div_ratio) { // minor div
502 if (_tick_length == VARIABLE) {
503 draw_line(x, _y, x, marker_ys - 4);
504 draw_line(x, marker_ye + 4, x, top);
506 draw_line(x, _y, x, marker_ys);
507 draw_line(x, marker_ye, x, top);
509 // glBegin(GL_LINES);
510 // glVertex2f(x, _y);
511 // glVertex2f(x, marker_ys - 4);
512 // glVertex2f(x, marker_ye + 4);
513 // glVertex2f(x, _y + _h);
519 if (_tick_length == VARIABLE)
520 draw_line(x, marker_ys, x, marker_ye - min_diff);
522 draw_line(x, marker_ys, x, marker_ye);
524 } else if (_tick_length == VARIABLE) {
525 draw_line(x, marker_ys + 4, x, marker_ye);
527 draw_line(x, marker_ys, x, marker_ye);
531 } else { // major divs
532 int display_value = int(v);
534 display_value %= _modulo;
536 snprintf(buf, BUFSIZE, "%d", display_value);
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, marker_ys, buf, HUDText::CENTER);
557 draw_line(x, marker_ys, x, marker_ye);
559 if (!option_notext()) {
561 draw_text(x, top, buf, HUDText::TOP|HUDText::HCENTER);
563 draw_text(x, _y, buf, HUDText::BOTTOM|HUDText::HCENTER);
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