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++) {
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 ";

View file

@ -31,6 +31,11 @@
# 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

View 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

View file

@ -18,17 +18,14 @@
#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

View file

@ -98,13 +98,13 @@
#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