]> git.mxchange.org Git - flightgear.git/blobdiff - Cockpit/hud_inst.cxx
C++ ifying ...
[flightgear.git] / Cockpit / hud_inst.cxx
index 97934f043e468c4fb3f54b47f1794ea82d58745e..58e1e1cc59118963b4493c2267e0cd1d25ccd25c 100644 (file)
@@ -1,4 +1,4 @@
-// Abstract Base Class instr_item\r
+// Abstract Base Class instr_item
 //
 #ifdef HAVE_CONFIG_H
 #  include <config.h>
@@ -7,22 +7,24 @@
 #ifdef HAVE_WINDOWS_H
 #  include <windows.h>
 #endif
+
 #include <stdlib.h>
 #include <string.h>
-#include <Aircraft/aircraft.h>
+#include <Aircraft/aircraft.hxx>
 #include <Debug/fg_debug.h>
 #include <Include/fg_constants.h>
 #include <Math/fg_random.h>
 #include <Math/mat3.h>
-#include <Math/polar3d.h>
+#include <Math/polar3d.hxx>
 #include <Scenery/scenery.hxx>
 #include <Time/fg_timer.hxx>
-#include <Weather/weather.h>
 
 
 #include "hud.hxx"
 
-UINT instr_item :: instances;  // Initial value of zero
+UINT instr_item :: instances = 0;  // Initial value of zero
+int  instr_item :: brightness = BRT_MEDIUM;
+glRGBTRIPLE instr_item :: color = {0.1, 0.7, 0.0};
 
 // constructor    ( No default provided )
 instr_item  ::
@@ -31,14 +33,15 @@ instr_item  ::
                UINT             width,
                UINT             height,
                DBLFNPTR         data_source,
+               double           data_scaling,
                UINT             options,
                bool             working) :
                       handle         ( ++instances  ),
                       load_value_fn  ( data_source  ),
+                      disp_factor    ( data_scaling ),
                       opts           ( options      ),
                       is_enabled     ( working      ),
-                      broken         ( FALSE        ),
-                      brightness     ( BRT_MEDIUM   )
+                      broken         ( FALSE        )
 {
   scrn_pos.left   = x;
   scrn_pos.top    = y;
@@ -76,10 +79,10 @@ instr_item  ::
                          handle       ( ++instances        ),
                          scrn_pos     ( image.scrn_pos     ),
                          load_value_fn( image.load_value_fn),
+                         disp_factor  ( image.disp_factor  ),
                          opts         ( image.opts         ),
                          is_enabled   ( image.is_enabled   ),
                          broken       ( image.broken       ),
-                         brightness   ( image.brightness   ),
                          scr_span     ( image.scr_span     ),
                          mid_span     ( image.mid_span     )
 {
@@ -92,10 +95,10 @@ instr_item & instr_item :: operator = ( const instr_item & rhs )
   if( !(this == &rhs )) { // Not an identity assignment
     scrn_pos      = rhs.scrn_pos;
     load_value_fn = rhs.load_value_fn;
+    disp_factor   = rhs.disp_factor;
     opts          = rhs.opts;
     is_enabled    = rhs.is_enabled;
     broken        = rhs.broken;
-    brightness    = rhs.brightness;
     }
   return *this;
 }