]> git.mxchange.org Git - flightgear.git/commitdiff
Make comparisons against OSG version less flakey
authortimoore <timoore>
Thu, 4 Oct 2007 20:40:29 +0000 (20:40 +0000)
committertimoore <timoore>
Thu, 4 Oct 2007 20:40:29 +0000 (20:40 +0000)
Turn OPENSCENEGRAPH_MAJOR_VERSION, OPENSCENEGRAPH_MINOR_VERSION and
OPENSCENEGRAPH_PATCH_VERSION into a single number for comparisons in the
preprocessor.

src/Environment/fgclouds.cxx
src/Include/general.hxx
src/Instrumentation/wxradar.cxx
src/Main/fg_os_osgviewer.cxx
src/Main/renderer.cxx

index dfb884c076b226baf2f4d9e11b92923aaac2d9cf..1104f76788a4658a1edfa09a72a615c75c213821 100644 (file)
@@ -410,7 +410,9 @@ void FGClouds::buildScenario( const string& scenario ) {
     }
 
        for(int iLayer = 0 ; iLayer < thesky->get_cloud_layer_count(); iLayer++) {
-               thesky->get_cloud_layer(iLayer)->get_layer3D()->clear();
+            thesky->get_cloud_layer(iLayer)
+                ->setCoverage(SGCloudLayer::SG_CLOUD_CLEAR);
+            thesky->get_cloud_layer(iLayer)->get_layer3D()->clear();
        }
 
        station += " 011000Z ";
index 1c33c5c593359052b7aab91079370a6b98010e91..0001e232ee4cec8d8add306092d3be9edcb8a460 100644 (file)
 # error This library requires C++
 #endif                                   
 
+#include <osg/Version>
+
+#define FG_OSG_VERSION \
+    ((OPENSCENEGRAPH_MAJOR_VERSION*10000)\
+     + (OPENSCENEGRAPH_MINOR_VERSION*1000) + OPENSCENEGRAPH_PATCH_VERSION)
 
 // #define FANCY_FRAME_COUNTER
 #ifdef FANCY_FRAME_COUNTER
index e4a96b3bff6d2dd8ca6fbed4c1763a41d068ab10..b83278cb3acac8268cdc1661a866393bbcaf9ce2 100644 (file)
@@ -61,6 +61,7 @@ SG_USING_STD(setfill);
 #include <AIModel/AIManager.hxx>
 #include <AIModel/AIBallistic.hxx>
 
+#include <Include/general.hxx>
 #include "instrument_mgr.hxx"
 #include "od_gauge.hxx"
 #include "wxradar.hxx"
@@ -869,7 +870,7 @@ wxRadarBg::updateFont()
     } else {
         tpath = path;
     }
-#if OSG_VERSION_MAJOR > 2 || (OSG_VERSION_MAJOR == 2 && OSG_VERSION_MINOR > 0)
+#if (FG_OSG_VERSION >= 21000)
     osg::ref_ptr<osgDB::ReaderWriter::Options> fontOptions = new osgDB::ReaderWriter::Options("monochrome");
     osg::ref_ptr<osgText::Font> font = osgText::readFontFile(tpath.c_str(), fontOptions.get());    
 #else    
index afd55c976f04ccf3fd988c44b512a43eb57dbbd5..71600824d206e09f07141cd1dc11f2d32cd24aa0 100644 (file)
 #include <osgViewer/Viewer>
 #include <osgGA/MatrixManipulator>
 
+#include <Include/general.hxx>
 #include "fg_os.hxx"
 #include "fg_props.hxx"
 #include "util.hxx"
 #include "globals.hxx"
 #include "renderer.hxx"
 
-#if ((2 <= OSG_VERSION_MAJOR) || \
-     (1 == OSG_VERSION_MAJOR) && (9 == OSG_VERSION_MINOR) &&   \
-     (8 <= OSG_VERSION_PATCH)) || \
-    ((1 == OSG_VERSION_MAJOR) && (9 < OSG_VERSION_MINOR)) ||      \
-    (1 < OSG_VERSION_MAJOR)
+#if (FG_OSG_VERSION >= 19008)
 #define OSG_HAS_MOUSE_CURSOR_PATCH
 #endif
 
index bbb7557e2e99f352ed3ab0d138176d36133d5d77..59b87974352e7091581dd4f14c133b8ebb19f56a 100644 (file)
 #include <Instrumentation/instrument_mgr.hxx>
 #include <Instrumentation/HUD/HUD.hxx>
 
+#include <Include/general.hxx>
 #include "splash.hxx"
 #include "renderer.hxx"
 #include "main.hxx"
 
 // XXX Make this go away when OSG 2.2 is released.
-#if ((2 <= OSG_VERSION_MAJOR) && (1 <= OSG_VERSION_MINOR) \
-     && (4 <= OSG_VERSION_PATCH))
+#if (FG_OSG_VERSION >= 21004)
 #define UPDATE_VISITOR_IN_VIEWER 1
 #endif