]> git.mxchange.org Git - flightgear.git/blobdiff - src/WeatherCM/FGTurbulenceItem.h
Moved random ground cover object management code (userdata.[ch]xx) over
[flightgear.git] / src / WeatherCM / FGTurbulenceItem.h
index 2b9fa3c7cbba07292709ab9d90c1f7214468e296..1afabd95525e2c19ceddfac9b22293c60c89b702 100644 (file)
@@ -36,6 +36,8 @@ HISTORY
                                suggestion
 19.10.1999 Christian Mayer     change to use PLIB's sg instead of Point[2/3]D
                                and lots of wee code cleaning
+21.12.1999 Christian Mayer     Added a fix for compatibility to gcc 2.8 which
+                               suggested by Oliver Delise
 *****************************************************************************/
 
 /****************************************************************************/
@@ -47,7 +49,18 @@ HISTORY
 /****************************************************************************/
 /* INCLUDES                                                                */
 /****************************************************************************/
-#include "sg.h"
+
+#ifdef HAVE_CONFIG_H
+#  include <config.h>
+#endif
+
+#include <simgear/compiler.h>
+
+#ifdef HAVE_WINDOWS_H
+#  include <windows.h>
+#endif
+
+#include <plib/sg.h>
 
 #include "FGWeatherDefs.h"
 
@@ -57,6 +70,12 @@ HISTORY
 class FGTurbulenceItem;
 FGTurbulenceItem operator-(const FGTurbulenceItem& arg);
 
+#if ( __GNU_C__ == 2 && __GNU_MAJOR__ < 9 )
+#  define const_sgVec3 const sgVec3
+#else
+#  define const_sgVec3 const sgVec3&
+#endif
+
 /****************************************************************************/
 /* CLASS DECLARATION                                                       */
 /****************************************************************************/
@@ -67,7 +86,7 @@ private:
 
 protected:
 public:
-    FGTurbulenceItem(const sgVec3& v)  { sgCopyVec3(value, v);}
+    FGTurbulenceItem(const_sgVec3 v)   { sgCopyVec3(value, v);}
     FGTurbulenceItem()                 { sgZeroVec3(value);   }
 
     void          getValue(sgVec3 ret) const { sgCopyVec3(ret, value); };
@@ -77,6 +96,10 @@ public:
     WeatherPrecision y(void) const { return value[1]; };
     WeatherPrecision z(void) const { return value[2]; };
 
+    void x(const WeatherPrecision x) { value[0] = x; };
+    void y(const WeatherPrecision y) { value[1] = y; };
+    void z(const WeatherPrecision z) { value[2] = z; };
+
     FGTurbulenceItem& operator*= (const WeatherPrecision  arg);
     FGTurbulenceItem& operator+= (const FGTurbulenceItem& arg);
     FGTurbulenceItem& operator-= (const FGTurbulenceItem& arg);