]> git.mxchange.org Git - flightgear.git/blobdiff - src/Cockpit/hud_scal.cxx
Set the key SGModelLib callback to make aircraft-dir OSG loading work.
[flightgear.git] / src / Cockpit / hud_scal.cxx
index 6dcb1d30b8d5387722778a5c85dd7c895affa5c1..694a0ea3aa861ab5ddf27d769d8ff85f88c9f420 100644 (file)
@@ -1,21 +1,3 @@
-#ifdef HAVE_CONFIG_H
-#  include <config.h>
-#endif
-
-#ifdef HAVE_WINDOWS_H
-#  include <windows.h>
-#endif
-
-#include <stdlib.h>
-#include <string.h>
-
-#include <simgear/constants.h>
-#include <simgear/math/fg_random.h>
-#include <simgear/math/polar3d.hxx>
-
-#include <Aircraft/aircraft.hxx>
-#include <Scenery/scenery.hxx>
-#include <Time/fg_timer.hxx>
 
 #include "hud.hxx"
 
 //    markers) or just over the middle line.
 //
 // 2.  This class was not intended to be instanciated. See moving_scale
-//     and guage_instr classes.
+//     and gauge_instr classes.
 //============================================================================
-instr_scale ::
-instr_scale ( int       x,
-              int       y,
-              UINT      width,
-              UINT      height,
-              FLTFNPTR  load_fn,
-              UINT      options,
-              float    show_range,
-              float    maxValue,
-              float    minValue,
-              float    disp_scale,
-              UINT      major_divs,
-              UINT      minor_divs,
-              UINT      rollover,
-              int       dp_showing,
-              bool      working ) :
-                instr_item( x, y, width, height,
-                            load_fn, disp_scale, options, working),
-                range_shown  ( show_range ),
-                Maximum_value( maxValue   ),
-                Minimum_value( minValue   ),
-                Maj_div      ( major_divs ),
-                Min_div      ( minor_divs ),
-                Modulo       ( rollover   ),
-                signif_digits( dp_showing )
+instr_scale::instr_scale(
+        int      x,
+        int      y,
+        UINT     width,
+        UINT     height,
+        FLTFNPTR load_fn,
+        UINT     options,
+        float    show_range,
+        float    maxValue,
+        float    minValue,
+        float    disp_scale,
+        UINT     major_divs,
+        UINT     minor_divs,
+        UINT     rollover,
+        int      dp_showing,
+        bool     working) :
+    instr_item( x, y, width, height, load_fn, disp_scale, options, working),
+    range_shown  ( show_range ),
+    Maximum_value( maxValue   ),
+    Minimum_value( minValue   ),
+    Maj_div      ( major_divs ),
+    Min_div      ( minor_divs ),
+    Modulo       ( rollover   ),
+    signif_digits( dp_showing )
 {
-int temp;
+    int temp;
 
-  scale_factor   = (float)get_span() / range_shown;
-  if( show_range < 0 ) {
-    range_shown = -range_shown;
-    }
-  temp = FloatToInt(Maximum_value - Minimum_value) / 100;
-  if( range_shown < temp ) {
-    range_shown = temp;
-    }
-}
+    scale_factor = (float)get_span() / range_shown;
+    if (show_range < 0)
+        range_shown = -range_shown;
 
-instr_scale ::
-  instr_scale( const instr_scale & image ) :
-            instr_item( (const instr_item &) image),
-            range_shown  ( image.range_shown   ),
-            Maximum_value( image.Maximum_value ),
-            Minimum_value( image.Minimum_value ),
-            scale_factor ( image.scale_factor  ),
-            Maj_div      ( image.Maj_div       ),
-            Min_div      ( image.Min_div       ),
-            Modulo       ( image.Modulo        ),
-            signif_digits( image.signif_digits )
-{
-}
-
-instr_scale & instr_scale :: operator = (const instr_scale & rhs )
-{
-  if( !(this == &rhs)) {
-    instr_item::operator = (rhs);
-    range_shown   = rhs.range_shown;
-    scale_factor  = rhs.scale_factor;
-    Maximum_value = rhs.Maximum_value;
-    Minimum_value = rhs.Minimum_value;
-    Maj_div       = rhs.Maj_div;
-    Min_div       = rhs.Min_div;
-    Modulo        = rhs.Modulo;
-    signif_digits = rhs.signif_digits;
-    }
-  return *this;
+    temp = float_to_int(Maximum_value - Minimum_value) / 100;
+    if (range_shown < temp)
+        range_shown = temp;
 }
 
-instr_scale :: ~ instr_scale () {}