Merge branch 'maint' into next

This commit is contained in:
Tim Moore
2009-05-18 00:34:06 +02:00
13 changed files with 56 additions and 17 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
#include <string> #include <string>
#include "Debug/logstream.hxx" #include <simgear/debug/logstream.hxx>
class Test { class Test {
+6
View File
@@ -12,6 +12,7 @@ class TcpServer
{ {
public: public:
TcpServer(); TcpServer();
~TcpServer();
bool open(); bool open();
bool process(); bool process();
bool close(); bool close();
@@ -25,6 +26,11 @@ TcpServer::TcpServer()
channel = new SGSocket( "", "5500", "tcp" ); channel = new SGSocket( "", "5500", "tcp" );
} }
TcpServer::~TcpServer()
{
delete channel;
}
bool bool
TcpServer::open() TcpServer::open()
{ {
+1 -1
View File
@@ -35,7 +35,7 @@
#include <simgear/compiler.h> #include <simgear/compiler.h>
#include "simgear/structure/SGReferenced.hxx" #include <simgear/structure/SGReferenced.hxx>
#include <map> #include <map>
+1 -1
View File
@@ -21,10 +21,10 @@
// $Id$ // $Id$
#include <cstdlib> #include <cstdlib>
#include <assert.h>
#include "tabbed_values.hxx" #include "tabbed_values.hxx"
#include "assert.h"
SGTabbedValues::SGTabbedValues(const char *line) : SGTabbedValues::SGTabbedValues(const char *line) :
_line(line) _line(line)
-2
View File
@@ -75,9 +75,7 @@ void SGPagedLOD::forceLoad(osgDB::DatabasePager *dbp)
setTimeStamp(childNum, 0); setTimeStamp(childNum, 0);
double priority=1.0; double priority=1.0;
dbp->requestNodeFile(getFileName(childNum),this,priority,0, dbp->requestNodeFile(getFileName(childNum),this,priority,0,
#if SG_OSG_VERSION >= 25001
getDatabaseRequest(childNum), getDatabaseRequest(childNum),
#endif
_readerWriterOptions.get()); _readerWriterOptions.get());
} }
+11 -5
View File
@@ -17,7 +17,11 @@
#ifndef SGPAGEDLOD_HXX #ifndef SGPAGEDLOD_HXX
#define SGPAGEDLOD_HXX 1 #define SGPAGEDLOD_HXX 1
#include <simgear/structure/OSGVersion.hxx>
#include <osg/PagedLOD> #include <osg/PagedLOD>
#if SG_OSG_MIN_VERSION_REQUIRED(2,9,5)
#include <osgDB/Options>
#endif
#include <osgDB/ReaderWriter> #include <osgDB/ReaderWriter>
#include <simgear/props/props.hxx> #include <simgear/props/props.hxx>
@@ -44,19 +48,21 @@ public:
// reimplemented to notify the loading through ModelData // reimplemented to notify the loading through ModelData
bool addChild(osg::Node *child); bool addChild(osg::Node *child);
void setReaderWriterOptions(osgDB::ReaderWriter::Options *o) { void setReaderWriterOptions(osgDB::ReaderWriter::Options *options) {
_readerWriterOptions=o; _readerWriterOptions = options;
_readerWriterOptions->setObjectCacheHint(osgDB::ReaderWriter::Options::CACHE_NONE); 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(); return _readerWriterOptions.get();
} }
protected: protected:
virtual ~SGPagedLOD(); virtual ~SGPagedLOD();
osg::ref_ptr<osgDB::ReaderWriter::Options> _readerWriterOptions; osg::ref_ptr<osgDB::ReaderWriter::Options> _readerWriterOptions;
SGPropertyNode_ptr _props;
}; };
} }
#endif #endif
+4
View File
@@ -30,6 +30,7 @@
#include <math.h> #include <math.h>
#include <simgear/structure/OSGVersion.hxx>
#include <osg/AlphaFunc> #include <osg/AlphaFunc>
#include <osg/BlendFunc> #include <osg/BlendFunc>
#include <osg/CullFace> #include <osg/CullFace>
@@ -43,6 +44,9 @@
#include <osg/TextureCubeMap> #include <osg/TextureCubeMap>
#include <osg/TexMat> #include <osg/TexMat>
#include <osg/Fog> #include <osg/Fog>
#if SG_OSG_MIN_VERSION_REQUIRED(2,9,5)
#include <osgDB/Options>
#endif
#include <simgear/math/sg_random.h> #include <simgear/math/sg_random.h>
#include <simgear/misc/PathOptions.hxx> #include <simgear/misc/PathOptions.hxx>
+4
View File
@@ -32,6 +32,7 @@
#include <stdio.h> #include <stdio.h>
#include <iostream> #include <iostream>
#include <simgear/structure/OSGVersion.hxx>
#include <osg/Array> #include <osg/Array>
#include <osg/AlphaFunc> #include <osg/AlphaFunc>
#include <osg/BlendFunc> #include <osg/BlendFunc>
@@ -42,6 +43,9 @@
#include <osg/ShadeModel> #include <osg/ShadeModel>
#include <osg/TexEnv> #include <osg/TexEnv>
#include <osg/Texture2D> #include <osg/Texture2D>
#if SG_OSG_MIN_VERSION_REQUIRED(2,9,5)
#include <osgDB/Options>
#endif
#include <simgear/constants.h> #include <simgear/constants.h>
#include <simgear/screen/colors.hxx> #include <simgear/screen/colors.hxx>
+1
View File
@@ -55,6 +55,7 @@ bool sg_glWritePPMFile(const char *filename, GLubyte *buffer, int win_width, int
ibuffer = (unsigned char *) malloc(win_width*win_height*RGB3); ibuffer = (unsigned char *) malloc(win_width*win_height*RGB3);
if ( (fp = fopen(filename, "wb")) == NULL ) { if ( (fp = fopen(filename, "wb")) == NULL ) {
free(ibuffer);
printf("Warning: cannot open %s\n", filename); printf("Warning: cannot open %s\n", filename);
return false; return false;
} }
+24
View File
@@ -23,4 +23,28 @@
#define SG_OSG_VERSION \ #define SG_OSG_VERSION \
((OPENSCENEGRAPH_MAJOR_VERSION*10000)\ ((OPENSCENEGRAPH_MAJOR_VERSION*10000)\
+ (OPENSCENEGRAPH_MINOR_VERSION*1000) + OPENSCENEGRAPH_PATCH_VERSION) + (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 #endif
+1 -1
View File
@@ -11,7 +11,7 @@
# include <sys/time.h> # include <sys/time.h>
#endif #endif
#if _MSC_VER >= 1300 #if _MSC_VER >= 1300
# include "winsock2.h" # include <winsock2.h>
#endif #endif
#include "SGThread.hxx" #include "SGThread.hxx"
+1 -5
View File
@@ -122,11 +122,7 @@ SGTime::SGTime() {
SGTime::~SGTime() SGTime::~SGTime()
{ {
if ( tzContainer != NULL ) { delete tzContainer;
SGTimeZoneContainer *tmp = tzContainer;
tzContainer = NULL;
delete tmp;
}
} }
+1 -1
View File
@@ -53,7 +53,7 @@ particular environments. */
#ifdef MOZILLA #ifdef MOZILLA
#include "nspr.h" #include <nspr.h>
#define malloc(x) PR_Malloc(x) #define malloc(x) PR_Malloc(x)
#define realloc(x, y) PR_Realloc((x), (y)) #define realloc(x, y) PR_Realloc((x), (y))
#define calloc(x, y) PR_Calloc((x),(y)) #define calloc(x, y) PR_Calloc((x),(y))