diff --git a/CMakeLists.txt b/CMakeLists.txt index 450eed05f..848d3d941 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -80,6 +80,7 @@ INCLUDE_DIRECTORIES( # Platform specific definitions IF(WIN32) + ADD_DEFINITIONS(-D_SCL_SECURE_NO_WARNINGS) #needed for net plugin SET (OSG_SOCKET_LIBS wsock32.lib) # Both Cygwin and Msys need -DNOMINMAX ??? diff --git a/include/osg/BufferObject b/include/osg/BufferObject index 46b35be81..d28963173 100644 --- a/include/osg/BufferObject +++ b/include/osg/BufferObject @@ -255,7 +255,7 @@ class OSG_EXPORT VertexBufferObject : public BufferObject Array* getArray(unsigned int i) { return _bufferEntryArrayPairs[i].second; } const Array* getArray(unsigned int i) const { return _bufferEntryArrayPairs[i].second; } - const GLvoid* getOffset(unsigned int i) const { return (const GLvoid*)(_bufferEntryArrayPairs[i].first.offset); } + const GLvoid* getOffset(unsigned int i) const { return (const GLvoid*)(((char *)0)+(_bufferEntryArrayPairs[i].first.offset)); } virtual void compileBuffer(State& state) const; @@ -291,7 +291,7 @@ class OSG_EXPORT ElementBufferObject : public BufferObject DrawElements* getDrawElements(unsigned int i) { return _bufferEntryDrawElementsPairs[i].second; } const DrawElements* getDrawElements(unsigned int i) const { return _bufferEntryDrawElementsPairs[i].second; } - const GLvoid* getOffset(unsigned int i) const { return (const GLvoid*)(_bufferEntryDrawElementsPairs[i].first.offset); } + const GLvoid* getOffset(unsigned int i) const { return (const GLvoid*)(((char *)0)+(_bufferEntryDrawElementsPairs[i].first.offset)); } virtual void compileBuffer(State& state) const; diff --git a/src/osgPlugins/ac/ac3d.cpp b/src/osgPlugins/ac/ac3d.cpp index 0d00d72ff..1d727e1bd 100644 --- a/src/osgPlugins/ac/ac3d.cpp +++ b/src/osgPlugins/ac/ac3d.cpp @@ -611,19 +611,19 @@ class PrimitiveBin : public osg::Referenced protected: bool isLineLoop() const { - return _flags & SurfaceTypeLineLoop; + return (_flags & SurfaceTypeLineLoop)!=0; } bool isLineStrip() const { - return _flags & SurfaceTypeLineStrip; + return (_flags & SurfaceTypeLineStrip)!=0; } bool isTwoSided() const { - return _flags & SurfaceTwoSided; + return (_flags & SurfaceTwoSided)!=0; } bool isSmooth() const { - return _flags & SurfaceShaded; + return (_flags & SurfaceShaded)!=0; } osg::ref_ptr _geode; diff --git a/src/osgPlugins/osg/Sequence.cpp b/src/osgPlugins/osg/Sequence.cpp index 1ad747cc7..331fb4298 100644 --- a/src/osgPlugins/osg/Sequence.cpp +++ b/src/osgPlugins/osg/Sequence.cpp @@ -170,7 +170,7 @@ bool Sequence_readLocalData(Object& obj, Input& fr) { int sync ; fr[1].getInt(sync) ; - sw.setSync((bool)sync) ; + sw.setSync(sync!=0) ; iteratorAdvanced = true; fr += 2; } @@ -181,7 +181,7 @@ bool Sequence_readLocalData(Object& obj, Input& fr) { int clearOnStop ; fr[1].getInt(clearOnStop) ; - sw.setClearOnStop((bool)clearOnStop) ; + sw.setClearOnStop(clearOnStop!=0) ; iteratorAdvanced = true; fr += 2; }