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 int display_value = int(v);
347 display_value %= _modulo;
349 lenstr = snprintf(buf, BUFSIZE, "%d", display_value);
352 // draw_line(_x, y, marker_xs, y);
353 // draw_line(marker_xs, y, _x + _w, y);
354 if (_tick_type == LINE) {
355 glBegin(GL_LINE_STRIP);
357 glVertex2f(marker_xs, y);
358 glVertex2f(width, y);
361 } else if (_tick_type == CIRCLE) {
362 draw_bullet(_x, y, 5.0);
365 glBegin(GL_LINE_STRIP);
367 glVertex2f(marker_xs, y);
368 glVertex2f(width, y);
372 if (!option_notext())
373 draw_text(marker_xs + 2, y, buf, 0);
376 /* Changes are made to draw a circle when tick_type=CIRCLE */
377 // anything other than option_both
378 if (_tick_type == LINE)
379 draw_line(marker_xs, y, marker_xe, y);
380 else if (_tick_type == CIRCLE)
381 draw_bullet(marker_xs + 4, y, 5.0);
383 draw_line(marker_xs, y, marker_xe, y);
385 if (!option_notext()) {
387 draw_text(marker_xs - 8 * lenstr - 2, y - 4, buf, 0);
389 draw_text(marker_xe + 3 * lenstr, y - 4, buf, 0);
391 } // End if huds-both
397 ///////////////////////////////////////////////////////////////////////////////
399 ///////////////////////////////////////////////////////////////////////////////
405 draw_line(_x, _y, _x, height);
408 if (_draw_tick_right)
409 draw_line(width, _y, width, height);
411 marker_ys = _y; // Starting point for
412 marker_ye = height; // tick y location calcs
414 marker_xs = _x + ((cur_value - vmin) * factor());
416 // glBegin(GL_LINES);
418 // glVertex2f(_x, _y);
419 // glVertex2f(_x, marker_ye);
422 // glVertex2f(marker_xe, _y);
423 // glVertex2f(marker_xe, marker_ye);
427 if (_draw_cap_bottom)
428 draw_line(_x, _y, width, _y);
431 marker_ye = _y + _h / 2;
433 // draw_line(mid_scr.x, marker_ye, mid_scr.x - _h / 4, _y);
434 // draw_line(mid_scr.x, marker_ye, mid_scr.x + _h / 4, _y);
437 if (_pointer_type == MOVING) {
439 //Code for Moving Type Pointer
441 float xcentre = mid_scr.x;
443 float xpoint = xcentre + (cur_value * range / _val_span);
444 float ypoint = _y - _marker_offset;
445 draw_line(xcentre, ypoint, xpoint, ypoint);
446 draw_line(xpoint, ypoint, xpoint, ypoint + _marker_offset);
447 draw_line(xpoint, ypoint + _marker_offset, xpoint + 5.0, ypoint + 5.0);
448 draw_line(xpoint, ypoint + _marker_offset, xpoint - 5.0, ypoint + 5.0);
453 fixed(marker_xs - _h / 4, _y, marker_xs,
454 marker_ye, marker_xs + _h / 4, _y);
457 } // End Horizontal scale/top
459 if (option_bottom()) {
461 draw_line(_x, height, width, height);
464 marker_ys = height - _h / 2;
466 // draw_line(mid_scr.x + _h / 4, _y + _h, mid_scr.x, marker_ys);
467 // draw_line(mid_scr.x - _h / 4, _y + _h, mid_scr.x , marker_ys);
471 if (_pointer_type == MOVING) {
473 //Code for Moving Type Pointer
475 float xcentre = mid_scr.x ;
478 float xpoint = xcentre + (cur_value * range / _val_span);
479 float ypoint = hgt + _marker_offset;
480 draw_line(xcentre, ypoint, xpoint, ypoint);
481 draw_line(xpoint, ypoint, xpoint, ypoint - _marker_offset);
482 draw_line(xpoint, ypoint - _marker_offset, xpoint + 5.0, ypoint - 5.0);
483 draw_line(xpoint, ypoint - _marker_offset, xpoint - 5.0, ypoint - 5.0);
486 fixed(marker_xs + _h / 4, height, marker_xs, marker_ys,
487 marker_xs - _h / 4, height);
490 } //end horizontal scale bottom
494 zoomed_scale((int)vmin,(int)vmax);
496 int div_ratio; // FIXME abstract that out of hor/vert
497 if (_minor_divs != 0.0f)
498 div_ratio = int(_major_divs / _minor_divs + 0.5f);
500 div_ratio = 0, _minor_divs = _major_divs; // FIXME move that into Scale/Constructor ?
502 float vstart = floorf(vmin / _major_divs) * _major_divs;
504 // FIXME consider oddtype
505 for (int i = 0; ; i++) {
506 float v = vstart + i * _minor_divs;
508 if (!_modulo && (v < _input.min() || v > _input.max()))
511 float x = _x + (v - vmin) * factor();
518 if (div_ratio && i % div_ratio) { // minor div
520 if (_tick_length == VARIABLE) {
521 draw_line(x, _y, x, marker_ys - 4);
522 draw_line(x, marker_ye + 4, x, height);
524 draw_line(x, _y, x, marker_ys);
525 draw_line(x, marker_ye, x, height);
527 // glBegin(GL_LINES);
528 // glVertex2f(x, _y);
529 // glVertex2f(x, marker_ys - 4);
530 // glVertex2f(x, marker_ye + 4);
531 // glVertex2f(x, _y + _h);
537 if (_tick_length == VARIABLE)
538 draw_line(x, marker_ys, x, marker_ye - 4);
540 draw_line(x, marker_ys, x, marker_ye);
542 } else if (_tick_length == VARIABLE) {
543 draw_line(x, marker_ys + 4, x, marker_ye);
545 draw_line(x, marker_ys, x, marker_ye);
549 } else { // major divs
550 int display_value = int(v);
552 display_value %= _modulo;
554 lenstr = snprintf(buf, BUFSIZE, "%d", display_value);
556 // Draw major ticks and text only if far enough from the edge. // FIXME
557 if (x < _x + 10 || x + 10 > _x + _w)
563 // draw_line(x, marker_ye,
565 glBegin(GL_LINE_STRIP);
567 glVertex2f(x, marker_ye);
568 glVertex2f(x, height);
571 if (!option_notext())
572 draw_text(x - 4 * lenstr, marker_ys + 4, buf, 0);
575 draw_line(x, marker_ys, x, marker_ye);
577 if (!option_notext()) {
579 draw_text(x - 4 * lenstr, height - 10, buf, 0);
581 draw_text(x - 4 * lenstr, _y, buf, 0);
587 } // end horizontal/vertical scale
592 void HUD::Tape::fixed(float x1, float y1, float x2, float y2, float x3, float y3)
594 glBegin(GL_LINE_STRIP);
602 void HUD::Tape::zoomed_scale(int first, int last)
604 Point mid_scr = get_centroid();
605 const int BUFSIZE = 80;
609 float x, y, w, h, bottom;
610 float cur_value = _input.getFloatValue();
613 while (first <= last) {
614 if ((first % (int)_major_divs) == 0) {
629 float xstart, yfirst, ycentre, ysecond;
631 float hgt = bottom * 20.0 / 100.0; // 60% of height should be zoomed
632 yfirst = mid_scr.y - hgt;
634 ysecond = mid_scr.y + hgt;
635 float range = hgt * 2;
638 float factor = range / 10.0;
640 float hgt1 = bottom * 30.0 / 100.0;
641 int incrs = int((_val_span - _major_divs * 2.0) / _major_divs);
642 int incr = incrs / 2;
643 float factors = hgt1 / incr;
646 //this is for moving type pointer
647 static float ycent, ypoint, xpoint; // FIXME really static?
653 if (cur_value <= data[centre + 1])
654 if (cur_value > data[centre]) {
655 ypoint = ycent + ((cur_value - data[centre]) * hgt / _major_divs);
658 if (cur_value >= data[centre - 1])
659 if (cur_value <= data[centre]) {
660 ypoint = ycent - ((data[centre] - cur_value) * hgt / _major_divs);
663 if (cur_value < data[centre - 1])
664 if (cur_value >= _input.min()) {
665 float diff = _input.min() - data[centre - 1];
666 float diff1 = cur_value - data[centre - 1];
667 float val = (diff1 * hgt1) / diff;
669 ypoint = ycent - hgt - val;
672 if (cur_value > data[centre + 1])
673 if (cur_value <= _input.max()) {
674 float diff = _input.max() - data[centre + 1];
675 float diff1 = cur_value - data[centre + 1];
676 float val = (diff1 * hgt1) / diff;
678 ypoint = ycent + hgt + val;
684 draw_line(xstart, ycentre, xstart - 5.0, ycentre); //centre tick
686 snprintf(buf, BUFSIZE, "%3.0f\n", float(data[centre] * _input.factor())); // was data_scaling() ... makes not sense at all
688 if (!option_notext())
689 draw_text(x, ycentre, buf, 0);
691 for (i = 1; i < 5; i++) {
694 draw_bullet(xstart - 2.5, yfirst, 3.0);
695 draw_bullet(xstart - 2.5, ycentre, 3.0);
698 yfirst = mid_scr.y - hgt;
700 for (i = 0; i <= incr; i++) {
701 draw_line(xstart, yfirst, xstart - 5.0, yfirst);
702 draw_line(xstart, ysecond, xstart - 5.0, ysecond);
704 snprintf(buf, BUFSIZE, "%3.0f\n", float(data[centre - i - 1] * _input.factor())); // was data_scaling() ... makes no sense at all
706 if (!option_notext())
707 draw_text(x, yfirst, buf, 0);
709 snprintf(buf, BUFSIZE, "%3.0f\n", float(data[centre + i + 1] * _input.factor())); // was data_scaling() ... makes no sense at all
711 if (!option_notext())
712 draw_text(x, ysecond, buf, 0);
719 //to draw moving type pointer for left option
723 if (_pointer_type == MOVING) {
724 draw_line(xpoint, ycent, xpoint, ypoint);
725 draw_line(xpoint, ypoint, xpoint - 10.0, ypoint);
726 draw_line(xpoint - 10.0, ypoint, xpoint - 5.0, ypoint + 5.0);
727 draw_line(xpoint - 10.0, ypoint, xpoint - 5.0, ypoint - 5.0);
733 xstart = (x + w) / 2;
735 draw_line(xstart, ycentre, xstart + 5.0, ycentre); //centre tick
737 snprintf(buf, BUFSIZE, "%3.0f\n", float(data[centre] * _input.factor())); // was data_scaling() ... makes no sense at all
739 if (!option_notext())
740 draw_text(w, ycentre, buf, 0);
742 for (i = 1; i < 5; i++) {
745 draw_bullet(xstart + 2.5, yfirst, 3.0);
746 draw_bullet(xstart + 2.5, ycentre, 3.0);
749 yfirst = mid_scr.y - hgt;
751 for (i = 0; i <= incr; i++) {
752 draw_line(xstart, yfirst, xstart + 5.0, yfirst);
753 draw_line(xstart, ysecond, xstart + 5.0, ysecond);
755 snprintf(buf, BUFSIZE, "%3.0f\n", float(data[centre - i - 1] * _input.factor())); // was data_scaling() ... makes no sense at all
757 if (!option_notext())
758 draw_text(w, yfirst, buf, 0);
760 snprintf(buf, BUFSIZE, "%3.0f\n", float(data[centre + i + 1] * _input.factor()));
762 if (!option_notext())
763 draw_text(w, ysecond, buf, 0);
770 // to draw moving type pointer for right option
774 if (_pointer_type == MOVING) {
775 draw_line(xpoint, ycent, xpoint, ypoint);
776 draw_line(xpoint, ypoint, xpoint + 10.0, ypoint);
777 draw_line(xpoint + 10.0, ypoint, xpoint + 5.0, ypoint + 5.0);
778 draw_line(xpoint + 10.0, ypoint, xpoint + 5.0, ypoint - 5.0);
781 }//end option_right /left
782 //end of vertical scale
792 float ystart, xfirst, xcentre, xsecond;
794 float hgt = bottom * 20.0 / 100.0; // 60% of height should be zoomed
795 xfirst = mid_scr.x - hgt;
797 xsecond = mid_scr.x + hgt;
798 float range = hgt * 2;
801 float factor = range / 10.0;
803 float hgt1 = bottom * 30.0 / 100.0;
804 int incrs = int((_val_span - _major_divs * 2.0) / _major_divs);
805 int incr = incrs / 2;
806 float factors = hgt1 / incr;
809 //Code for Moving Type Pointer
811 static float xcent, xpoint, ypoint; // FIXME really static?
815 if (cur_value <= data[centre + 1])
816 if (cur_value > data[centre]) {
817 xpoint = xcent + ((cur_value - data[centre]) * hgt / _major_divs);
820 if (cur_value >= data[centre - 1])
821 if (cur_value <= data[centre]) {
822 xpoint = xcent - ((data[centre] - cur_value) * hgt / _major_divs);
825 if (cur_value < data[centre - 1])
826 if (cur_value >= _input.min()) {
827 float diff = _input.min() - data[centre - 1];
828 float diff1 = cur_value - data[centre - 1];
829 float val = (diff1 * hgt1) / diff;
831 xpoint = xcent - hgt - val;
835 if (cur_value > data[centre + 1])
836 if (cur_value <= _input.max()) {
837 float diff = _input.max() - data[centre + 1];
838 float diff1 = cur_value - data[centre + 1];
839 float val = (diff1 * hgt1) / diff;
841 xpoint = xcent + hgt + val;
847 draw_line(xcentre, ystart, xcentre, ystart - 5.0); //centre tick
849 snprintf(buf, BUFSIZE, "%3.0f\n", float(data[centre] * _input.factor())); // was data_scaling() ... makes no sense at all
851 if (!option_notext())
852 draw_text(xcentre - 10.0, y, buf, 0);
854 for (i = 1; i < 5; i++) {
857 draw_bullet(xfirst, ystart - 2.5, 3.0);
858 draw_bullet(xcentre, ystart - 2.5, 3.0);
861 xfirst = mid_scr.x - hgt;
863 for (i = 0; i <= incr; i++) {
864 draw_line(xfirst, ystart, xfirst, ystart - 5.0);
865 draw_line(xsecond, ystart, xsecond, ystart - 5.0);
867 snprintf(buf, BUFSIZE, "%3.0f\n", float(data[centre - i - 1] * _input.factor())); // was data_scaling() ... makes no sense at all
869 if (!option_notext())
870 draw_text(xfirst - 10.0, y, buf, 0);
872 snprintf(buf, BUFSIZE, "%3.0f\n", float(data[centre + i + 1] * _input.factor())); // was data_scaling() ... makes no sense at all
874 if (!option_notext())
875 draw_text(xsecond - 10.0, y, buf, 0);
881 //this is for moving pointer for top option
884 ypoint = _y + _h + 10.0;
886 if (_pointer_type == MOVING) {
887 draw_line(xcent, ypoint, xpoint, ypoint);
888 draw_line(xpoint, ypoint, xpoint, ypoint - 10.0);
889 draw_line(xpoint, ypoint - 10.0, xpoint + 5.0, ypoint - 5.0);
890 draw_line(xpoint, ypoint - 10.0, xpoint - 5.0, ypoint - 5.0);
896 ystart = (y + h) / 2;
898 //draw_line(xstart, yfirst, xstart - 5.0, yfirst);
899 draw_line(xcentre, ystart, xcentre, ystart + 5.0); //centre tick
901 snprintf(buf, BUFSIZE, "%3.0f\n", float(data[centre] * _input.factor())); // was data_scaling() ... makes no sense at all
903 if (!option_notext())
904 draw_text(xcentre - 10.0, h, buf, 0);
906 for (i = 1; i < 5; i++) {
909 draw_bullet(xfirst, ystart + 2.5, 3.0);
910 draw_bullet(xcentre, ystart + 2.5, 3.0);
913 xfirst = mid_scr.x - hgt;
915 for (i = 0; i <= incr; i++) {
916 draw_line(xfirst, ystart, xfirst, ystart + 5.0);
917 draw_line(xsecond, ystart, xsecond, ystart + 5.0);
919 snprintf(buf, BUFSIZE, "%3.0f\n", float(data[centre - i - 1] * _input.factor())); // was data_scaling() ... makes no sense at all
921 if (!option_notext())
922 draw_text(xfirst - 10.0, h, buf, 0);
924 snprintf(buf, BUFSIZE, "%3.0f\n", float(data[centre + i + 1] * _input.factor())); // was data_scaling() ... makes no sense at all
926 if (!option_notext())
927 draw_text(xsecond - 10.0, h, buf, 0);
932 //this is for movimg pointer for bottom option
936 if (_pointer_type == MOVING) {
937 draw_line(xcent, ypoint, xpoint, ypoint);
938 draw_line(xpoint, ypoint, xpoint, ypoint + 10.0);
939 draw_line(xpoint, ypoint + 10.0, xpoint + 5.0, ypoint + 5.0);
940 draw_line(xpoint, ypoint + 10.0, xpoint - 5.0, ypoint + 5.0);
942 }//end hud_top or hud_bottom
943 } //end of horizontal/vertical scales