1
0
Fork 0

Make comparisons against OSG version less flakey

Turn OPENSCENEGRAPH_MAJOR_VERSION, OPENSCENEGRAPH_MINOR_VERSION and
OPENSCENEGRAPH_PATCH_VERSION into a single number for comparisons in the
preprocessor.
This commit is contained in:
timoore 2007-10-04 20:40:29 +00:00
parent 37cc06e335
commit 411435a48f
5 changed files with 14 additions and 9 deletions

View file

@ -410,7 +410,9 @@ void FGClouds::buildScenario( const string& scenario ) {
} }
for(int iLayer = 0 ; iLayer < thesky->get_cloud_layer_count(); iLayer++) { 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 "; station += " 011000Z ";

View file

@ -31,6 +31,11 @@
# error This library requires C++ # error This library requires C++
#endif #endif
#include <osg/Version>
#define FG_OSG_VERSION \
((OPENSCENEGRAPH_MAJOR_VERSION*10000)\
+ (OPENSCENEGRAPH_MINOR_VERSION*1000) + OPENSCENEGRAPH_PATCH_VERSION)
// #define FANCY_FRAME_COUNTER // #define FANCY_FRAME_COUNTER
#ifdef FANCY_FRAME_COUNTER #ifdef FANCY_FRAME_COUNTER

View file

@ -61,6 +61,7 @@ SG_USING_STD(setfill);
#include <AIModel/AIManager.hxx> #include <AIModel/AIManager.hxx>
#include <AIModel/AIBallistic.hxx> #include <AIModel/AIBallistic.hxx>
#include <Include/general.hxx>
#include "instrument_mgr.hxx" #include "instrument_mgr.hxx"
#include "od_gauge.hxx" #include "od_gauge.hxx"
#include "wxradar.hxx" #include "wxradar.hxx"
@ -869,7 +870,7 @@ wxRadarBg::updateFont()
} else { } else {
tpath = path; 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<osgDB::ReaderWriter::Options> fontOptions = new osgDB::ReaderWriter::Options("monochrome");
osg::ref_ptr<osgText::Font> font = osgText::readFontFile(tpath.c_str(), fontOptions.get()); osg::ref_ptr<osgText::Font> font = osgText::readFontFile(tpath.c_str(), fontOptions.get());
#else #else

View file

@ -18,17 +18,14 @@
#include <osgViewer/Viewer> #include <osgViewer/Viewer>
#include <osgGA/MatrixManipulator> #include <osgGA/MatrixManipulator>
#include <Include/general.hxx>
#include "fg_os.hxx" #include "fg_os.hxx"
#include "fg_props.hxx" #include "fg_props.hxx"
#include "util.hxx" #include "util.hxx"
#include "globals.hxx" #include "globals.hxx"
#include "renderer.hxx" #include "renderer.hxx"
#if ((2 <= OSG_VERSION_MAJOR) || \ #if (FG_OSG_VERSION >= 19008)
(1 == OSG_VERSION_MAJOR) && (9 == OSG_VERSION_MINOR) && \
(8 <= OSG_VERSION_PATCH)) || \
((1 == OSG_VERSION_MAJOR) && (9 < OSG_VERSION_MINOR)) || \
(1 < OSG_VERSION_MAJOR)
#define OSG_HAS_MOUSE_CURSOR_PATCH #define OSG_HAS_MOUSE_CURSOR_PATCH
#endif #endif

View file

@ -98,13 +98,13 @@
#include <Instrumentation/instrument_mgr.hxx> #include <Instrumentation/instrument_mgr.hxx>
#include <Instrumentation/HUD/HUD.hxx> #include <Instrumentation/HUD/HUD.hxx>
#include <Include/general.hxx>
#include "splash.hxx" #include "splash.hxx"
#include "renderer.hxx" #include "renderer.hxx"
#include "main.hxx" #include "main.hxx"
// XXX Make this go away when OSG 2.2 is released. // XXX Make this go away when OSG 2.2 is released.
#if ((2 <= OSG_VERSION_MAJOR) && (1 <= OSG_VERSION_MINOR) \ #if (FG_OSG_VERSION >= 21004)
&& (4 <= OSG_VERSION_PATCH))
#define UPDATE_VISITOR_IN_VIEWER 1 #define UPDATE_VISITOR_IN_VIEWER 1
#endif #endif