Warning fixes for Clang-3.6

git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.4@15017 16af8721-9629-0410-8352-f15c8da7e697
This commit is contained in:
Robert Osfield 2015-07-23 11:14:00 +00:00
parent 482fd41d58
commit 34e53a37e0
31 changed files with 59 additions and 119 deletions

View File

@ -119,7 +119,6 @@ enum BufferOffset
const int __numDataValuesPerChannel = OFFSET_END; const int __numDataValuesPerChannel = OFFSET_END;
const int __numChannels = 4; const int __numChannels = 4;
const float __particleRenderScaleMultiplier = 0.3;
//512x512x4x7 = 7.340.032 floats in SSBO on GPU //512x512x4x7 = 7.340.032 floats in SSBO on GPU
const int NUM_ELEMENTS_X = 512; const int NUM_ELEMENTS_X = 512;

View File

@ -44,7 +44,6 @@
#include "broadcaster.h" #include "broadcaster.h"
const unsigned int MAX_NUM_EVENTS = 10;
const unsigned int SWAP_BYTES_COMPARE = 0x12345678; const unsigned int SWAP_BYTES_COMPARE = 0x12345678;
class CameraPacket { class CameraPacket {
public: public:

View File

@ -139,10 +139,8 @@ protected:
}; };
DepthPeeling::CullCallback::CullCallback(unsigned int texUnit, unsigned int texWidth, unsigned int texHeight, unsigned int offsetValue) : DepthPeeling::CullCallback::CullCallback(unsigned int texUnit, unsigned int offsetValue) :
_texUnit(texUnit), _texUnit(texUnit),
_texWidth(texWidth),
_texHeight(texHeight),
_offsetValue(offsetValue) _offsetValue(offsetValue)
{ {
} }
@ -317,7 +315,7 @@ void DepthPeeling::createPeeling()
// create some uniform and cull callback objects // create some uniform and cull callback objects
osg::Uniform *depthOff = new osg::Uniform("depthtest", (bool)false); osg::Uniform *depthOff = new osg::Uniform("depthtest", (bool)false);
osg::Uniform *depthOn = new osg::Uniform("depthtest", (bool)true); osg::Uniform *depthOn = new osg::Uniform("depthtest", (bool)true);
CullCallback *ccb = new CullCallback(_texUnit, _texWidth, _texHeight, _offsetValue); CullCallback *ccb = new CullCallback(_texUnit, _offsetValue);
// create a node for solid model rendering // create a node for solid model rendering
osg::Group *pre_solidNode = new osg::Group; osg::Group *pre_solidNode = new osg::Group;
@ -412,7 +410,7 @@ void DepthPeeling::createPeeling()
_compositeCamera->setReferenceFrame(osg::Transform::ABSOLUTE_RF); _compositeCamera->setReferenceFrame(osg::Transform::ABSOLUTE_RF);
_compositeCamera->setViewMatrix(osg::Matrix()); _compositeCamera->setViewMatrix(osg::Matrix());
_compositeCamera->setProjectionMatrix(osg::Matrix::ortho2D(0, 1, 0, 1)); _compositeCamera->setProjectionMatrix(osg::Matrix::ortho2D(0, 1, 0, 1));
_compositeCamera->setCullCallback(new CullCallback(0, _texWidth, _texHeight, 0)); _compositeCamera->setCullCallback(new CullCallback(0, 0));
osg::StateSet* stateSet = _compositeCamera->getOrCreateStateSet(); osg::StateSet* stateSet = _compositeCamera->getOrCreateStateSet();
stateSet->setRenderBinDetails(100, "TraversalOrderBin", osg::StateSet::OVERRIDE_RENDERBIN_DETAILS); stateSet->setRenderBinDetails(100, "TraversalOrderBin", osg::StateSet::OVERRIDE_RENDERBIN_DETAILS);
_root->addChild(_compositeCamera.get()); _root->addChild(_compositeCamera.get());

View File

@ -63,13 +63,11 @@ protected:
class CullCallback : public osg::NodeCallback { class CullCallback : public osg::NodeCallback {
public: public:
CullCallback(unsigned int texUnit, unsigned int texWidth, unsigned int texHeight, unsigned int offsetValue); CullCallback(unsigned int texUnit, unsigned int offsetValue);
virtual void operator()(osg::Node* node, osg::NodeVisitor* nv); virtual void operator()(osg::Node* node, osg::NodeVisitor* nv);
private: private:
unsigned int _texUnit; unsigned int _texUnit;
unsigned int _texWidth;
unsigned int _texHeight;
unsigned int _offsetValue; unsigned int _offsetValue;
}; };

View File

@ -340,10 +340,11 @@ public:
itr!=parents.end(); itr!=parents.end();
++itr) ++itr)
{ {
if (typeid(*(*itr))==typeid(osg::Group)) osg::Group* parent = (*itr);
if (typeid(*parent)==typeid(osg::Group))
{ {
++numGroupsFound; ++numGroupsFound;
insertGroup = *itr; insertGroup = parent;
} }
} }
if (numGroupsFound==parents.size() && numGroupsFound==1 && insertGroup) if (numGroupsFound==parents.size() && numGroupsFound==1 && insertGroup)

View File

@ -479,8 +479,6 @@ namespace ModelTwo
{ {
osg::Vec3 center(0.0f,0.0f,0.0f); osg::Vec3 center(0.0f,0.0f,0.0f);
float radius = 100.0f; float radius = 100.0f;
osg::Vec3 lightPosition(center+osg::Vec3(0.0f,0.0f,radius));
// the shadower model // the shadower model
osg::Node* shadower = createMovingModel(center,radius*0.5f); osg::Node* shadower = createMovingModel(center,radius*0.5f);
shadower->setNodeMask(CastsShadowTraversalMask); shadower->setNodeMask(CastsShadowTraversalMask);

View File

@ -261,7 +261,6 @@ osg::Node* createModel()
{ {
osg::Vec3 center(0.0f,0.0f,0.0f); osg::Vec3 center(0.0f,0.0f,0.0f);
float radius = 100.0f; float radius = 100.0f;
osg::Vec3 lightPosition(center+osg::Vec3(0.0f,0.0f,radius));
// the shadower model // the shadower model
osg::Node* shadower = createMovingModel(center,radius*0.5f); osg::Node* shadower = createMovingModel(center,radius*0.5f);

View File

@ -14,7 +14,6 @@
#include <osgWidget/ViewerEventHandlers> #include <osgWidget/ViewerEventHandlers>
const unsigned int MASK_2D = 0xF0000000; const unsigned int MASK_2D = 0xF0000000;
const unsigned int MASK_3D = 0x0F000000;
class Notebook: public osgWidget::Box { class Notebook: public osgWidget::Box {
osg::ref_ptr<osgWidget::Box> _tabs; osg::ref_ptr<osgWidget::Box> _tabs;

View File

@ -5557,13 +5557,11 @@ static void empty_image(const PixelStorageModes *psm,
* Decimation of packed pixel types * Decimation of packed pixel types
*-------------------------------------------------------------------------- *--------------------------------------------------------------------------
*/ */
static void extract332(int isSwap, static void extract332(int /*isSwap*/,
const void *packedPixel, GLfloat extractComponents[]) const void *packedPixel, GLfloat extractComponents[])
{ {
GLubyte ubyte= *(const GLubyte *)packedPixel; GLubyte ubyte= *(const GLubyte *)packedPixel;
isSwap= isSwap; /* turn off warnings */
/* 11100000 == 0xe0 */ /* 11100000 == 0xe0 */
/* 00011100 == 0x1c */ /* 00011100 == 0x1c */
/* 00000011 == 0x03 */ /* 00000011 == 0x03 */
@ -5593,13 +5591,11 @@ static void shove332(const GLfloat shoveComponents[],
((GLubyte)((shoveComponents[2] * 3)+0.5) ) & 0x03; ((GLubyte)((shoveComponents[2] * 3)+0.5) ) & 0x03;
} /* shove332() */ } /* shove332() */
static void extract233rev(int isSwap, static void extract233rev(int /*isSwap*/,
const void *packedPixel, GLfloat extractComponents[]) const void *packedPixel, GLfloat extractComponents[])
{ {
GLubyte ubyte= *(const GLubyte *)packedPixel; GLubyte ubyte= *(const GLubyte *)packedPixel;
isSwap= isSwap; /* turn off warnings */
/* 0000,0111 == 0x07 */ /* 0000,0111 == 0x07 */
/* 0011,1000 == 0x38 */ /* 0011,1000 == 0x38 */
/* 1100,0000 == 0xC0 */ /* 1100,0000 == 0xC0 */
@ -8559,10 +8555,8 @@ GLint GLAPIENTRY gluBuild3DMipmaps(GLTexImage3DProc gluTexImage3D,
data); data);
} /* gluBuild3DMipmaps() */ } /* gluBuild3DMipmaps() */
static GLdouble extractUbyte(int isSwap, const void *ubyte) static GLdouble extractUbyte(int /*isSwap*/, const void *ubyte)
{ {
isSwap= isSwap; /* turn off warnings */
return (GLdouble)(*((const GLubyte *)ubyte)); return (GLdouble)(*((const GLubyte *)ubyte));
} /* extractUbyte() */ } /* extractUbyte() */
@ -8573,10 +8567,8 @@ static void shoveUbyte(GLdouble value, int index, void *data)
((GLubyte *)data)[index]= (GLubyte)value; ((GLubyte *)data)[index]= (GLubyte)value;
} /* shoveUbyte() */ } /* shoveUbyte() */
static GLdouble extractSbyte(int isSwap, const void *sbyte) static GLdouble extractSbyte(int /*isSwap*/, const void *sbyte)
{ {
isSwap= isSwap; /* turn off warnings */
return (GLdouble)(*((const GLbyte *)sbyte)); return (GLdouble)(*((const GLbyte *)sbyte));
} /* extractSbyte() */ } /* extractSbyte() */

View File

@ -317,8 +317,9 @@ namespace osgDB
} }
// Allocate memory for use with osg::Image // Allocate memory for use with osg::Image
char* allocated_out = new char[stream_out.tellp()]; const std::string str = stream_out.str();
memcpy(allocated_out, stream_out.str().c_str(), stream_out.tellp()); char* allocated_out = new char[str.size()];
memcpy(allocated_out, str.c_str(), str.size());
return allocated_out; return allocated_out;
} }

View File

@ -136,7 +136,6 @@ public:
_listTriangles(listTriangles), _listTriangles(listTriangles),
_hasNormalCoords(geo->getNormalArray() != NULL), _hasNormalCoords(geo->getNormalArray() != NULL),
_hasTexCoords(geo->getTexCoordArray(0) != NULL), _hasTexCoords(geo->getTexCoordArray(0) != NULL),
_geo(geo),
_lastFaceIndex(0), _lastFaceIndex(0),
_material(material) _material(material)
{ {
@ -288,7 +287,6 @@ private:
GLenum _modeCache; GLenum _modeCache;
std::vector<GLuint> _indexCache; std::vector<GLuint> _indexCache;
bool _hasNormalCoords, _hasTexCoords; bool _hasNormalCoords, _hasTexCoords;
osg::Geometry* _geo;
unsigned int _lastFaceIndex; unsigned int _lastFaceIndex;
unsigned int _material; unsigned int _material;
}; };

View File

@ -68,7 +68,7 @@ FltExportVisitor::FltExportVisitor( DataOutputStream* dos,
_dos( *dos ), _dos( *dos ),
_materialPalette( new MaterialPaletteManager( *fltOpt ) ), _materialPalette( new MaterialPaletteManager( *fltOpt ) ),
_texturePalette( new TexturePaletteManager( *this, *fltOpt ) ), _texturePalette( new TexturePaletteManager( *this, *fltOpt ) ),
_lightSourcePalette( new LightSourcePaletteManager( *fltOpt ) ), _lightSourcePalette( new LightSourcePaletteManager( ) ),
_vertexPalette( new VertexPaletteManager( *fltOpt ) ), _vertexPalette( new VertexPaletteManager( *fltOpt ) ),
_firstNode( true ) _firstNode( true )
{ {

View File

@ -28,10 +28,8 @@ namespace flt
{ {
LightSourcePaletteManager::LightSourcePaletteManager( ExportOptions& fltOpt ) LightSourcePaletteManager::LightSourcePaletteManager()
: _currIndex( -1 ), : _currIndex( -1 )
_fltOpt( fltOpt )
{ {
// TODO: Pay attention to the version here(?) // TODO: Pay attention to the version here(?)
} }

View File

@ -36,7 +36,7 @@ class DataOutputStream;
class LightSourcePaletteManager class LightSourcePaletteManager
{ {
public: public:
LightSourcePaletteManager( ExportOptions& fltOpt ); LightSourcePaletteManager();
// Add a light to the palette and auto-assign it the next available index // Add a light to the palette and auto-assign it the next available index
int add(osg::Light const* light); int add(osg::Light const* light);
@ -64,9 +64,6 @@ class LightSourcePaletteManager
typedef std::map<osg::Light const*, LightRecord> LightPalette; typedef std::map<osg::Light const*, LightRecord> LightPalette;
LightPalette _lightPalette; LightPalette _lightPalette;
ExportOptions& _fltOpt;
protected: protected:
LightSourcePaletteManager& operator = (const LightSourcePaletteManager&) { return *this; } LightSourcePaletteManager& operator = (const LightSourcePaletteManager&) { return *this; }

View File

@ -952,14 +952,15 @@ protected:
if (_parent.valid()) if (_parent.valid())
{ {
// LODs adds an empty child group so it is safe to remove this object record. // LODs adds an empty child group so it is safe to remove this object record.
if (typeid(*_parent)==typeid(flt::LevelOfDetail)) PrimaryRecord* parent = _parent.get();
if (typeid(parent)==typeid(flt::LevelOfDetail))
return true; return true;
if (typeid(*_parent)==typeid(flt::OldLevelOfDetail)) if (typeid(parent)==typeid(flt::OldLevelOfDetail))
return true; return true;
// If parent is a Group record we have to check for animation. // If parent is a Group record we have to check for animation.
Group* parentGroup = dynamic_cast<flt::Group*>(_parent.get()); Group* parentGroup = dynamic_cast<flt::Group*>(parent);
if (parentGroup && !parentGroup->hasAnimation()) if (parentGroup && !parentGroup->hasAnimation())
return true; return true;
} }

View File

@ -163,10 +163,10 @@ FltExportVisitor::writeHeader( const std::string& headerName )
// Group flags // Group flags
static const unsigned int FORWARD_ANIM = 0x80000000u >> 1; static const unsigned int FORWARD_ANIM = 0x80000000u >> 1;
static const unsigned int SWING_ANIM = 0x80000000u >> 2; static const unsigned int SWING_ANIM = 0x80000000u >> 2;
static const unsigned int BOUND_BOX_FOLLOW = 0x80000000u >> 3; //static const unsigned int BOUND_BOX_FOLLOW = 0x80000000u >> 3;
static const unsigned int FREEZE_BOUND_BOX = 0x80000000u >> 4; //static const unsigned int FREEZE_BOUND_BOX = 0x80000000u >> 4;
static const unsigned int DEFAULT_PARENT = 0x80000000u >> 5; //static const unsigned int DEFAULT_PARENT = 0x80000000u >> 5;
static const unsigned int BACKWARD_ANIM = 0x80000000u >> 6; //static const unsigned int BACKWARD_ANIM = 0x80000000u >> 6;
// //
@ -402,8 +402,8 @@ FltExportVisitor::writeDegreeOfFreedom( const osgSim::DOFTransform* dof )
static const unsigned long COLOR_PALETTE_OVERRIDE = 0x80000000u >> 0; static const unsigned long COLOR_PALETTE_OVERRIDE = 0x80000000u >> 0;
static const unsigned long MATERIAL_PALETTE_OVERRIDE = 0x80000000u >> 1; static const unsigned long MATERIAL_PALETTE_OVERRIDE = 0x80000000u >> 1;
static const unsigned long TEXTURE_PALETTE_OVERRIDE = 0x80000000u >> 2; static const unsigned long TEXTURE_PALETTE_OVERRIDE = 0x80000000u >> 2;
static const unsigned long LINE_STYLE_PALETTE_OVERRIDE = 0x80000000u >> 3; //static const unsigned long LINE_STYLE_PALETTE_OVERRIDE = 0x80000000u >> 3;
static const unsigned long SOUND_PALETTE_OVERRIDE = 0x80000000u >> 4; //static const unsigned long SOUND_PALETTE_OVERRIDE = 0x80000000u >> 4;
static const unsigned long LIGHT_SOURCE_PALETTE_OVERRIDE = 0x80000000u >> 5; static const unsigned long LIGHT_SOURCE_PALETTE_OVERRIDE = 0x80000000u >> 5;
static const unsigned long LIGHT_POINT_PALETTE_OVERRIDE = 0x80000000u >> 6; static const unsigned long LIGHT_POINT_PALETTE_OVERRIDE = 0x80000000u >> 6;
static const unsigned long SHADER_PALETTE_OVERRIDE = 0x80000000u >> 7; static const unsigned long SHADER_PALETTE_OVERRIDE = 0x80000000u >> 7;

View File

@ -114,7 +114,7 @@ FT_Byte* FreeTypeLibrary::getFace(std::istream& fontstream, unsigned int index,
std::streampos length = end - start; std::streampos length = end - start;
/* empty stream into memory, open that, and keep the pointer in a FreeTypeFont for cleanup */ /* empty stream into memory, open that, and keep the pointer in a FreeTypeFont for cleanup */
FT_Byte *buffer = new FT_Byte[length]; FT_Byte *buffer = new FT_Byte[static_cast<int>(length)];
fontstream.read(reinterpret_cast<char*>(buffer), length); fontstream.read(reinterpret_cast<char*>(buffer), length);
if (!fontstream || (static_cast<std::streampos>(fontstream.gcount()) != length)) if (!fontstream || (static_cast<std::streampos>(fontstream.gcount()) != length))
{ {

View File

@ -424,8 +424,6 @@ public:
{ {
out << getRequestPath() << "(int keycode): send KEY_DOWN and KEY_UP"; out << getRequestPath() << "(int keycode): send KEY_DOWN and KEY_UP";
} }
private:
bool _handleKeyPress;
}; };

View File

@ -54,18 +54,26 @@
#if defined(__GLIBC__) || defined(__ANDROID__) || defined(__CYGWIN__) #if defined(__GLIBC__) || defined(__ANDROID__) || defined(__CYGWIN__)
#include <endian.h> #include <endian.h>
#if (__BYTE_ORDER == __LITTLE_ENDIAN) #if (__BYTE_ORDER == __LITTLE_ENDIAN)
#ifndef __LITTLE_ENDIAN__
#define __LITTLE_ENDIAN__ #define __LITTLE_ENDIAN__
#endif
#elif (__BYTE_ORDER == __BIG_ENDIAN) #elif (__BYTE_ORDER == __BIG_ENDIAN)
#ifndef __BIG_ENDIAN__
#define __BIG_ENDIAN__ #define __BIG_ENDIAN__
#endif
#else #else
#error Unknown machine endianness detected. #error Unknown machine endianness detected.
#endif #endif
#elif defined(__FreeBSD__) #elif defined(__FreeBSD__)
#include <sys/endian.h> #include <sys/endian.h>
#if (_BYTE_ORDER == _LITTLE_ENDIAN) #if (_BYTE_ORDER == _LITTLE_ENDIAN)
#ifndef __LITTLE_ENDIAN__
#define __LITTLE_ENDIAN__ #define __LITTLE_ENDIAN__
#endif
#elif (_BYTE_ORDER == _BIG_ENDIAN) #elif (_BYTE_ORDER == _BIG_ENDIAN)
#ifndef __BIG_ENDIAN__
#define __BIG_ENDIAN__ #define __BIG_ENDIAN__
#endif
#else #else
#error Unknown machine endianness detected. #error Unknown machine endianness detected.
#endif #endif

View File

@ -94,8 +94,8 @@ class OSGA_Archive : public osgDB::Archive
typedef __int64 pos_type; typedef __int64 pos_type;
typedef __int64 size_type; typedef __int64 size_type;
#else #else
typedef unsigned long long pos_type; typedef long long pos_type;
typedef unsigned long long size_type; typedef long long size_type;
#endif #endif
typedef std::pair<pos_type, size_type> PositionSizePair; typedef std::pair<pos_type, size_type> PositionSizePair;

View File

@ -77,9 +77,8 @@ using namespace osgShadow;
const osg::Matrix & ConvexPolyhedron::defaultMatrix = *(osg::Matrix*)NULL; const osg::Matrix & ConvexPolyhedron::defaultMatrix = *(osg::Matrix*)NULL;
static const double epsi = pow( 2.0, -20.0 ); //circa 8 times float prec(~2^-23) static const double epsi = pow( 2.0, -20.0 ); //circa 8 times float prec(~2^-23)
static const double plane_hull_tolerance = 1.0e-5; static const double plane_hull_tolerance = 1.0e-5;
static const double point_plane_tolerance = 0; static const double point_plane_tolerance = 0.0;
static const double point_point_tolerance = 0; static const double point_point_equivalence = 0.;
static const double point_point_equivalence = 0;
// Tim Moore modifications for GCC 4.3 August 15, 2008 // Tim Moore modifications for GCC 4.3 August 15, 2008
// they correspond to Adrian Egli tweaks for VS 7.3 on August 19, 2008 // they correspond to Adrian Egli tweaks for VS 7.3 on August 19, 2008

View File

@ -225,7 +225,8 @@ void DebugShadowMap::ViewData::setDebugPolytope
{ {
if( !getDebugDraw() ) return; if( !getDebugDraw() ) return;
if( &polytope == NULL ) { // delete const ConvexPolyhedron* polytope_ptr = &polytope;
if( polytope_ptr == NULL ) { // delete
PolytopeGeometry & pg = _polytopeGeometryMap[ std::string( name ) ]; PolytopeGeometry & pg = _polytopeGeometryMap[ std::string( name ) ];
for( unsigned int i = 0; i < VECTOR_LENGTH( pg._geometry ) ; i++ ) for( unsigned int i = 0; i < VECTOR_LENGTH( pg._geometry ) ; i++ )
{ {

View File

@ -787,8 +787,6 @@ void OccluderGeometry::computeShadowVolumeGeometry(const osg::Vec4& lightpos, Sh
UIntList silhouetteIndices; UIntList silhouetteIndices;
computeLightDirectionSilhouetteEdges(lightdirection, silhouetteIndices); computeLightDirectionSilhouetteEdges(lightdirection, silhouetteIndices);
osg::Vec3 offset( lightdirection*5.0f );
float directionScale = 1.0f / basePlane.dotProductNormal(lightdirection); float directionScale = 1.0f / basePlane.dotProductNormal(lightdirection);
for(UIntList::iterator itr = silhouetteIndices.begin(); for(UIntList::iterator itr = silhouetteIndices.begin();

View File

@ -60,16 +60,6 @@ static const char fragmentShaderSource_withBaseTexture[] =
////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////
// fragment shader // fragment shader
// //
static const char fragmentShaderSource_debugHUD_texcoord[] =
"uniform sampler2D osgShadow_shadowTexture; \n"
" \n"
"void main(void) \n"
"{ \n"
" vec4 texCoord = gl_TexCoord[1].xyzw; \n"
" float value = texCoord.z / texCoord.w; \n"
" gl_FragColor = vec4( value, value, value, 1.0 ); \n"
"} \n";
static const char fragmentShaderSource_debugHUD[] = static const char fragmentShaderSource_debugHUD[] =
"uniform sampler2D osgShadow_shadowTexture; \n" "uniform sampler2D osgShadow_shadowTexture; \n"
" \n" " \n"

View File

@ -893,7 +893,8 @@ struct ActivateTransparencyOnType
void operator()(osg::ref_ptr<osg::Node>& nptr) const void operator()(osg::ref_ptr<osg::Node>& nptr) const
{ {
if(typeid(*nptr)==_t) const osg::Node* ptr = nptr.get();
if(typeid(*ptr)==_t)
{ {
osg::Drawable* drawable = nptr->asDrawable(); osg::Drawable* drawable = nptr->asDrawable();
osg::StateSet* ss = drawable->getOrCreateStateSet(); osg::StateSet* ss = drawable->getOrCreateStateSet();
@ -919,7 +920,8 @@ struct DeactivateTransparencyOnType
void operator()(osg::ref_ptr<osg::Node>& nptr) const void operator()(osg::ref_ptr<osg::Node>& nptr) const
{ {
if(typeid(*nptr)==_t) const osg::Node* ptr = nptr.get();
if(typeid(*ptr)==_t)
{ {
osg::Drawable* drawable = nptr->asDrawable(); osg::Drawable* drawable = nptr->asDrawable();
osg::StateSet* ss = drawable->getOrCreateStateSet(); osg::StateSet* ss = drawable->getOrCreateStateSet();

View File

@ -993,7 +993,7 @@ bool DelaunayTriangulator::triangulate()
{ {
e1=titr->c(); e2=titr->a(); e1=titr->c(); e2=titr->a();
} }
else if (icut==3) else
{ {
e1=titr->a(); e2=titr->b(); e1=titr->a(); e2=titr->b();
} }

View File

@ -1563,11 +1563,12 @@ void Optimizer::CombineLODsVisitor::apply(osg::LOD& lod)
{ {
for(unsigned int i=0;i<lod.getNumParents();++i) for(unsigned int i=0;i<lod.getNumParents();++i)
{ {
if (typeid(*lod.getParent(i))==typeid(osg::Group)) osg::Group* parent = lod.getParent(i);
if (typeid(*parent)==typeid(osg::Group))
{ {
if (isOperationPermissibleForObject(&lod)) if (isOperationPermissibleForObject(&lod))
{ {
_groupList.insert(lod.getParent(i)->asGroup()); _groupList.insert(parent->asGroup());
} }
} }
} }

View File

@ -50,24 +50,6 @@ static const GLubyte patternVertEven[] = {
0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55,
0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55}; 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55};
static const GLubyte patternVertOdd[] = {
0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA};
static const GLubyte patternHorzEven[] = { static const GLubyte patternHorzEven[] = {
0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00,
0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00,

View File

@ -1311,23 +1311,6 @@ static const GLubyte patternVertEven[] = {
0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55,
0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55}; 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55};
static const GLubyte patternVertOdd[] = {
0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA};
static const GLubyte patternHorzEven[] = { static const GLubyte patternHorzEven[] = {
0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00,

View File

@ -23,15 +23,15 @@ REGISTER_DOTOSGWRAPPER(NodeCallback)
bool NodeCallback_readLocalData(osg::Object &obj, osgDB::Input &fr) bool NodeCallback_readLocalData(osg::Object &obj, osgDB::Input &fr)
{ {
NodeCallback& nc = dynamic_cast<NodeCallback&>(obj); NodeCallback* nc = dynamic_cast<NodeCallback*>(&obj);
if (!(&nc)) return false; if (!nc) return false;
bool itrAdvanced = false; bool itrAdvanced = false;
NodeCallback* ncc = fr.readObjectOfType<NodeCallback>(); NodeCallback* ncc = fr.readObjectOfType<NodeCallback>();
if (ncc) if (ncc)
{ {
nc.setNestedCallback(ncc); nc->setNestedCallback(ncc);
itrAdvanced = true; itrAdvanced = true;
} }