]> git.mxchange.org Git - flightgear.git/blob - src/Cockpit/hud.hxx
8c7d1632813282697f8639bbfa8f49e939ce7b25
[flightgear.git] / src / Cockpit / hud.hxx
1 // hud.hxx -- hud defines and prototypes (initial draft)
2 //
3 // Written by Michele America, started September 1997.
4 //
5 // Copyright (C) 1997  Michele F. America  - nomimarketing@mail.telepac.pt
6 //
7 // This program is free software; you can redistribute it and/or
8 // modify it under the terms of the GNU General Public License as
9 // published by the Free Software Foundation; either version 2 of the
10 // License, or (at your option) any later version.
11 //
12 // This program is distributed in the hope that it will be useful, but
13 // WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15 // General Public License for more details.
16 //
17 // You should have received a copy of the GNU General Public License
18 // along with this program; if not, write to the Free Software
19 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
20 //
21 // $Id$
22
23
24 #ifndef _OLDHUD_HXX
25 #define _OLDHUD_HXX
26
27 #ifndef __cplusplus
28 # error This library requires C++
29 #endif
30
31 #include <simgear/compiler.h>
32
33 #ifdef HAVE_CONFIG_H
34 #  include <config.h>
35 #endif
36
37 #ifdef __CYGWIN__
38 #include <ieeefp.h>
39 #endif
40
41 #include <stdlib.h>
42 #include <string.h>
43
44 #include <algorithm>    // for_each()
45 #include <vector>       // STL vector
46 #include <deque>        // STL double ended queue
47 #include <fstream>
48
49 namespace osg {
50     class State;
51 }
52
53 #include <simgear/math/SGMath.hxx>
54 #include <simgear/constants.h>
55
56 #include <Include/fg_typedefs.h>
57 #include <Aircraft/aircraft.hxx>
58 #include <Aircraft/controls.hxx>
59 #include <FDM/flight.hxx>
60 #include <GUI/gui.h>
61 #include <Main/fg_props.hxx>
62 #include <Main/globals.hxx>
63 #include <Main/viewmgr.hxx>
64 #include <Airports/runways.hxx>
65
66 #include <plib/sg.h>
67
68 using std::deque;
69 using std::vector;
70
71 #define float_to_int(v) SGMiscf::roundToInt(v)
72
73 // some of Norman's crazy optimizations. :-)
74
75 #ifndef WIN32
76 typedef struct {
77     int x, y;
78 } POINT;
79
80 typedef struct {
81     int top, bottom, left, right;
82 } RECT;
83 #endif
84
85 // View mode definitions
86
87 enum VIEW_MODES{ HUD_VIEW, PANEL_VIEW, CHASE_VIEW, TOWER_VIEW };
88
89 // Label constants
90 #define HUD_FONT_SMALL     1
91 #define HUD_FONT_LARGE     2
92
93 enum fgLabelJust{ LEFT_JUST, CENTER_JUST, RIGHT_JUST } ;
94
95 #define HUDS_AUTOTICKS           0x0001
96 #define HUDS_VERT                0x0002
97 #define HUDS_HORZ                0x0000
98 #define HUDS_TOP                 0x0004
99 #define HUDS_BOTTOM              0x0008
100 #define HUDS_LEFT     HUDS_TOP
101 #define HUDS_RIGHT    HUDS_BOTTOM
102 #define HUDS_BOTH     (HUDS_LEFT | HUDS_RIGHT)
103 #define HUDS_NOTICKS             0x0010
104 #define HUDS_ARITHTIC            0x0020
105 #define HUDS_DECITICS            0x0040
106 #define HUDS_NOTEXT              0x0080
107
108 // in cockpit.cxx
109 extern float get_throttleval ( void );
110 extern float get_aileronval  ( void );
111 extern float get_elevatorval ( void );
112 extern float get_elev_trimval( void );
113 extern float get_rudderval   ( void );
114 extern float get_speed       ( void );
115 extern float get_aoa         ( void );
116 extern float get_nlf         ( void );
117 extern float get_roll        ( void );
118 extern float get_pitch       ( void );
119 extern float get_heading     ( void );
120 extern float get_view_direction( void );
121 extern float get_altitude    ( void );
122 extern float get_agl         ( void );
123 extern float get_sideslip    ( void );
124 extern float get_frame_rate  ( void );
125 extern float get_latitude    ( void );
126 extern float get_lat_min     ( void );
127 extern float get_longitude   ( void );
128 extern float get_long_min    ( void );
129 extern float get_fov         ( void );
130 extern float get_vfc_ratio   ( void );
131 extern float get_vfc_tris_drawn   ( void );
132 extern float get_vfc_tris_culled   ( void );
133 extern float get_climb_rate  ( void );
134 extern float get_mach( void );
135 extern char *coord_format_lat(float);
136 extern char *coord_format_lon(float);
137
138 // $$$ begin - added, VS Renganathan, 13 Oct 2K
139 extern float get_anzg (void);
140 extern float get_Vx (void);
141 extern float get_Vy (void);
142 extern float get_Vz (void);
143 extern float get_Ax (void);
144 extern float get_Ay (void);
145 extern float get_Az (void);
146 extern int get_iaux1 (void);
147 extern int get_iaux2 (void);
148 extern int get_iaux3 (void);
149 extern int get_iaux4 (void);
150 extern int get_iaux5 (void);
151 extern int get_iaux6 (void);
152 extern int get_iaux7 (void);
153 extern int get_iaux8 (void);
154 extern int get_iaux9 (void);
155 extern int get_iaux10 (void);
156 extern int get_iaux11 (void);
157 extern int get_iaux12 (void);
158 extern float get_aux1(void);
159 extern float get_aux2(void);
160 extern float get_aux3(void);
161 extern float get_aux4(void);
162 extern float get_aux5 (void);
163 extern float get_aux6 (void);
164 extern float get_aux7 (void);
165 extern float get_aux8(void);
166 extern float get_aux9(void);
167 extern float get_aux10(void);
168 extern float get_aux11(void);
169 extern float get_aux12(void);
170 extern float get_aux13(void);
171 extern float get_aux14(void);
172 extern float get_aux15(void);
173 extern float get_aux16(void);
174 extern float get_aux17(void);
175 extern float get_aux18(void);
176 // $$$ end - added, VS Renganathan, 13 Oct 2K
177
178 extern char *get_formated_gmt_time( void );
179
180 enum  hudinstype{ HUDno_instr,
181                   HUDscale,
182                   HUDlabel,
183                   HUDladder,
184                   HUDcirc_ladder,
185                   HUDhorizon,
186                   HUDgauge,
187                   HUDdual_inst,
188                   HUDmoving_scale,
189                   HUDtbi
190 };
191
192 typedef struct gltagRGBTRIPLE { // rgbt
193     GLfloat Blue;
194     GLfloat Green;
195     GLfloat Red;
196 } glRGBTRIPLE;
197
198 class fgLineSeg2D {
199 private:
200     GLfloat x0, y0, x1, y1;
201
202 public:
203     fgLineSeg2D( GLfloat a = 0, GLfloat b =0, GLfloat c = 0, GLfloat d =0 )
204         : x0(a), y0(b),  x1(c), y1(d) {}
205
206     fgLineSeg2D( const fgLineSeg2D & image )
207         : x0(image.x0), y0(image.y0), x1(image.x1), y1(image.y1) {}
208
209     fgLineSeg2D& operator= ( const fgLineSeg2D & image ) { // seems unused
210         x0 = image.x0; y0 = image.y0; x1 = image.x1; y1 = image.y1; return *this;
211     }
212
213     void draw() const
214     {
215         glVertex2f(x0, y0);
216         glVertex2f(x1, y1);
217     }
218 };
219
220 class DrawLineSeg2D {
221     public:
222         void operator() (const fgLineSeg2D& elem) const {
223             elem.draw();
224         }
225 };
226
227
228 #define USE_HUD_TextList
229 extern fntTexFont        *HUD_Font;
230 extern float              HUD_TextSize;
231 extern fntRenderer       *HUDtext;
232 extern float HUD_matrix[16];
233
234 class fgText {
235 private:
236     float x, y;
237     string msg;
238         bool digit;
239     // seems unused   
240         
241 public:
242         fgText(float x, float y, const string& c, bool digits=false): x(x), y(y), msg( c), digit( digits) {};   
243
244     fgText( const fgText & image )
245                 : x(image.x), y(image.y), msg(image.msg), digit(image.digit) { }
246
247         fgText& operator = ( const fgText & image ) {
248                 x = image.x; y = image.y; msg= image.msg; digit = image.digit;
249                 return *this;
250         }
251         
252     static int getStringWidth ( const char *str )
253     {
254         if ( HUDtext && str ) {
255             float r, l ;
256             HUD_Font->getBBox ( str, HUD_TextSize, 0, &l, &r, NULL, NULL ) ;
257             return float_to_int( r - l );
258         }
259         return 0 ;
260     }
261
262     int StringWidth ()
263     {
264         if ( HUDtext && msg != "") {
265             float r, l ;
266             HUD_Font->getBBox ( msg.c_str(), HUD_TextSize, 0, &l, &r, NULL, NULL ) ;
267             return float_to_int( r - l );
268         }
269         return 0 ;
270     }
271
272     // this code is changed to display Numbers with big/small digits
273     // according to MIL Standards for example Altitude above 10000 ft
274     // is shown as 10ooo.
275
276     void Draw(fntRenderer *fnt) {
277         if (digit) {
278             int c=0,i=0;
279             
280             int p=4;
281
282             if (msg[0]=='-') {
283                 //if negative value then increase the c and p values
284                 //for '-' sign.  c++;
285                 p++;
286             }
287                         
288                         for (string::size_type i = 0; i < msg.size(); i++) {
289                 if ((msg[i]>='0') && (msg[i]<='9'))
290                     c++;
291             }
292             float orig_size = fnt->getPointSize();
293             if (c>p) {
294                 fnt->setPointSize(HUD_TextSize * 0.8);
295                 int p2=(c-3)*8;  //advance to the last 3 digits
296
297                 fnt->start2f(x+p2,y);
298                 fnt->puts(msg.c_str() + c - 3); // display last 3 digits
299
300                 fnt->setPointSize(HUD_TextSize * 1.2);
301               
302                 fnt->start2f(x,y);
303                                 fnt->puts(msg.substr(0,c-3).c_str());
304             } else {
305                 fnt->setPointSize(HUD_TextSize * 1.2);
306                 fnt->start2f( x, y );
307                 fnt->puts(msg.c_str());
308             }
309             fnt->setPointSize(orig_size);
310         } else {
311             //if digits not true
312             fnt->start2f( x, y );
313             fnt->puts( msg.c_str()) ;
314         }
315     }
316
317     void Draw()
318     {
319                 guiFnt.drawString( msg.c_str(), float_to_int(x), float_to_int(y) );
320     }
321 };
322
323 class fgLineList {
324     vector < fgLineSeg2D > List;
325 public:
326     fgLineList( void ) {}
327     void add( const fgLineSeg2D& seg ) { List.push_back(seg); }
328         void erase( void ) { List.clear();}
329     void draw( void ) {
330         glBegin(GL_LINES);
331         for_each( List.begin(), List.end(), DrawLineSeg2D());
332         glEnd();
333     }
334 };
335
336 class fgTextList {
337     fntRenderer *Font;
338     vector< fgText > List;
339 public:
340     fgTextList ( void ) { Font = 0; }
341
342     void setFont( fntRenderer *Renderer ) { Font = Renderer; }
343     void add( const fgText& String ) { List.push_back(String); }
344     void erase( void ) { List.clear(); }
345     void draw( void );
346 };
347
348
349 inline void Text( fgTextList &List, float x, float y, char *s)
350 {
351     List.add( fgText( x, y, s) );
352 }
353
354 inline void Text( fgTextList &List, const fgText &me)
355 {
356     List.add(me);
357 }
358
359 inline void Line( fgLineList &List, float x1, float y1, float x2, float y2)
360 {
361     List.add(fgLineSeg2D(x1,y1,x2,y2));
362 }
363
364
365 // Declare our externals
366 extern fgTextList         HUD_TextList;
367 extern fgLineList         HUD_LineList;
368 extern fgLineList         HUD_StippleLineList;
369
370
371 class instr_item : public SGReferenced {  // An Abstract Base Class (ABC)
372 private:
373     static UINT        instances;     // More than 64K instruments? Nah!
374     static int         brightness;
375     static glRGBTRIPLE color;
376
377     UINT               handle;
378     RECT               scrn_pos;      // Framing - affects scale dimensions
379                                       // and orientation. Vert vs Horz, etc.
380     FLTFNPTR           load_value_fn;
381     float              disp_factor;   // Multiply by to get numbers shown on scale.
382     UINT               opts;
383     bool               is_enabled;
384     bool               broken;
385     UINT               scr_span;      // Working values for draw;
386     POINT              mid_span;      //
387     int                digits;
388
389 public:
390     instr_item( int            x,
391                 int            y,
392                 UINT           height,
393                 UINT           width,
394                 FLTFNPTR       data_source,
395                 float          data_scaling,
396                 UINT           options,
397                 bool           working = true,
398                 int            digit = 0);
399
400     virtual ~instr_item ();
401
402     void    set_data_source ( FLTFNPTR fn ) { load_value_fn = fn; }
403     int     get_brightness  ( void ) { return brightness;}
404     RECT    get_location    ( void ) { return scrn_pos;  }
405     bool    is_broken       ( void ) { return broken;    }
406     bool    enabled         ( void ) { return is_enabled;}
407     bool    data_available  ( void ) { return !!load_value_fn; }
408     float   get_value       ( void ) { return load_value_fn(); }
409     float   data_scaling    ( void ) { return disp_factor; }
410     UINT    get_span        ( void ) { return scr_span;  }
411     POINT   get_centroid    ( void ) { return mid_span;  }
412     UINT    get_options     ( void ) { return opts;      }
413     int     get_digits      ( void ) { return digits;         }
414     inline int get_x() const { return scrn_pos.left; }
415     inline int get_y() const { return scrn_pos.top; }
416     inline int get_width() const { return scrn_pos.right; }
417     inline int get_height() const { return scrn_pos.bottom; }
418
419     UINT    huds_vert     (UINT options) { return (options & HUDS_VERT); }
420     UINT    huds_left     (UINT options) { return (options & HUDS_LEFT); }
421     UINT    huds_right    (UINT options) { return (options & HUDS_RIGHT); }
422     UINT    huds_both     (UINT options) {
423         return ((options & HUDS_BOTH) == HUDS_BOTH);
424     }
425     UINT    huds_noticks  (UINT options) { return (options & HUDS_NOTICKS); }
426     UINT    huds_notext   (UINT options) { return (options & HUDS_NOTEXT); }
427     UINT    huds_top      (UINT options) { return (options & HUDS_TOP); }
428     UINT    huds_bottom   (UINT options) { return (options & HUDS_BOTTOM); }
429
430     virtual void display_enable( bool working ) { is_enabled = working;}
431
432     virtual void break_display ( bool bad );
433     virtual void SetBrightness( int illumination_level ); // fgHUDSetBright...
434     void         SetPosition  ( int x, int y, UINT width, UINT height );
435     UINT         get_Handle( void );
436     virtual void draw( void ) = 0;   // Required method in derived classes
437
438     void drawOneLine( float x1, float y1, float x2, float y2)
439     {
440         HUD_LineList.add(fgLineSeg2D(x1,y1,x2,y2));
441     }
442     void drawOneStippleLine( float x1, float y1, float x2, float y2)
443     {
444         HUD_StippleLineList.add(fgLineSeg2D(x1,y1,x2,y2));
445     }
446     void TextString( char *msg, float x, float y, bool digit )
447     {
448         HUD_TextList.add(fgText(x, y, msg,digit));
449     }
450     int getStringWidth ( char *str )
451     {
452         if ( HUDtext && str ) {
453             float r, l ;
454             HUD_Font->getBBox ( str, HUD_TextSize, 0, &l, &r, NULL, NULL ) ;
455             return float_to_int( r - l );
456         }
457         return 0 ;
458     }
459
460
461
462 };
463
464 typedef instr_item *HIptr;
465
466 class HUDdraw {
467     public:
468         void operator() (HIptr elem) const {
469             if ( elem->enabled())
470                 elem->draw();
471         }
472 };
473
474
475 extern int HUD_style;
476
477 // instr_item           This class has no other purpose than to maintain
478 //                      a linked list of instrument and derived class
479 // object pointers.
480
481
482 class instr_label : public instr_item {
483 private:
484     const char  *pformat;
485     
486     fgLabelJust justify;
487     int         fontSize;
488     int         blink;
489     string      format_buffer;
490     bool        lat;
491     bool        lon;
492     bool        lbox;
493     SGPropertyNode_ptr lon_node;
494     SGPropertyNode_ptr lat_node;
495
496 public:
497     instr_label(const SGPropertyNode *);
498     virtual void draw(void);
499 };
500
501
502 //
503 // fgRunway_instr   This class is responsible for rendering the active runway
504 //                  in the hud (if visible).
505 class runway_instr : public instr_item {
506 private:
507         void boundPoint(const sgdVec3& v, sgdVec3& m);
508         bool boundOutsidePoints(sgdVec3& v, sgdVec3& m);
509         bool drawLine(const sgdVec3& a1, const sgdVec3& a2,
510                 const sgdVec3& p1, const sgdVec3& p2);
511         void drawArrow();
512         bool get_active_runway(FGRunway& rwy);
513         void get_rwy_points(sgdVec3 *points);
514         void setLineWidth(void);
515
516         sgdVec3 points3d[6], points2d[6];
517         double mm[16],pm[16], arrowScale, arrowRad, lnScale;
518         double scaleDist, default_pitch, default_heading;
519         GLint view[4];
520         FGRunway runway;
521         FGViewer* cockpit_view;
522         unsigned short stippleOut, stippleCen;
523         bool drawIA, drawIAAlways;
524         RECT location;
525         POINT center;
526
527 public:
528     runway_instr(const SGPropertyNode *);
529
530     virtual void draw( void );
531     void setArrowRotationRadius(double radius);
532     // Scales the runway indication arrow
533     void setArrowScale(double scale);
534     // Draws arrow when runway is not visible in HUD if draw=true
535     void setDrawArrow(bool draw);
536     // Always draws arrow if draw=true;
537     void setDrawArrowAlways(bool draw);
538     // Sets the maximum line scale
539     void setLineScale(double scale);
540     // Sets the distance where to start scaling the lines
541     void setScaleDist(double dist_nm);
542     // Sets the stipple pattern of the outline of the runway
543     void setStippleOutline(unsigned short stipple);
544     // Sets the stipple patter of the center line of the runway
545     void setStippleCenterline(unsigned short stipple);
546 };
547
548
549 //
550 // instr_scale           This class is an abstract base class for both moving
551 //                       scale and moving needle (fixed scale) indicators. It
552 // does not draw itself, but is not instanciable.
553 //
554
555 class instr_scale : public instr_item {
556 private:
557     float range_shown;   // Width Units.
558     float Maximum_value; //                ceiling.
559     float Minimum_value; // Representation floor.
560     float scale_factor;  // factor => screen units/range values.
561     UINT   Maj_div;       // major division marker units
562     UINT   Min_div;       // minor division marker units
563     UINT   Modulo;        // Roll over point
564     int    signif_digits; // digits to show to the right.
565
566 public:
567     instr_scale( int          x,
568                  int          y,
569                  UINT         width,
570                  UINT         height,
571                  FLTFNPTR     load_fn,
572                  UINT         options,
573                  float        show_range,
574                  float        max_value,
575                  float        min_value,
576                  float        disp_scaling,
577                  UINT         major_divs,
578                  UINT         minor_divs,
579                  UINT         rollover,
580                  int          dp_showing,
581                  bool         working = true);
582
583     virtual void draw    ( void ) {}; // No-op here. Defined in derived classes.
584     UINT   div_min       ( void ) { return Min_div;}
585     UINT   div_max       ( void ) { return Maj_div;}
586     float  min_val       ( void ) { return Minimum_value;}
587     float  max_val       ( void ) { return Maximum_value;}
588     UINT   modulo        ( void ) { return Modulo; }
589     float  factor        ( void ) { return scale_factor;}
590     float  range_to_show ( void ) { return range_shown;}
591 };
592
593 // hud_card                This class displays the indicated quantity on
594 //                         a scale that moves past the pointer. It may be
595 // horizontal or vertical, read above(left) or below(right) of the base
596 // line.
597
598 class hud_card : public instr_scale {
599 private:
600     float  val_span;
601     string type;
602     float  half_width_units;
603     bool   draw_tick_bottom;
604     bool   draw_tick_top;
605     bool   draw_tick_right;
606     bool   draw_tick_left;
607     bool   draw_cap_bottom;
608     bool   draw_cap_top;
609     bool   draw_cap_right;
610     bool   draw_cap_left;
611     float  marker_offset;
612     bool   pointer;
613     string pointer_type;
614     string tick_type;
615     string tick_length;
616     float  radius;
617     float  maxValue;
618     float  minValue;
619     int    divisions;
620     int    zoom;
621     UINT   Maj_div;
622     UINT   Min_div;
623
624 public:
625     hud_card(const SGPropertyNode *);
626     //    virtual void display_enable( bool setting );                  // FIXME
627     virtual void draw(void);
628     void circles(float, float, float);
629     void fixed(float, float, float, float, float, float);
630     void zoomed_scale(int, int);
631 };
632
633
634 class gauge_instr : public instr_scale {
635 public:
636     gauge_instr(const SGPropertyNode *);
637     virtual void draw( void );       // Required method in base class
638 };
639
640
641 //
642 // dual_instr_item         This class was created to form the base class
643 //                         for both panel and HUD Turn Bank Indicators.
644
645 class dual_instr_item : public instr_item {
646 private:
647     FLTFNPTR alt_data_source;
648
649 public:
650     dual_instr_item ( int       x,
651                       int       y,
652                       UINT      width,
653                       UINT      height,
654                       FLTFNPTR  chn1_source,
655                       FLTFNPTR  chn2_source,
656                       bool      working,
657                       UINT      options );
658
659     float current_ch1( void ) { return (float)alt_data_source(); }
660     float current_ch2( void ) { return (float)get_value(); }
661     virtual void draw( void ) {}
662 };
663
664
665 class fgTBI_instr : public dual_instr_item {
666 private:
667     UINT BankLimit;
668     UINT SlewLimit;
669     UINT scr_hole;
670     bool tsi;
671     float rad;
672
673 public:
674     fgTBI_instr(const SGPropertyNode *);
675
676     UINT bank_limit(void) { return BankLimit; }
677     UINT slew_limit(void) { return SlewLimit; }
678
679     virtual void draw(void);
680 };
681
682
683 class HudLadder : public dual_instr_item {
684 private:
685     UINT   width_units;
686     int    div_units;
687     UINT   minor_div;
688     UINT   label_pos;
689     UINT   scr_hole;
690     float  vmax;
691     float  vmin;
692     float  factor;
693     string hudladder_type;
694     bool   frl;
695     bool   target_spot;
696     bool   velocity_vector;
697     bool   drift_marker;
698     bool   alpha_bracket;
699     bool   energy_marker;
700     bool   climb_dive_marker;
701     bool   glide_slope_marker;
702     float  glide_slope;
703     bool   energy_worm;
704     bool   waypoint_marker;
705     int    zenith;
706     int    nadir;
707     int    hat;
708
709     // The Ladder has it's own temporary display lists
710     fgTextList         TextList;
711     fgLineList         LineList;
712     fgLineList         StippleLineList;
713
714 public:
715     HudLadder(const SGPropertyNode *);
716
717     virtual void draw(void);
718     void drawZenith(float, float, float);
719     void drawNadir(float, float, float);
720
721     void Text(float x, float y, char *s)
722     {
723         TextList.add(fgText(x, y, s));
724     }
725
726     void Line(float x1, float y1, float x2, float y2)
727     {
728         LineList.add(fgLineSeg2D(x1, y1, x2, y2));
729     }
730
731     void StippleLine(float x1, float y1, float x2, float y2)
732     {
733         StippleLineList.add(fgLineSeg2D(x1, y1, x2, y2));
734     }
735 };
736
737
738 extern int  fgHUDInit( fgAIRCRAFT * /* current_aircraft */ );
739 extern int  fgHUDInit2( fgAIRCRAFT * /* current_aircraft */ );
740 extern void fgUpdateHUD( osg::State* );
741 extern void fgUpdateHUD( osg::State*, GLfloat x_start, GLfloat y_start,
742                          GLfloat x_end, GLfloat y_end );
743
744
745
746
747 class HUD_Properties : public SGPropertyChangeListener {
748 public:
749     HUD_Properties();
750     void valueChanged(SGPropertyNode *n);
751     void setColor() const;
752     bool isVisible() const { return _visible; }
753     bool isAntialiased() const { return _antialiased; }
754     bool isTransparent() const { return _transparent; }
755     float alphaClamp() const { return _cl; }
756
757 private:
758     float clamp(float f) { return f < 0.0f ? 0.0f : f > 1.0f ? 1.0f : f; }
759     SGPropertyNode_ptr _current;
760     SGPropertyNode_ptr _visibility;
761     SGPropertyNode_ptr _antialiasing;
762     SGPropertyNode_ptr _transparency;
763     SGPropertyNode_ptr _red, _green, _blue, _alpha;
764     SGPropertyNode_ptr _alpha_clamp;
765     SGPropertyNode_ptr _brightness;
766     bool _visible;
767     bool _antialiased;
768     bool _transparent;
769     float _r, _g, _b, _a, _cl;
770 };
771
772 #endif // _OLDHUD_H