From 4d9bd4d82547ba70a5145c83458e9e0e6a901a7e Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Sun, 1 Aug 2004 08:26:44 +0000 Subject: [PATCH] Build fixes for gcc 3.4.1 support --- include/osg/Array | 12 +++--- include/osg/TriangleFunctor | 64 +++++++++++++++--------------- include/osg/TriangleIndexFunctor | 64 +++++++++++++++--------------- runexamples.bat | 7 +++- src/osgPlugins/lwo/lwo2parser.h | 4 +- src/osgUtil/TriStrip_graph_array.h | 2 +- 6 files changed, 78 insertions(+), 75 deletions(-) diff --git a/include/osg/Array b/include/osg/Array index 09407bd1e..66f713b25 100644 --- a/include/osg/Array +++ b/include/osg/Array @@ -141,9 +141,9 @@ class TemplateArray : public Array, public std::vector return 0; } - virtual const GLvoid* getDataPointer() const { if (!empty()) return &front(); else return 0; } - virtual unsigned int getTotalDataSize() const { return size()*sizeof(T); } - virtual unsigned int getNumElements() const { return size(); } + virtual const GLvoid* getDataPointer() const { if (!this->empty()) return &this->front(); else return 0; } + virtual unsigned int getTotalDataSize() const { return this->size()*sizeof(T); } + virtual unsigned int getNumElements() const { return this->size(); } protected: @@ -219,9 +219,9 @@ class TemplateIndexArray : public IndexArray, public std::vector return 0; } - virtual const GLvoid* getDataPointer() const { if (!empty()) return &front(); else return 0; } - virtual unsigned int getTotalDataSize() const { return size()*sizeof(T); } - virtual unsigned int getNumElements() const { return size(); } + virtual const GLvoid* getDataPointer() const { if (!this->empty()) return &this->front(); else return 0; } + virtual unsigned int getTotalDataSize() const { return this->size()*sizeof(T); } + virtual unsigned int getNumElements() const { return this->size(); } virtual unsigned int index(unsigned int pos) const { return (*this)[pos]; } diff --git a/include/osg/TriangleFunctor b/include/osg/TriangleFunctor index 34696d4e1..c51e3c333 100644 --- a/include/osg/TriangleFunctor +++ b/include/osg/TriangleFunctor @@ -64,7 +64,7 @@ public: { const Vec3* vlast = &_vertexArrayPtr[first+count]; for(const Vec3* vptr=&_vertexArrayPtr[first];vptroperator()(*(vptr),*(vptr+1),*(vptr+2),_treatVertexDataAsTemporary); break; } case(GL_TRIANGLE_STRIP): @@ -72,8 +72,8 @@ public: const Vec3* vptr = &_vertexArrayPtr[first]; for(GLsizei i=2;ioperator()(*(vptr),*(vptr+2),*(vptr+1),_treatVertexDataAsTemporary); + else this->operator()(*(vptr),*(vptr+1),*(vptr+2),_treatVertexDataAsTemporary); } break; } @@ -82,8 +82,8 @@ public: const Vec3* vptr = &_vertexArrayPtr[first]; for(GLsizei i=3;ioperator()(*(vptr),*(vptr+1),*(vptr+2),_treatVertexDataAsTemporary); + this->operator()(*(vptr),*(vptr+2),*(vptr+3),_treatVertexDataAsTemporary); } break; } @@ -92,8 +92,8 @@ public: const Vec3* vptr = &_vertexArrayPtr[first]; for(GLsizei i=3;ioperator()(*(vptr),*(vptr+1),*(vptr+2),_treatVertexDataAsTemporary); + this->operator()(*(vptr+1),*(vptr+3),*(vptr+2),_treatVertexDataAsTemporary); } break; } @@ -104,7 +104,7 @@ public: const Vec3* vptr = vfirst+1; for(GLsizei i=2;ioperator()(*(vfirst),*(vptr),*(vptr+1),_treatVertexDataAsTemporary); } break; } @@ -130,7 +130,7 @@ public: { IndexPointer ilast = &indices[count]; for(IndexPointer iptr=indices;iptroperator()(_vertexArrayPtr[*iptr],_vertexArrayPtr[*(iptr+1)],_vertexArrayPtr[*(iptr+2)],_treatVertexDataAsTemporary); break; } case(GL_TRIANGLE_STRIP): @@ -138,8 +138,8 @@ public: IndexPointer iptr = indices; for(GLsizei i=2;ioperator()(_vertexArrayPtr[*(iptr)],_vertexArrayPtr[*(iptr+2)],_vertexArrayPtr[*(iptr+1)],_treatVertexDataAsTemporary); + else this->operator()(_vertexArrayPtr[*(iptr)],_vertexArrayPtr[*(iptr+1)],_vertexArrayPtr[*(iptr+2)],_treatVertexDataAsTemporary); } break; } @@ -148,8 +148,8 @@ public: IndexPointer iptr = indices; for(GLsizei i=3;ioperator()(_vertexArrayPtr[*(iptr)],_vertexArrayPtr[*(iptr+1)],_vertexArrayPtr[*(iptr+2)],_treatVertexDataAsTemporary); + this->operator()(_vertexArrayPtr[*(iptr)],_vertexArrayPtr[*(iptr+2)],_vertexArrayPtr[*(iptr+3)],_treatVertexDataAsTemporary); } break; } @@ -158,8 +158,8 @@ public: IndexPointer iptr = indices; for(GLsizei i=3;ioperator()(_vertexArrayPtr[*(iptr)],_vertexArrayPtr[*(iptr+1)],_vertexArrayPtr[*(iptr+2)],_treatVertexDataAsTemporary); + this->operator()(_vertexArrayPtr[*(iptr+1)],_vertexArrayPtr[*(iptr+3)],_vertexArrayPtr[*(iptr+2)],_treatVertexDataAsTemporary); } break; } @@ -171,7 +171,7 @@ public: ++iptr; for(GLsizei i=2;ioperator()(vfirst,_vertexArrayPtr[*(iptr)],_vertexArrayPtr[*(iptr+1)],_treatVertexDataAsTemporary); } break; } @@ -198,7 +198,7 @@ public: IndexPointer ilast = &indices[count]; for(IndexPointer iptr=indices;iptroperator()(_vertexArrayPtr[*iptr],_vertexArrayPtr[*(iptr+1)],_vertexArrayPtr[*(iptr+2)],_treatVertexDataAsTemporary); } break; } @@ -207,8 +207,8 @@ public: IndexPointer iptr = indices; for(GLsizei i=2;ioperator()(_vertexArrayPtr[*(iptr)],_vertexArrayPtr[*(iptr+2)],_vertexArrayPtr[*(iptr+1)],_treatVertexDataAsTemporary); + else this->operator()(_vertexArrayPtr[*(iptr)],_vertexArrayPtr[*(iptr+1)],_vertexArrayPtr[*(iptr+2)],_treatVertexDataAsTemporary); } break; } @@ -217,8 +217,8 @@ public: IndexPointer iptr = indices; for(GLsizei i=3;ioperator()(_vertexArrayPtr[*(iptr)],_vertexArrayPtr[*(iptr+1)],_vertexArrayPtr[*(iptr+2)],_treatVertexDataAsTemporary); + this->operator()(_vertexArrayPtr[*(iptr)],_vertexArrayPtr[*(iptr+2)],_vertexArrayPtr[*(iptr+3)],_treatVertexDataAsTemporary); } break; } @@ -227,8 +227,8 @@ public: IndexPointer iptr = indices; for(GLsizei i=3;ioperator()(_vertexArrayPtr[*(iptr)],_vertexArrayPtr[*(iptr+1)],_vertexArrayPtr[*(iptr+2)],_treatVertexDataAsTemporary); + this->operator()(_vertexArrayPtr[*(iptr+1)],_vertexArrayPtr[*(iptr+3)],_vertexArrayPtr[*(iptr+2)],_treatVertexDataAsTemporary); } break; } @@ -240,7 +240,7 @@ public: ++iptr; for(GLsizei i=2;ioperator()(vfirst,_vertexArrayPtr[*(iptr)],_vertexArrayPtr[*(iptr+1)],_treatVertexDataAsTemporary); } break; } @@ -266,7 +266,7 @@ public: { IndexPointer ilast = &indices[count]; for(IndexPointer iptr=indices;iptroperator()(_vertexArrayPtr[*iptr],_vertexArrayPtr[*(iptr+1)],_vertexArrayPtr[*(iptr+2)],_treatVertexDataAsTemporary); break; } case(GL_TRIANGLE_STRIP): @@ -274,8 +274,8 @@ public: IndexPointer iptr = indices; for(GLsizei i=2;ioperator()(_vertexArrayPtr[*(iptr)],_vertexArrayPtr[*(iptr+2)],_vertexArrayPtr[*(iptr+1)],_treatVertexDataAsTemporary); + else this->operator()(_vertexArrayPtr[*(iptr)],_vertexArrayPtr[*(iptr+1)],_vertexArrayPtr[*(iptr+2)],_treatVertexDataAsTemporary); } break; } @@ -284,8 +284,8 @@ public: IndexPointer iptr = indices; for(GLsizei i=3;ioperator()(_vertexArrayPtr[*(iptr)],_vertexArrayPtr[*(iptr+1)],_vertexArrayPtr[*(iptr+2)],_treatVertexDataAsTemporary); + this->operator()(_vertexArrayPtr[*(iptr)],_vertexArrayPtr[*(iptr+2)],_vertexArrayPtr[*(iptr+3)],_treatVertexDataAsTemporary); } break; } @@ -294,8 +294,8 @@ public: IndexPointer iptr = indices; for(GLsizei i=3;ioperator()(_vertexArrayPtr[*(iptr)],_vertexArrayPtr[*(iptr+1)],_vertexArrayPtr[*(iptr+2)],_treatVertexDataAsTemporary); + this->operator()(_vertexArrayPtr[*(iptr+1)],_vertexArrayPtr[*(iptr+3)],_vertexArrayPtr[*(iptr+2)],_treatVertexDataAsTemporary); } break; } @@ -307,7 +307,7 @@ public: ++iptr; for(GLsizei i=2;ioperator()(vfirst,_vertexArrayPtr[*(iptr)],_vertexArrayPtr[*(iptr+1)],_treatVertexDataAsTemporary); } break; } diff --git a/include/osg/TriangleIndexFunctor b/include/osg/TriangleIndexFunctor index 7fc4c0587..df8db114c 100644 --- a/include/osg/TriangleIndexFunctor +++ b/include/osg/TriangleIndexFunctor @@ -65,7 +65,7 @@ public: unsigned int pos=first; for(GLsizei i=2;ioperator()(pos,pos+1,pos+2); } break; } @@ -74,8 +74,8 @@ public: unsigned int pos=first; for(GLsizei i=2;ioperator()(pos,pos+2,pos+1); + else this->operator()(pos,pos+1,pos+2); } break; } @@ -84,8 +84,8 @@ public: unsigned int pos=first; for(GLsizei i=3;ioperator()(pos,pos+1,pos+2); + this->operator()(pos,pos+2,pos+3); } break; } @@ -94,8 +94,8 @@ public: unsigned int pos=first; for(GLsizei i=3;ioperator()(pos,pos+1,pos+2); + this->operator()(pos+1,pos+3,pos+2); } break; } @@ -105,7 +105,7 @@ public: unsigned int pos=first+1; for(GLsizei i=2;ioperator()(first,pos,pos+1); } break; } @@ -131,7 +131,7 @@ public: { IndexPointer ilast = &indices[count]; for(IndexPointer iptr=indices;iptroperator()(*iptr,*(iptr+1),*(iptr+2)); break; } case(GL_TRIANGLE_STRIP): @@ -139,8 +139,8 @@ public: IndexPointer iptr = indices; for(GLsizei i=2;ioperator()(*(iptr),*(iptr+2),*(iptr+1)); + else this->operator()(*(iptr),*(iptr+1),*(iptr+2)); } break; } @@ -149,8 +149,8 @@ public: IndexPointer iptr = indices; for(GLsizei i=3;ioperator()(*(iptr),*(iptr+1),*(iptr+2)); + this->operator()(*(iptr),*(iptr+2),*(iptr+3)); } break; } @@ -159,8 +159,8 @@ public: IndexPointer iptr = indices; for(GLsizei i=3;ioperator()(*(iptr),*(iptr+1),*(iptr+2)); + this->operator()(*(iptr+1),*(iptr+3),*(iptr+2)); } break; } @@ -172,7 +172,7 @@ public: ++iptr; for(GLsizei i=2;ioperator()(first,*(iptr),*(iptr+1)); } break; } @@ -198,7 +198,7 @@ public: { IndexPointer ilast = &indices[count]; for(IndexPointer iptr=indices;iptroperator()(*iptr,*(iptr+1),*(iptr+2)); break; } case(GL_TRIANGLE_STRIP): @@ -206,8 +206,8 @@ public: IndexPointer iptr = indices; for(GLsizei i=2;ioperator()(*(iptr),*(iptr+2),*(iptr+1)); + else this->operator()(*(iptr),*(iptr+1),*(iptr+2)); } break; } @@ -216,8 +216,8 @@ public: IndexPointer iptr = indices; for(GLsizei i=3;ioperator()(*(iptr),*(iptr+1),*(iptr+2)); + this->operator()(*(iptr),*(iptr+2),*(iptr+3)); } break; } @@ -226,8 +226,8 @@ public: IndexPointer iptr = indices; for(GLsizei i=3;ioperator()(*(iptr),*(iptr+1),*(iptr+2)); + this->operator()(*(iptr+1),*(iptr+3),*(iptr+2)); } break; } @@ -239,7 +239,7 @@ public: ++iptr; for(GLsizei i=2;ioperator()(first,*(iptr),*(iptr+1)); } break; } @@ -265,7 +265,7 @@ public: { IndexPointer ilast = &indices[count]; for(IndexPointer iptr=indices;iptroperator()(*iptr,*(iptr+1),*(iptr+2)); break; } case(GL_TRIANGLE_STRIP): @@ -273,8 +273,8 @@ public: IndexPointer iptr = indices; for(GLsizei i=2;ioperator()(*(iptr),*(iptr+2),*(iptr+1)); + else this->operator()(*(iptr),*(iptr+1),*(iptr+2)); } break; } @@ -283,8 +283,8 @@ public: IndexPointer iptr = indices; for(GLsizei i=3;ioperator()(*(iptr),*(iptr+1),*(iptr+2)); + this->operator()(*(iptr),*(iptr+2),*(iptr+3)); } break; } @@ -293,8 +293,8 @@ public: IndexPointer iptr = indices; for(GLsizei i=3;ioperator()(*(iptr),*(iptr+1),*(iptr+2)); + this->operator()(*(iptr+1),*(iptr+3),*(iptr+2)); } break; } @@ -306,7 +306,7 @@ public: ++iptr; for(GLsizei i=2;ioperator()(first,*(iptr),*(iptr+1)); } break; } diff --git a/runexamples.bat b/runexamples.bat index 57a6a2c68..1c551390f 100644 --- a/runexamples.bat +++ b/runexamples.bat @@ -4,11 +4,14 @@ osgversion echo osglogo osglogo +echo osgviewer cow.osg +osgviewer cow.osg + echo osgfxbrowser dumptruck.osg osgfxbrowser dumptruck.osg -echo osgviewer cow.osg -osgviewer cow.osg +echo osgshaders +osgshaders echo osgkeyboard osgkeyboard diff --git a/src/osgPlugins/lwo/lwo2parser.h b/src/osgPlugins/lwo/lwo2parser.h index 9b8f0caa8..396975a38 100644 --- a/src/osgPlugins/lwo/lwo2parser.h +++ b/src/osgPlugins/lwo/lwo2parser.h @@ -894,9 +894,9 @@ namespace lwo2 for (int i=0; i<4; ++i) tag += *(it++); unsigned int len = ((static_cast(*(it++)) & 0xFF) << 8) | (static_cast(*(it++)) & 0xFF); - os() << "DEBUG INFO: lwo2parser: reading subchunk " << tag << ", length = " << len << ", context = " << context << "\n"; + this->os() << "DEBUG INFO: lwo2parser: reading subchunk " << tag << ", length = " << len << ", context = " << context << "\n"; iff::Chunk *chk = parse_chunk_data(tag, context, it, it+len); - if (!chk) os() << "DEBUG INFO: lwo2parser: \tprevious subchunk not handled\n"; + if (!chk) this->os() << "DEBUG INFO: lwo2parser: \tprevious subchunk not handled\n"; it += len; if ((len % 2) != 0) ++it; return chk; diff --git a/src/osgUtil/TriStrip_graph_array.h b/src/osgUtil/TriStrip_graph_array.h index e6188a7f1..e4935a092 100644 --- a/src/osgUtil/TriStrip_graph_array.h +++ b/src/osgUtil/TriStrip_graph_array.h @@ -369,7 +369,7 @@ inline void graph_array::erase_arcs(const node_iterator & Ini template inline void graph_array::erase_arcs() { m_NbArcs = 0; - for (nodeid i = 0; i < Size(); ++i) + for (nodeid i = 0; i < this->Size(); ++i) m_Nodes[i].m_OutArcs.clear(); }