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;
66 const int BUFSIZE = 80;
69 // int k; //odd or even values for ticks // FIXME odd scale
71 Point mid_scr = get_centroid();
72 float cur_value = _input.getFloatValue();
74 if (int(floor(_input.max() + 0.5)) & 1)
75 oddtype = 1; //draw ticks at odd values
77 oddtype = 0; //draw ticks at even values
79 height = _y + _h; // FIXME huh?
84 if (_pointer_type == MOVING) {
89 vmin = cur_value - _half_width_units; // width units == needle travel
90 vmax = cur_value + _half_width_units; // or picture unit span.
96 vmin = cur_value - _half_width_units; // width units == needle travel
97 vmax = cur_value + _half_width_units; // or picture unit span.
103 ///////////////////////////////////////////////////////////////////////////////
105 ///////////////////////////////////////////////////////////////////////////////
107 // Draw the basic markings for the scale...
109 if (option_vert()) { // Vertical scale
111 if (_draw_tick_bottom)
112 draw_line(_x, _y, width, _y);
116 draw_line(_x, height, width, height);
118 marker_xs = _x; // x start
119 marker_xe = width; // x extent
122 // glBegin(GL_LINES);
125 // glVertex2f(marker_xs, _y);
126 // glVertex2f(marker_xe, _y);
129 // glVertex2f(marker_xs, marker_ye);
130 // glVertex2f(marker_xe, marker_ye);
134 // We do not use else in the following so that combining the
135 // two options produces a "caged" display with double
136 // carrots. The same is done for horizontal card indicators.
138 // begin vertical/left
139 //First draw capping lines and pointers
140 if (option_left()) { // Calculate x marker offset
143 draw_line(marker_xe, _y, marker_xe, marker_ye);
145 marker_xs = marker_xe - _w / 3 + 0.5; // Adjust tick xs
147 // draw_line(marker_xs, mid_scr.y, marker_xe, mid_scr.y + _w / 6);
148 // draw_line(marker_xs, mid_scr.y, marker_xe, mid_scr.y - _w / 6);
152 if (_pointer_type == MOVING) {
154 //Code for Moving Type Pointer
155 float ycentre, ypoint, xpoint;
158 if (_input.min() >= 0.0)
160 else if (_input.max() + _input.min() == 0.0)
163 ycentre = _y + (1.0 - _input.min()) * _h
164 / (_input.max() - _input.min());
166 ycentre = _y + _input.min() * _h
167 / (_input.max() - _input.min());
173 ypoint = ycentre + ((cur_value - 1.0) * range / _val_span);
175 ypoint = ycentre + (cur_value * range / _val_span);
177 xpoint = wth + _marker_offset;
178 draw_line(xpoint, ycentre, xpoint, ypoint);
179 draw_line(xpoint, ypoint, xpoint - _marker_offset, ypoint);
180 draw_line(xpoint - _marker_offset, ypoint, xpoint - 5.0, ypoint + 5.0);
181 draw_line(xpoint - _marker_offset, ypoint, xpoint - 5.0, ypoint - 5.0);
186 fixed(_marker_offset + marker_xe, text_y + _w / 6,
187 _marker_offset + marker_xs, text_y, _marker_offset + marker_xe,
189 } // end pointer type
191 } // end vertical/left
194 // begin vertical/right
195 // First draw capping lines and pointers
196 if (option_right()) {
199 draw_line(_x, _y, _x, marker_ye);
201 marker_xe = _x + _w / 3 - 0.5; // Adjust tick xe
203 // draw_line(_x, mid_scr.y + _w / 6, marker_xe, mid_scr.y);
204 // draw_line(_x, mid_scr.y - _w / 6, marker_xe, mid_scr.y);
208 if (_pointer_type == MOVING) {
210 // type-fixed & _zoom=1, behaviour to be defined
211 // Code for Moving Type Pointer
212 float ycentre, ypoint, xpoint;
215 if (_input.min() >= 0.0)
217 else if (_input.max() + _input.min() == 0.0)
220 ycentre = _y + (1.0 - _input.min()) * _h / (_input.max() - _input.min());
222 ycentre = _y + _input.min() * _h / (_input.max() - _input.min());
227 ypoint = ycentre + ((cur_value - 1.0) * range / _val_span);
229 ypoint = ycentre + (cur_value * range / _val_span);
231 xpoint = _x - _marker_offset;
232 draw_line(xpoint, ycentre, xpoint, ypoint);
233 draw_line(xpoint, ypoint, xpoint + _marker_offset, ypoint);
234 draw_line(xpoint + _marker_offset, ypoint, xpoint + 5.0, ypoint + 5.0);
235 draw_line(xpoint + _marker_offset, ypoint, xpoint + 5.0, ypoint - 5.0);
240 fixed(-_marker_offset + _x, text_y + _w / 6,
241 -_marker_offset + marker_xe, text_y, -_marker_offset + _x,
245 } // end vertical/right
248 // At this point marker x_start and x_end values are transposed.
249 // To keep this from confusing things they are now swapped.
251 marker_ye = marker_xs, marker_xs = marker_xe, marker_xe = marker_ye;
255 // Work through from bottom to top of scale. Calculating where to put
256 // minor and major ticks.
258 // draw scale or tape
260 zoomed_scale((int)vmin, (int)vmax);
263 //#############################################################################
266 if (_minor_divs != 0.0f)
267 div_ratio = int(_major_divs / _minor_divs + 0.5f);
269 div_ratio = 0, _minor_divs = _major_divs; // FIXME move that into Scale/Constructor ?
271 float vstart = floorf(vmin / _major_divs) * _major_divs;
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, width, y);
294 draw_line(_x, y, marker_xs, y);
295 draw_line(marker_xe, y, width, y);
298 } else if (_tick_type == CIRCLE) {
299 draw_bullet(_x, y, 3.0);
302 // if neither line nor circle draw default as line
303 draw_line(_x, y, marker_xs, y);
304 draw_line(marker_xe, y, width, y);
306 // glBegin(GL_LINES);
307 // glVertex2f(_x, y);
308 // glVertex2f(marker_xs, y);
309 // glVertex2f(marker_xe, y);
310 // glVertex2f(_x + _w, y);
312 // anything other than huds_both
316 if (_tick_type == LINE) {
317 if (_tick_length == VARIABLE) {
318 draw_line(marker_xs + 4, y, marker_xe, y);
320 draw_line(marker_xs, y, marker_xe, y);
322 } else if (_tick_type == CIRCLE) {
323 draw_bullet(marker_xs + 4, y, 3.0);
325 draw_line(marker_xs + 4, y, marker_xe, y);
329 if (_tick_type == LINE) {
330 if (_tick_length == VARIABLE) {
331 draw_line(marker_xs, y, marker_xe - 4, y);
333 draw_line(marker_xs, y, marker_xe, y);
336 } else if (_tick_type == CIRCLE) {
337 draw_bullet(marker_xe - 4, y, 3.0);
339 draw_line(marker_xs, y, marker_xe - 4, y);
344 } else { // major div
345 lenstr = snprintf(buf, BUFSIZE, "%d", int(v));
348 // draw_line(_x, y, marker_xs, y);
349 // draw_line(marker_xs, y, _x + _w, y);
350 if (_tick_type == LINE) {
351 glBegin(GL_LINE_STRIP);
353 glVertex2f(marker_xs, y);
354 glVertex2f(width, y);
357 } else if (_tick_type == CIRCLE) {
358 draw_bullet(_x, y, 5.0);
361 glBegin(GL_LINE_STRIP);
363 glVertex2f(marker_xs, y);
364 glVertex2f(width, y);
368 if (!option_notext())
369 draw_text(marker_xs + 2, y, buf, 0);
372 /* Changes are made to draw a circle when tick_type=CIRCLE */
373 // anything other than option_both
374 if (_tick_type == LINE)
375 draw_line(marker_xs, y, marker_xe, y);
376 else if (_tick_type == CIRCLE)
377 draw_bullet(marker_xs + 4, y, 5.0);
379 draw_line(marker_xs, y, marker_xe, y);
381 if (!option_notext()) {
383 draw_text(marker_xs - 8 * lenstr - 2, y - 4, buf, 0);
385 draw_text(marker_xe + 3 * lenstr, y - 4, buf, 0);
387 } // End if huds-both
393 ///////////////////////////////////////////////////////////////////////////////
395 ///////////////////////////////////////////////////////////////////////////////
401 draw_line(_x, _y, _x, height);
404 if (_draw_tick_right)
405 draw_line(width, _y, width, height);
407 marker_ys = _y; // Starting point for
408 marker_ye = height; // tick y location calcs
410 marker_xs = _x + ((cur_value - vmin) * factor());
412 // glBegin(GL_LINES);
414 // glVertex2f(_x, _y);
415 // glVertex2f(_x, marker_ye);
418 // glVertex2f(marker_xe, _y);
419 // glVertex2f(marker_xe, marker_ye);
423 if (_draw_cap_bottom)
424 draw_line(_x, _y, width, _y);
427 marker_ye = _y + _h / 2;
429 // draw_line(mid_scr.x, marker_ye, mid_scr.x - _h / 4, _y);
430 // draw_line(mid_scr.x, marker_ye, mid_scr.x + _h / 4, _y);
433 if (_pointer_type == MOVING) {
435 //Code for Moving Type Pointer
437 float xcentre = mid_scr.x;
439 float xpoint = xcentre + (cur_value * range / _val_span);
440 float ypoint = _y - _marker_offset;
441 draw_line(xcentre, ypoint, xpoint, ypoint);
442 draw_line(xpoint, ypoint, xpoint, ypoint + _marker_offset);
443 draw_line(xpoint, ypoint + _marker_offset, xpoint + 5.0, ypoint + 5.0);
444 draw_line(xpoint, ypoint + _marker_offset, xpoint - 5.0, ypoint + 5.0);
449 fixed(marker_xs - _h / 4, _y, marker_xs,
450 marker_ye, marker_xs + _h / 4, _y);
453 } // End Horizontal scale/top
455 if (option_bottom()) {
457 draw_line(_x, height, width, height);
460 marker_ys = height - _h / 2;
462 // draw_line(mid_scr.x + _h / 4, _y + _h, mid_scr.x, marker_ys);
463 // draw_line(mid_scr.x - _h / 4, _y + _h, mid_scr.x , marker_ys);
467 if (_pointer_type == MOVING) {
469 //Code for Moving Type Pointer
471 float xcentre = mid_scr.x ;
474 float xpoint = xcentre + (cur_value * range / _val_span);
475 float ypoint = hgt + _marker_offset;
476 draw_line(xcentre, ypoint, xpoint, ypoint);
477 draw_line(xpoint, ypoint, xpoint, ypoint - _marker_offset);
478 draw_line(xpoint, ypoint - _marker_offset, xpoint + 5.0, ypoint - 5.0);
479 draw_line(xpoint, ypoint - _marker_offset, xpoint - 5.0, ypoint - 5.0);
482 fixed(marker_xs + _h / 4, height, marker_xs, marker_ys,
483 marker_xs - _h / 4, height);
486 } //end horizontal scale bottom
490 zoomed_scale((int)vmin,(int)vmax);
492 int div_ratio; // FIXME abstract that out of hor/vert
493 if (_minor_divs != 0.0f)
494 div_ratio = int(_major_divs / _minor_divs + 0.5f);
496 div_ratio = 0, _minor_divs = _major_divs; // FIXME move that into Scale/Constructor ?
498 float vstart = floorf(vmin / _major_divs) * _major_divs;
500 // FIXME consider oddtype
501 for (int i = 0; ; i++) {
502 float v = vstart + i * _minor_divs;
504 if (!modulo() && (v < _input.min() || v > _input.max()))
507 float x = _x + (v - vmin) * factor();
514 if (div_ratio && i % div_ratio) { // minor div
516 if (_tick_length == VARIABLE) {
517 draw_line(x, _y, x, marker_ys - 4);
518 draw_line(x, marker_ye + 4, x, height);
520 draw_line(x, _y, x, marker_ys);
521 draw_line(x, marker_ye, x, height);
523 // glBegin(GL_LINES);
524 // glVertex2f(x, _y);
525 // glVertex2f(x, marker_ys - 4);
526 // glVertex2f(x, marker_ye + 4);
527 // glVertex2f(x, _y + _h);
533 if (_tick_length == VARIABLE)
534 draw_line(x, marker_ys, x, marker_ye - 4);
536 draw_line(x, marker_ys, x, marker_ye);
538 } else if (_tick_length == VARIABLE) {
539 draw_line(x, marker_ys + 4, x, marker_ye);
541 draw_line(x, marker_ys, x, marker_ye);
545 } else { // major divs
546 lenstr = snprintf(buf, BUFSIZE, "%d", int(v));
548 // Draw major ticks and text only if far enough from the edge. // FIXME
549 if (x < _x + 10 || x + 10 > _x + _w)
555 // draw_line(x, marker_ye,
557 glBegin(GL_LINE_STRIP);
559 glVertex2f(x, marker_ye);
560 glVertex2f(x, height);
563 if (!option_notext())
564 draw_text(x - 4 * lenstr, marker_ys + 4, buf, 0);
567 draw_line(x, marker_ys, x, marker_ye);
569 if (!option_notext()) {
571 draw_text(x - 4 * lenstr, height - 10, buf, 0);
573 draw_text(x - 4 * lenstr, _y, buf, 0);
579 } // end horizontal/vertical scale
584 void HUD::Tape::fixed(float x1, float y1, float x2, float y2, float x3, float y3)
586 glBegin(GL_LINE_STRIP);
594 void HUD::Tape::zoomed_scale(int first, int last)
596 Point mid_scr = get_centroid();
597 const int BUFSIZE = 80;
601 float x, y, w, h, bottom;
602 float cur_value = _input.getFloatValue();
605 while (first <= last) {
606 if ((first % (int)_major_divs) == 0) {
621 float xstart, yfirst, ycentre, ysecond;
623 float hgt = bottom * 20.0 / 100.0; // 60% of height should be zoomed
624 yfirst = mid_scr.y - hgt;
626 ysecond = mid_scr.y + hgt;
627 float range = hgt * 2;
630 float factor = range / 10.0;
632 float hgt1 = bottom * 30.0 / 100.0;
633 int incrs = ((int)_val_span - (_major_divs * 2)) / _major_divs ; // FIXME wtf?
634 int incr = incrs / 2;
635 float factors = hgt1 / incr;
638 //this is for moving type pointer
639 static float ycent, ypoint, xpoint; // FIXME really static?
645 if (cur_value <= data[centre + 1])
646 if (cur_value > data[centre]) {
647 ypoint = ycent + ((cur_value - data[centre]) * hgt / _major_divs);
650 if (cur_value >= data[centre - 1])
651 if (cur_value <= data[centre]) {
652 ypoint = ycent - ((data[centre] - cur_value) * hgt / _major_divs);
655 if (cur_value < data[centre - 1])
656 if (cur_value >= _input.min()) {
657 float diff = _input.min() - data[centre - 1];
658 float diff1 = cur_value - data[centre - 1];
659 float val = (diff1 * hgt1) / diff;
661 ypoint = ycent - hgt - val;
664 if (cur_value > data[centre + 1])
665 if (cur_value <= _input.max()) {
666 float diff = _input.max() - data[centre + 1];
667 float diff1 = cur_value - data[centre + 1];
668 float val = (diff1 * hgt1) / diff;
670 ypoint = ycent + hgt + val;
676 draw_line(xstart, ycentre, xstart - 5.0, ycentre); //centre tick
678 snprintf(buf, BUFSIZE, "%3.0f\n", float(data[centre] * _input.factor())); // was data_scaling() ... makes not sense at all
680 if (!option_notext())
681 draw_text(x, ycentre, buf, 0);
683 for (i = 1; i < 5; i++) {
686 draw_bullet(xstart - 2.5, yfirst, 3.0);
687 draw_bullet(xstart - 2.5, ycentre, 3.0);
690 yfirst = mid_scr.y - hgt;
692 for (i = 0; i <= incr; i++) {
693 draw_line(xstart, yfirst, xstart - 5.0, yfirst);
694 draw_line(xstart, ysecond, xstart - 5.0, ysecond);
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, yfirst, buf, 0);
701 snprintf(buf, BUFSIZE, "%3.0f\n", float(data[centre + i + 1] * _input.factor())); // was data_scaling() ... makes no sense at all
703 if (!option_notext())
704 draw_text(x, ysecond, buf, 0);
711 //to draw moving type pointer for left option
715 if (_pointer_type == MOVING) {
716 draw_line(xpoint, ycent, xpoint, ypoint);
717 draw_line(xpoint, ypoint, xpoint - 10.0, ypoint);
718 draw_line(xpoint - 10.0, ypoint, xpoint - 5.0, ypoint + 5.0);
719 draw_line(xpoint - 10.0, ypoint, xpoint - 5.0, ypoint - 5.0);
725 xstart = (x + w) / 2;
727 draw_line(xstart, ycentre, xstart + 5.0, ycentre); //centre tick
729 snprintf(buf, BUFSIZE, "%3.0f\n", float(data[centre] * _input.factor())); // was data_scaling() ... makes no sense at all
731 if (!option_notext())
732 draw_text(w, ycentre, buf, 0);
734 for (i = 1; i < 5; i++) {
737 draw_bullet(xstart + 2.5, yfirst, 3.0);
738 draw_bullet(xstart + 2.5, ycentre, 3.0);
741 yfirst = mid_scr.y - hgt;
743 for (i = 0; i <= incr; i++) {
744 draw_line(xstart, yfirst, xstart + 5.0, yfirst);
745 draw_line(xstart, ysecond, xstart + 5.0, ysecond);
747 snprintf(buf, BUFSIZE, "%3.0f\n", float(data[centre - i - 1] * _input.factor())); // was data_scaling() ... makes no sense at all
749 if (!option_notext())
750 draw_text(w, yfirst, buf, 0);
752 snprintf(buf, BUFSIZE, "%3.0f\n", float(data[centre + i + 1] * _input.factor()));
754 if (!option_notext())
755 draw_text(w, ysecond, buf, 0);
762 // to draw moving type pointer for right option
766 if (_pointer_type == MOVING) {
767 draw_line(xpoint, ycent, xpoint, ypoint);
768 draw_line(xpoint, ypoint, xpoint + 10.0, ypoint);
769 draw_line(xpoint + 10.0, ypoint, xpoint + 5.0, ypoint + 5.0);
770 draw_line(xpoint + 10.0, ypoint, xpoint + 5.0, ypoint - 5.0);
773 }//end option_right /left
774 //end of vertical scale
784 float ystart, xfirst, xcentre, xsecond;
786 float hgt = bottom * 20.0 / 100.0; // 60% of height should be zoomed
787 xfirst = mid_scr.x - hgt;
789 xsecond = mid_scr.x + hgt;
790 float range = hgt * 2;
793 float factor = range / 10.0;
795 float hgt1 = bottom * 30.0 / 100.0;
796 int incrs = ((int)_val_span - (_major_divs * 2)) / _major_divs ;
797 int incr = incrs / 2;
798 float factors = hgt1 / incr;
801 //Code for Moving Type Pointer
803 static float xcent, xpoint, ypoint; // FIXME really static?
807 if (cur_value <= data[centre + 1])
808 if (cur_value > data[centre]) {
809 xpoint = xcent + ((cur_value - data[centre]) * hgt / _major_divs);
812 if (cur_value >= data[centre - 1])
813 if (cur_value <= data[centre]) {
814 xpoint = xcent - ((data[centre] - cur_value) * hgt / _major_divs);
817 if (cur_value < data[centre - 1])
818 if (cur_value >= _input.min()) {
819 float diff = _input.min() - data[centre - 1];
820 float diff1 = cur_value - data[centre - 1];
821 float val = (diff1 * hgt1) / diff;
823 xpoint = xcent - hgt - val;
827 if (cur_value > data[centre + 1])
828 if (cur_value <= _input.max()) {
829 float diff = _input.max() - data[centre + 1];
830 float diff1 = cur_value - data[centre + 1];
831 float val = (diff1 * hgt1) / diff;
833 xpoint = xcent + hgt + val;
839 draw_line(xcentre, ystart, xcentre, ystart - 5.0); //centre tick
841 snprintf(buf, BUFSIZE, "%3.0f\n", float(data[centre] * _input.factor())); // was data_scaling() ... makes no sense at all
843 if (!option_notext())
844 draw_text(xcentre - 10.0, y, buf, 0);
846 for (i = 1; i < 5; i++) {
849 draw_bullet(xfirst, ystart - 2.5, 3.0);
850 draw_bullet(xcentre, ystart - 2.5, 3.0);
853 xfirst = mid_scr.x - hgt;
855 for (i = 0; i <= incr; i++) {
856 draw_line(xfirst, ystart, xfirst, ystart - 5.0);
857 draw_line(xsecond, ystart, xsecond, ystart - 5.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(xfirst - 10.0, y, buf, 0);
864 snprintf(buf, BUFSIZE, "%3.0f\n", float(data[centre + i + 1] * _input.factor())); // was data_scaling() ... makes no sense at all
866 if (!option_notext())
867 draw_text(xsecond - 10.0, y, buf, 0);
873 //this is for moving pointer for top option
876 ypoint = _y + _h + 10.0;
878 if (_pointer_type == MOVING) {
879 draw_line(xcent, ypoint, xpoint, ypoint);
880 draw_line(xpoint, ypoint, xpoint, ypoint - 10.0);
881 draw_line(xpoint, ypoint - 10.0, xpoint + 5.0, ypoint - 5.0);
882 draw_line(xpoint, ypoint - 10.0, xpoint - 5.0, ypoint - 5.0);
888 ystart = (y + h) / 2;
890 //draw_line(xstart, yfirst, xstart - 5.0, yfirst);
891 draw_line(xcentre, ystart, xcentre, ystart + 5.0); //centre tick
893 snprintf(buf, BUFSIZE, "%3.0f\n", float(data[centre] * _input.factor())); // was data_scaling() ... makes no sense at all
895 if (!option_notext())
896 draw_text(xcentre - 10.0, h, buf, 0);
898 for (i = 1; i < 5; i++) {
901 draw_bullet(xfirst, ystart + 2.5, 3.0);
902 draw_bullet(xcentre, ystart + 2.5, 3.0);
905 xfirst = mid_scr.x - hgt;
907 for (i = 0; i <= incr; i++) {
908 draw_line(xfirst, ystart, xfirst, ystart + 5.0);
909 draw_line(xsecond, ystart, xsecond, ystart + 5.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(xfirst - 10.0, h, buf, 0);
916 snprintf(buf, BUFSIZE, "%3.0f\n", float(data[centre + i + 1] * _input.factor())); // was data_scaling() ... makes no sense at all
918 if (!option_notext())
919 draw_text(xsecond - 10.0, h, buf, 0);
924 //this is for movimg pointer for bottom option
928 if (_pointer_type == MOVING) {
929 draw_line(xcent, ypoint, xpoint, ypoint);
930 draw_line(xpoint, ypoint, xpoint, ypoint + 10.0);
931 draw_line(xpoint, ypoint + 10.0, xpoint + 5.0, ypoint + 5.0);
932 draw_line(xpoint, ypoint + 10.0, xpoint - 5.0, ypoint + 5.0);
934 }//end hud_top or hud_bottom
935 } //end of horizontal/vertical scales