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;
52 _hud->_font->getBBox("0", _hud->_font_size, 0.0, 0, 0, 0, &top);
56 void HUD::Tape::draw(void) // (HUD_scale * pscale)
58 if (!_input.isValid())
61 float vmin = 0.0, vmax = 0.0;
66 float text_x = 0.0, text_y = 0.0;
67 const int BUFSIZE = 80;
70 // int k; //odd or even values for ticks // FIXME odd scale
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
80 float right = _x + _w;
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, right, _y);
116 draw_line(_x, top, right, top);
118 marker_xs = _x; // x start
119 marker_xe = right; // 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;
147 // draw_line(marker_xs, _center_y, marker_xe, _center_y + _w / 6);
148 // draw_line(marker_xs, _center_y, marker_xe, _center_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;
203 // draw_line(_x, _center_y + _w / 6, marker_xe, _center_y);
204 // draw_line(_x, _center_y - _w / 6, marker_xe, _center_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);
264 if (_minor_divs != 0.0f)
265 div_ratio = int(_major_divs / _minor_divs + 0.5f);
267 div_ratio = 0, _minor_divs = _major_divs; // FIXME move that into Scale/Constructor ?
269 float vstart = floorf(vmin / _major_divs) * _major_divs;
270 float min_diff = _w / 6.0; // length difference between major & minor tick
272 // FIXME consider oddtype
273 for (int i = 0; ; i++) {
274 float v = vstart + i * _minor_divs;
277 if (v < _input.min())
279 else if (v > _input.max())
282 float y = _y + (v - vmin) * factor();
289 if (div_ratio && i % div_ratio) { // minor div
291 if (_tick_type == LINE) {
292 if (_tick_length == VARIABLE) {
293 draw_line(_x, y, marker_xs, y);
294 draw_line(marker_xe, y, right, y);
296 draw_line(_x, y, marker_xs, y);
297 draw_line(marker_xe, y, right, y);
300 } else { // _tick_type == CIRCLE
301 draw_bullet(_x, y, 3.0);
304 // glBegin(GL_LINES);
305 // glVertex2f(_x, y);
306 // glVertex2f(marker_xs, y);
307 // glVertex2f(marker_xe, y);
308 // glVertex2f(_x + _w, y);
310 // anything other than huds_both
312 } else if (option_left()) {
313 if (_tick_type == LINE) {
314 if (_tick_length == VARIABLE) {
315 draw_line(marker_xs + min_diff, y, marker_xe, y);
317 draw_line(marker_xs, y, marker_xe, y);
319 } else { // _tick_type == CIRCLE
320 draw_bullet(marker_xs + 4, y, 3.0);
323 } else { // if (option_right())
324 if (_tick_type == LINE) {
325 if (_tick_length == VARIABLE) {
326 draw_line(marker_xs, y, marker_xe - min_diff, y);
328 draw_line(marker_xs, y, marker_xe, y);
331 } else { // _tick_type == CIRCLE
332 draw_bullet(marker_xe - 4, y, 3.0);
336 } else { // major div
337 int display_value = int(v);
339 display_value %= _modulo;
341 snprintf(buf, BUFSIZE, "%d", display_value);
344 // draw_line(_x, y, marker_xs, y);
345 // draw_line(marker_xs, y, _x + _w, y);
346 if (_tick_type == LINE) {
347 glBegin(GL_LINE_STRIP);
349 glVertex2f(marker_xs, y);
350 glVertex2f(right, y);
353 } else { // _tick_type == CIRCLE
354 draw_bullet(_x, y, 5.0);
357 if (!option_notext())
358 draw_text(marker_xs, y, buf, HUDText::CENTER);
361 if (_tick_type == LINE)
362 draw_line(marker_xs, y, marker_xe, y);
363 else // _tick_type == CIRCLE
364 draw_bullet(marker_xs + 4, y, 5.0);
366 if (!option_notext()) {
368 draw_text(marker_xs, y, buf, HUDText::RIGHT|HUDText::VCENTER);
370 draw_text(marker_xe + 1.0, y, buf, HUDText::LEFT|HUDText::VCENTER);
372 } // End if huds-both
378 ///////////////////////////////////////////////////////////////////////////////
380 ///////////////////////////////////////////////////////////////////////////////
386 draw_line(_x, _y, _x, top);
389 if (_draw_tick_right)
390 draw_line(right, _y, right, top);
392 marker_ys = _y; // Starting point for
393 marker_ye = top; // tick y location calcs
395 marker_xs = _x + ((cur_value - vmin) * factor());
397 // glBegin(GL_LINES);
399 // glVertex2f(_x, _y);
400 // glVertex2f(_x, marker_ye);
403 // glVertex2f(marker_xe, _y);
404 // glVertex2f(marker_xe, marker_ye);
408 if (_draw_cap_bottom)
409 draw_line(_x, _y, right, _y);
412 marker_ye = _y + _h / 2;
414 // draw_line(_center_x, marker_ye, _center_x - _h / 4, _y);
415 // draw_line(_center_x, marker_ye, _center_x + _h / 4, _y);
418 if (_pointer_type == MOVING) {
420 //Code for Moving Type Pointer
422 float xcentre = _center_x;
424 float xpoint = xcentre + (cur_value * range / _val_span);
425 float ypoint = _y - _marker_offset;
426 draw_line(xcentre, ypoint, xpoint, ypoint);
427 draw_line(xpoint, ypoint, xpoint, ypoint + _marker_offset);
428 draw_line(xpoint, ypoint + _marker_offset, xpoint + 5.0, ypoint + 5.0);
429 draw_line(xpoint, ypoint + _marker_offset, xpoint - 5.0, ypoint + 5.0);
434 fixed(marker_xs - _h / 4, _y, marker_xs,
435 marker_ye, marker_xs + _h / 4, _y);
438 } // End Horizontal scale/top
440 if (option_bottom()) {
442 draw_line(_x, top, right, top);
445 marker_ys = top - _h / 2;
447 // draw_line(_center_x + _h / 4, _y + _h, _center_x, marker_ys);
448 // draw_line(_center_x - _h / 4, _y + _h, _center_x , marker_ys);
452 if (_pointer_type == MOVING) {
454 //Code for Moving Type Pointer
456 float xcentre = _center_x;
459 float xpoint = xcentre + (cur_value * range / _val_span);
460 float ypoint = hgt + _marker_offset;
461 draw_line(xcentre, ypoint, xpoint, ypoint);
462 draw_line(xpoint, ypoint, xpoint, ypoint - _marker_offset);
463 draw_line(xpoint, ypoint - _marker_offset, xpoint + 5.0, ypoint - 5.0);
464 draw_line(xpoint, ypoint - _marker_offset, xpoint - 5.0, ypoint - 5.0);
467 fixed(marker_xs + _h / 4, top, marker_xs, marker_ys,
468 marker_xs - _h / 4, top);
471 } //end horizontal scale bottom
475 zoomed_scale((int)vmin,(int)vmax);
477 int div_ratio; // FIXME abstract that out of hor/vert
478 if (_minor_divs != 0.0f)
479 div_ratio = int(_major_divs / _minor_divs + 0.5f);
481 div_ratio = 0, _minor_divs = _major_divs; // FIXME move that into Scale/Constructor ?
483 float vstart = floorf(vmin / _major_divs) * _major_divs;
484 float min_diff = _h / 6.0; // length difference between major & minor tick
486 // FIXME consider oddtype
487 for (int i = 0; ; i++) {
488 float v = vstart + i * _minor_divs;
491 if (v < _input.min())
493 else if (v > _input.max())
496 float x = _x + (v - vmin) * factor();
503 if (div_ratio && i % div_ratio) { // minor div
505 if (_tick_length == VARIABLE) {
506 draw_line(x, _y, x, marker_ys - 4);
507 draw_line(x, marker_ye + 4, x, top);
509 draw_line(x, _y, x, marker_ys);
510 draw_line(x, marker_ye, x, top);
512 // glBegin(GL_LINES);
513 // glVertex2f(x, _y);
514 // glVertex2f(x, marker_ys - 4);
515 // glVertex2f(x, marker_ye + 4);
516 // glVertex2f(x, _y + _h);
522 if (_tick_length == VARIABLE)
523 draw_line(x, marker_ys, x, marker_ye - min_diff);
525 draw_line(x, marker_ys, x, marker_ye);
527 } else if (_tick_length == VARIABLE) {
528 draw_line(x, marker_ys + 4, x, marker_ye);
530 draw_line(x, marker_ys, x, marker_ye);
534 } else { // major divs
535 int display_value = int(v);
537 display_value %= _modulo;
539 snprintf(buf, BUFSIZE, "%d", display_value);
541 // Draw major ticks and text only if far enough from the edge. // FIXME
542 if (x < _x + 10 || x + 10 > _x + _w)
548 // draw_line(x, marker_ye,
550 glBegin(GL_LINE_STRIP);
552 glVertex2f(x, marker_ye);
556 if (!option_notext())
557 draw_text(x, marker_ys, buf, HUDText::CENTER);
560 draw_line(x, marker_ys, x, marker_ye);
562 if (!option_notext()) {
564 draw_text(x, top, buf, HUDText::TOP|HUDText::HCENTER);
566 draw_text(x, _y, buf, HUDText::BOTTOM|HUDText::HCENTER);
572 } // end horizontal/vertical scale
577 void HUD::Tape::fixed(float x1, float y1, float x2, float y2, float x3, float y3)
579 glBegin(GL_LINE_STRIP);
587 void HUD::Tape::zoomed_scale(int first, int last)
589 const int BUFSIZE = 80;
593 float x, y, w, h, bottom;
594 float cur_value = _input.getFloatValue();
597 while (first <= last) {
598 if ((first % (int)_major_divs) == 0) {
613 float xstart, yfirst, ycentre, ysecond;
615 float hgt = bottom * 20.0 / 100.0; // 60% of height should be zoomed
616 yfirst = _center_y - hgt;
618 ysecond = _center_y + hgt;
619 float range = hgt * 2;
622 float factor = range / 10.0;
624 float hgt1 = bottom * 30.0 / 100.0;
625 int incrs = int((_val_span - _major_divs * 2.0) / _major_divs);
626 int incr = incrs / 2;
627 float factors = hgt1 / incr;
630 //this is for moving type pointer
631 static float ycent, ypoint, xpoint; // FIXME really static?
637 if (cur_value <= data[centre + 1])
638 if (cur_value > data[centre]) {
639 ypoint = ycent + ((cur_value - data[centre]) * hgt / _major_divs);
642 if (cur_value >= data[centre - 1])
643 if (cur_value <= data[centre]) {
644 ypoint = ycent - ((data[centre] - cur_value) * hgt / _major_divs);
647 if (cur_value < data[centre - 1])
648 if (cur_value >= _input.min()) {
649 float diff = _input.min() - data[centre - 1];
650 float diff1 = cur_value - data[centre - 1];
651 float val = (diff1 * hgt1) / diff;
653 ypoint = ycent - hgt - val;
656 if (cur_value > data[centre + 1])
657 if (cur_value <= _input.max()) {
658 float diff = _input.max() - data[centre + 1];
659 float diff1 = cur_value - data[centre + 1];
660 float val = (diff1 * hgt1) / diff;
662 ypoint = ycent + hgt + val;
668 draw_line(xstart, ycentre, xstart - 5.0, ycentre); //centre tick
670 snprintf(buf, BUFSIZE, "%3.0f\n", float(data[centre] * _input.factor())); // was data_scaling() ... makes not sense at all
672 if (!option_notext())
673 draw_text(x, ycentre, buf, 0);
675 for (i = 1; i < 5; i++) {
678 draw_bullet(xstart - 2.5, yfirst, 3.0);
679 draw_bullet(xstart - 2.5, ycentre, 3.0);
682 yfirst = _center_y - hgt;
684 for (i = 0; i <= incr; i++) {
685 draw_line(xstart, yfirst, xstart - 5.0, yfirst);
686 draw_line(xstart, ysecond, xstart - 5.0, ysecond);
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, yfirst, buf, 0);
693 snprintf(buf, BUFSIZE, "%3.0f\n", float(data[centre + i + 1] * _input.factor())); // was data_scaling() ... makes no sense at all
695 if (!option_notext())
696 draw_text(x, ysecond, buf, 0);
703 //to draw moving type pointer for left option
707 if (_pointer_type == MOVING) {
708 draw_line(xpoint, ycent, xpoint, ypoint);
709 draw_line(xpoint, ypoint, xpoint - 10.0, ypoint);
710 draw_line(xpoint - 10.0, ypoint, xpoint - 5.0, ypoint + 5.0);
711 draw_line(xpoint - 10.0, ypoint, xpoint - 5.0, ypoint - 5.0);
717 xstart = (x + w) / 2;
719 draw_line(xstart, ycentre, xstart + 5.0, ycentre); //centre tick
721 snprintf(buf, BUFSIZE, "%3.0f\n", float(data[centre] * _input.factor())); // was data_scaling() ... makes no sense at all
723 if (!option_notext())
724 draw_text(w, ycentre, buf, 0);
726 for (i = 1; i < 5; i++) {
729 draw_bullet(xstart + 2.5, yfirst, 3.0);
730 draw_bullet(xstart + 2.5, ycentre, 3.0);
733 yfirst = _center_y - hgt;
735 for (i = 0; i <= incr; i++) {
736 draw_line(xstart, yfirst, xstart + 5.0, yfirst);
737 draw_line(xstart, ysecond, xstart + 5.0, ysecond);
739 snprintf(buf, BUFSIZE, "%3.0f\n", float(data[centre - i - 1] * _input.factor())); // was data_scaling() ... makes no sense at all
741 if (!option_notext())
742 draw_text(w, yfirst, buf, 0);
744 snprintf(buf, BUFSIZE, "%3.0f\n", float(data[centre + i + 1] * _input.factor()));
746 if (!option_notext())
747 draw_text(w, ysecond, buf, 0);
754 // to draw moving type pointer for right option
758 if (_pointer_type == MOVING) {
759 draw_line(xpoint, ycent, xpoint, ypoint);
760 draw_line(xpoint, ypoint, xpoint + 10.0, ypoint);
761 draw_line(xpoint + 10.0, ypoint, xpoint + 5.0, ypoint + 5.0);
762 draw_line(xpoint + 10.0, ypoint, xpoint + 5.0, ypoint - 5.0);
765 }//end option_right /left
766 //end of vertical scale
776 float ystart, xfirst, xcentre, xsecond;
778 float hgt = bottom * 20.0 / 100.0; // 60% of height should be zoomed
779 xfirst = _center_x - hgt;
781 xsecond = _center_x + hgt;
782 float range = hgt * 2;
785 float factor = range / 10.0;
787 float hgt1 = bottom * 30.0 / 100.0;
788 int incrs = int((_val_span - _major_divs * 2.0) / _major_divs);
789 int incr = incrs / 2;
790 float factors = hgt1 / incr;
793 //Code for Moving Type Pointer
795 static float xcent, xpoint, ypoint; // FIXME really static?
799 if (cur_value <= data[centre + 1])
800 if (cur_value > data[centre]) {
801 xpoint = xcent + ((cur_value - data[centre]) * hgt / _major_divs);
804 if (cur_value >= data[centre - 1])
805 if (cur_value <= data[centre]) {
806 xpoint = xcent - ((data[centre] - cur_value) * hgt / _major_divs);
809 if (cur_value < data[centre - 1])
810 if (cur_value >= _input.min()) {
811 float diff = _input.min() - data[centre - 1];
812 float diff1 = cur_value - data[centre - 1];
813 float val = (diff1 * hgt1) / diff;
815 xpoint = xcent - hgt - val;
819 if (cur_value > data[centre + 1])
820 if (cur_value <= _input.max()) {
821 float diff = _input.max() - data[centre + 1];
822 float diff1 = cur_value - data[centre + 1];
823 float val = (diff1 * hgt1) / diff;
825 xpoint = xcent + hgt + val;
831 draw_line(xcentre, ystart, xcentre, ystart - 5.0); //centre tick
833 snprintf(buf, BUFSIZE, "%3.0f\n", float(data[centre] * _input.factor())); // was data_scaling() ... makes no sense at all
835 if (!option_notext())
836 draw_text(xcentre - 10.0, y, buf, 0);
838 for (i = 1; i < 5; i++) {
841 draw_bullet(xfirst, ystart - 2.5, 3.0);
842 draw_bullet(xcentre, ystart - 2.5, 3.0);
845 xfirst = _center_x - hgt;
847 for (i = 0; i <= incr; i++) {
848 draw_line(xfirst, ystart, xfirst, ystart - 5.0);
849 draw_line(xsecond, ystart, xsecond, ystart - 5.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(xfirst - 10.0, y, buf, 0);
856 snprintf(buf, BUFSIZE, "%3.0f\n", float(data[centre + i + 1] * _input.factor())); // was data_scaling() ... makes no sense at all
858 if (!option_notext())
859 draw_text(xsecond - 10.0, y, buf, 0);
865 //this is for moving pointer for top option
868 ypoint = _y + _h + 10.0;
870 if (_pointer_type == MOVING) {
871 draw_line(xcent, ypoint, xpoint, ypoint);
872 draw_line(xpoint, ypoint, xpoint, ypoint - 10.0);
873 draw_line(xpoint, ypoint - 10.0, xpoint + 5.0, ypoint - 5.0);
874 draw_line(xpoint, ypoint - 10.0, xpoint - 5.0, ypoint - 5.0);
880 ystart = (y + h) / 2;
882 //draw_line(xstart, yfirst, xstart - 5.0, yfirst);
883 draw_line(xcentre, ystart, xcentre, ystart + 5.0); //centre tick
885 snprintf(buf, BUFSIZE, "%3.0f\n", float(data[centre] * _input.factor())); // was data_scaling() ... makes no sense at all
887 if (!option_notext())
888 draw_text(xcentre - 10.0, h, buf, 0);
890 for (i = 1; i < 5; i++) {
893 draw_bullet(xfirst, ystart + 2.5, 3.0);
894 draw_bullet(xcentre, ystart + 2.5, 3.0);
897 xfirst = _center_x - hgt;
899 for (i = 0; i <= incr; i++) {
900 draw_line(xfirst, ystart, xfirst, ystart + 5.0);
901 draw_line(xsecond, ystart, xsecond, ystart + 5.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(xfirst - 10.0, h, buf, 0);
908 snprintf(buf, BUFSIZE, "%3.0f\n", float(data[centre + i + 1] * _input.factor())); // was data_scaling() ... makes no sense at all
910 if (!option_notext())
911 draw_text(xsecond - 10.0, h, buf, 0);
916 //this is for movimg pointer for bottom option
920 if (_pointer_type == MOVING) {
921 draw_line(xcent, ypoint, xpoint, ypoint);
922 draw_line(xpoint, ypoint, xpoint, ypoint + 10.0);
923 draw_line(xpoint, ypoint + 10.0, xpoint + 5.0, ypoint + 5.0);
924 draw_line(xpoint, ypoint + 10.0, xpoint - 5.0, ypoint + 5.0);
926 }//end hud_top or hud_bottom
927 } //end of horizontal/vertical scales