]> git.mxchange.org Git - simgear.git/commitdiff
Make SimGear compile with osg trunk
authorfrohlich <frohlich>
Sat, 16 May 2009 08:13:52 +0000 (08:13 +0000)
committerTim Moore <timoore@redhat.com>
Sat, 16 May 2009 14:18:54 +0000 (16:18 +0200)
Modified Files:
simgear/scene/model/SGPagedLOD.cxx
  simgear/scene/model/SGPagedLOD.hxx
  simgear/scene/sky/cloud.cxx simgear/scene/sky/moon.cxx
simgear/structure/OSGVersion.hxx

simgear/scene/model/SGPagedLOD.cxx
simgear/scene/model/SGPagedLOD.hxx
simgear/scene/sky/cloud.cxx
simgear/scene/sky/moon.cxx
simgear/structure/OSGVersion.hxx

index fee5dee4eb6fca67b2dea9c4aaf32bf6d4228192..b45af2046b9a55ecbca47272058c088896336dd3 100644 (file)
@@ -75,9 +75,7 @@ void SGPagedLOD::forceLoad(osgDB::DatabasePager *dbp)
     setTimeStamp(childNum, 0);
     double priority=1.0;
     dbp->requestNodeFile(getFileName(childNum),this,priority,0,
-#if SG_OSG_VERSION >= 25001
                          getDatabaseRequest(childNum),
-#endif
                          _readerWriterOptions.get());
 }
 
index 40e59ae79e270875949c2d5708aff0932582deff..7bf54266ce9b1f50452f7d18a28189f4159b7161 100644 (file)
 #ifndef SGPAGEDLOD_HXX
 #define SGPAGEDLOD_HXX 1
 
+#include <simgear/structure/OSGVersion.hxx>
 #include <osg/PagedLOD>
+#if SG_OSG_MIN_VERSION_REQUIRED(2,9,5)
+#include <osgDB/Options>
+#endif
 #include <osgDB/ReaderWriter>
 #include <simgear/props/props.hxx>
 
@@ -44,19 +48,21 @@ public:
     // reimplemented to notify the loading through ModelData
     bool addChild(osg::Node *child);
 
-    void setReaderWriterOptions(osgDB::ReaderWriter::Options *o) {
-        _readerWriterOptions=o;
-        _readerWriterOptions->setObjectCacheHint(osgDB::ReaderWriter::Options::CACHE_NONE);
+    void setReaderWriterOptions(osgDB::ReaderWriter::Options *options) {
+        _readerWriterOptions = options;
+        options->setObjectCacheHint(osgDB::ReaderWriter::Options::CACHE_NONE);
+#if SG_OSG_MIN_VERSION_REQUIRED(2,9,5)
+        setDatabaseOptions(options);
+#endif
     }
 
-    osgDB::ReaderWriter::Options * getReaderWriterOptions() {
+    osgDB::ReaderWriter::Options* getReaderWriterOptions() {
         return _readerWriterOptions.get();
     }
 
 protected:
     virtual ~SGPagedLOD();
     osg::ref_ptr<osgDB::ReaderWriter::Options> _readerWriterOptions;
-    SGPropertyNode_ptr _props;
 };
 }
 #endif
index da61f7fc8e3258eb2e7a22c5b668bf654da22038..0addf208e55b66ecd46db90bb43c90b9cb64a24c 100644 (file)
@@ -30,6 +30,7 @@
 
 #include <math.h>
 
+#include <simgear/structure/OSGVersion.hxx>
 #include <osg/AlphaFunc>
 #include <osg/BlendFunc>
 #include <osg/CullFace>
@@ -43,6 +44,9 @@
 #include <osg/TextureCubeMap>
 #include <osg/TexMat>
 #include <osg/Fog>
+#if SG_OSG_MIN_VERSION_REQUIRED(2,9,5)
+#include <osgDB/Options>
+#endif
 
 #include <simgear/math/sg_random.h>
 #include <simgear/misc/PathOptions.hxx>
index 7ad47bba3effeb1b349e5fdab53a68d77649bc4e..20e1f2b078974c2bce9911078641069024abcce9 100644 (file)
@@ -32,6 +32,7 @@
 #include <stdio.h>
 #include <iostream>
 
+#include <simgear/structure/OSGVersion.hxx>
 #include <osg/Array>
 #include <osg/AlphaFunc>
 #include <osg/BlendFunc>
@@ -42,6 +43,9 @@
 #include <osg/ShadeModel>
 #include <osg/TexEnv>
 #include <osg/Texture2D>
+#if SG_OSG_MIN_VERSION_REQUIRED(2,9,5)
+#include <osgDB/Options>
+#endif
 
 #include <simgear/constants.h>
 #include <simgear/screen/colors.hxx>
index e8dd8e265dc21aa1322ff9f649d41da2ced6064b..46d0187e40dcaea746baa18589218ad123844752 100644 (file)
 #define SG_OSG_VERSION \
     ((OPENSCENEGRAPH_MAJOR_VERSION*10000)\
      + (OPENSCENEGRAPH_MINOR_VERSION*1000) + OPENSCENEGRAPH_PATCH_VERSION)
+
+#define SG_OSG_VERSION_GREATER_EQUAL(MAJOR, MINOR, PATCH) \
+  ((OPENSCENEGRAPH_MAJOR_VERSION > (MAJOR)) ||            \
+   (OPENSCENEGRAPH_MAJOR_VERSION == (MAJOR) &&            \
+    (OPENSCENEGRAPH_MINOR_VERSION > (MINOR) ||            \
+     (OPENSCENEGRAPH_MINOR_VERSION == (MINOR) &&          \
+      OPENSCENEGRAPH_PATCH_VERSION >= (PATCH)))))
+
+#define SG_OSG_VERSION_GREATER_THAN(MAJOR, MINOR, PATCH)  \
+  ((OPENSCENEGRAPH_MAJOR_VERSION > (MAJOR)) ||            \
+   (OPENSCENEGRAPH_MAJOR_VERSION == (MAJOR) &&            \
+    (OPENSCENEGRAPH_MINOR_VERSION > (MINOR) ||            \
+     (OPENSCENEGRAPH_MINOR_VERSION == (MINOR) &&          \
+      OPENSCENEGRAPH_PATCH_VERSION > (PATCH)))))
+
+#define SG_OSG_VERSION_LESS_THAN(MAJOR, MINOR, PATCH)  \
+  (!SG_OSG_VERSION_GREATER_EQUAL(MAJOR, MINOR, PATCH))
+
+#define SG_OSG_VERSION_LESS_EQUAL(MAJOR, MINOR, PATCH)  \
+  (!SG_OSG_VERSION_GREATER_THAN(MAJOR, MINOR, PATCH))
+
+#define SG_OSG_MIN_VERSION_REQUIRED(MAJOR, MINOR, PATCH) \
+  SG_OSG_VERSION_GREATER_EQUAL(MAJOR, MINOR, PATCH)
+
 #endif