diff --git a/src/osgPlugins/cfg/Camera.cpp b/src/osgPlugins/cfg/Camera.cpp index 704c53d1c..110315dde 100644 --- a/src/osgPlugins/cfg/Camera.cpp +++ b/src/osgPlugins/cfg/Camera.cpp @@ -277,7 +277,6 @@ bool Camera::Lens::convertToPerspective( float d ) void Camera::Lens::apply(float xshear, float yshear) { - osg::Matrix::value_type _matrix[16]; generateMatrix(xshear,yshear,_matrix); } diff --git a/src/osgPlugins/cfg/CameraConfig.cpp b/src/osgPlugins/cfg/CameraConfig.cpp index 1e630d77c..07047f6f2 100644 --- a/src/osgPlugins/cfg/CameraConfig.cpp +++ b/src/osgPlugins/cfg/CameraConfig.cpp @@ -288,10 +288,10 @@ RenderSurface *CameraConfig::getRenderSurface( unsigned int index ) return (p->second.get()); } -void CameraConfig::addCamera( std::string name, Camera *camera ) +void CameraConfig::addCamera( std::string cameraName, Camera *camera ) { std::pair >::iterator,bool> res = - _camera_map.insert(std::pair >(name, camera)); + _camera_map.insert(std::pair >(cameraName, camera)); _current_camera = (res.first)->second.get(); _can_add_camera_attributes = true; diff --git a/src/osgPlugins/dae/CMakeLists.txt b/src/osgPlugins/dae/CMakeLists.txt index a82481994..676b5d29d 100644 --- a/src/osgPlugins/dae/CMakeLists.txt +++ b/src/osgPlugins/dae/CMakeLists.txt @@ -76,5 +76,10 @@ ENDIF() SET(TARGET_ADDED_LIBRARIES osgSim osgAnimation) +IF(CMAKE_COMPILER_IS_GNUCXX) + # Remove -Wshadow flag as it barfs on ffmoeg headers + STRING(REGEX REPLACE "-Wshadow" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") +ENDIF() + #### end var setup ### SETUP_PLUGIN(dae dae) diff --git a/src/osgPlugins/dae/daeRGeometry.cpp b/src/osgPlugins/dae/daeRGeometry.cpp index 3258f83a6..088105db7 100644 --- a/src/osgPlugins/dae/daeRGeometry.cpp +++ b/src/osgPlugins/dae/daeRGeometry.cpp @@ -224,10 +224,10 @@ osg::Node* daeReader::processMorph(domMorph* pDomMorph, domBind_material* pDomBi osg::Geode* targetgeode = getOrCreateGeometry(pDomGeometry, NULL); // Expects a single geometry inside the geode, should change this - osg::Geometry* pOsgGeometry = dynamic_cast(targetgeode->getDrawable(0)); - if (pOsgGeometry) + osg::Geometry* geometry = dynamic_cast(targetgeode->getDrawable(0)); + if (geometry) { - pOsgMorphGeometry->addMorphTarget(pOsgGeometry); + pOsgMorphGeometry->addMorphTarget(geometry); } } else @@ -248,10 +248,10 @@ osg::Node* daeReader::processMorph(domMorph* pDomMorph, domBind_material* pDomBi osg::Geode* targetgeode = getOrCreateGeometry(pDomGeometry, NULL); // Expects a single geometry inside the geode, should change this - osg::Geometry* pOsgGeometry = dynamic_cast(targetgeode->getDrawable(0)); - if (pOsgGeometry) + osg::Geometry* geometry = dynamic_cast(targetgeode->getDrawable(0)); + if (geometry) { - pOsgMorphGeometry->addMorphTarget(pOsgGeometry); + pOsgMorphGeometry->addMorphTarget(geometry); } } else @@ -596,10 +596,6 @@ void daeReader::processPolygons(osg::Geode* geode, osg::DrawElementsUInt* pDrawElements = new osg::DrawElementsUInt(GL_TRIANGLES); geometry->addPrimitiveSet(pDrawElements); - std::vector > indexLists; - resolveMeshArrays(group->getP_array(), group->getInput_array(), pDomMesh, - geometry, sources, indexLists); - for ( size_t i = 0; i < indexLists.size(); ++i) { const std::vector& indices = indexLists[i]; @@ -960,18 +956,18 @@ void daeReader::resolveMeshArrays(const domP_Array& domPArray, //We keep somewhere the mapping between daeElement id and created arrays _texCoordIdMap.insert(std::pair(id,texcoord_set)); // 2D Texcoords - osg::ref_ptr array( createGeometryArray(sources[texcoord_source], vertexIndicesIndexMap, readDoubleTexcoords, texcoord_set) ); - if (array.valid()) + osg::ref_ptr array2d( createGeometryArray(sources[texcoord_source], vertexIndicesIndexMap, readDoubleTexcoords, texcoord_set) ); + if (array2d.valid()) { - geometry->setTexCoordArray(texcoord_set, array.get()); + geometry->setTexCoordArray(texcoord_set, array2d.get()); } else { // 3D Textcoords - osg::ref_ptr array( createGeometryArray(sources[texcoord_source], vertexIndicesIndexMap, readDoubleTexcoords, texcoord_set) ); - if (array.valid()) + osg::ref_ptr array3d( createGeometryArray(sources[texcoord_source], vertexIndicesIndexMap, readDoubleTexcoords, texcoord_set) ); + if (array3d.valid()) { - geometry->setTexCoordArray(texcoord_set, array.get()); + geometry->setTexCoordArray(texcoord_set, array3d.get()); } } } diff --git a/src/osgPlugins/dae/daeWAnimations.cpp b/src/osgPlugins/dae/daeWAnimations.cpp index 7bb793125..6927a4afe 100644 --- a/src/osgPlugins/dae/daeWAnimations.cpp +++ b/src/osgPlugins/dae/daeWAnimations.cpp @@ -35,10 +35,10 @@ using namespace osgDAE; -void daeWriter::writeAnimations( osg::Node &node ) +void daeWriter::writeAnimations( osg::Node &wnode ) { - const std::string nodeNameUTF( _pluginOptions.namesUseCodepage ? osgDB::convertStringFromCurrentCodePageToUTF8(node.getName()) : node.getName() ); - osg::Callback* ncb = node.getUpdateCallback(); + const std::string nodeNameUTF( _pluginOptions.namesUseCodepage ? osgDB::convertStringFromCurrentCodePageToUTF8(wnode.getName()) : wnode.getName() ); + osg::Callback* ncb = wnode.getUpdateCallback(); if (ncb) { osgAnimation::AnimationManagerBase* am = dynamic_cast(ncb); @@ -51,12 +51,12 @@ void daeWriter::writeAnimations( osg::Node &node ) } osgAnimation::AnimationList animationList = am->getAnimationList(); - for (size_t i = 0; i < animationList.size(); i++) + for (size_t ai = 0; ai < animationList.size(); ai++) { domAnimation* pDomAnimation = daeSafeCast< domAnimation >( _domLibraryAnimations->add( COLLADA_ELEMENT_ANIMATION ) ); domAnimation* pMainDomAnimation = pDomAnimation; - osg::ref_ptr animation = animationList[i]; + osg::ref_ptr animation = animationList[ai]; std::string animationName( animation->getName() ); if (animationName.empty()) animationName = "animation"; @@ -264,7 +264,7 @@ void daeWriter::writeAnimations( osg::Node &node ) { domInputLocal* pDomInput = daeSafeCast< domInputLocal >(pDomSampler->add(COLLADA_ELEMENT_INPUT)); pDomInput->setSemantic(COMMON_PROFILE_INPUT_INPUT); - std::string url = "#" + inputSourceName; + url = "#" + inputSourceName; pDomInput->setSource(url.c_str()); pDomInput = daeSafeCast< domInputLocal >(pDomSampler->add(COLLADA_ELEMENT_INPUT)); @@ -280,7 +280,7 @@ void daeWriter::writeAnimations( osg::Node &node ) // Set sampler as source domChannel* pDomChannel = daeSafeCast< domChannel >(pDomAnimation->add(COLLADA_ELEMENT_CHANNEL)); - std::string url = "#" + sourceNameX; + url = "#" + sourceNameX; pDomChannel->setSource(url.c_str()); // targetName contains the name of the updateCallback @@ -308,7 +308,7 @@ void daeWriter::writeAnimations( osg::Node &node ) { domInputLocal* pDomInput = daeSafeCast< domInputLocal >(pDomSampler->add(COLLADA_ELEMENT_INPUT)); pDomInput->setSemantic(COMMON_PROFILE_INPUT_INPUT); - std::string url = "#" + inputSourceName; + url = "#" + inputSourceName; pDomInput->setSource(url.c_str()); pDomInput = daeSafeCast< domInputLocal >(pDomSampler->add(COLLADA_ELEMENT_INPUT)); @@ -324,7 +324,7 @@ void daeWriter::writeAnimations( osg::Node &node ) // Set sampler as source domChannel* pDomChannel = daeSafeCast< domChannel >(pDomAnimation->add(COLLADA_ELEMENT_CHANNEL)); - std::string url = "#" + sourceNameY; + url = "#" + sourceNameY; pDomChannel->setSource(url.c_str()); // targetName contains the name of the updateCallback @@ -352,7 +352,7 @@ void daeWriter::writeAnimations( osg::Node &node ) { domInputLocal* pDomInput = daeSafeCast< domInputLocal >(pDomSampler->add(COLLADA_ELEMENT_INPUT)); pDomInput->setSemantic(COMMON_PROFILE_INPUT_INPUT); - std::string url = "#" + inputSourceName; + url = "#" + inputSourceName; pDomInput->setSource(url.c_str()); pDomInput = daeSafeCast< domInputLocal >(pDomSampler->add(COLLADA_ELEMENT_INPUT)); @@ -368,7 +368,7 @@ void daeWriter::writeAnimations( osg::Node &node ) // Set sampler as source domChannel* pDomChannel = daeSafeCast< domChannel >(pDomAnimation->add(COLLADA_ELEMENT_CHANNEL)); - std::string url = "#" + sourceNameZ; + url = "#" + sourceNameZ; pDomChannel->setSource(url.c_str()); // targetName contains the name of the updateCallback @@ -438,7 +438,7 @@ void daeWriter::writeAnimations( osg::Node &node ) { domInputLocal* pDomInput = daeSafeCast< domInputLocal >(pDomSampler->add(COLLADA_ELEMENT_INPUT)); pDomInput->setSemantic(COMMON_PROFILE_INPUT_INPUT); - std::string url = "#" + inputSourceName; + url = "#" + inputSourceName; pDomInput->setSource(url.c_str()); pDomInput = daeSafeCast< domInputLocal >(pDomSampler->add(COLLADA_ELEMENT_INPUT)); @@ -454,7 +454,7 @@ void daeWriter::writeAnimations( osg::Node &node ) // Set sampler as source domChannel* pDomChannel = daeSafeCast< domChannel >(pDomAnimation->add(COLLADA_ELEMENT_CHANNEL)); - std::string url = "#" + sourceName; + url = "#" + sourceName; pDomChannel->setSource(url.c_str()); // targetName contains the name of the updateCallback diff --git a/src/osgPlugins/dae/daeWriter.cpp b/src/osgPlugins/dae/daeWriter.cpp index c3fc69830..a0ee62acf 100644 --- a/src/osgPlugins/dae/daeWriter.cpp +++ b/src/osgPlugins/dae/daeWriter.cpp @@ -24,11 +24,11 @@ namespace osgDAE { -daeWriter::ArrayNIndices::ArrayNIndices( osg::Array* valArray, osg::IndexArray* ind ) : +daeWriter::ArrayNIndices::ArrayNIndices( osg::Array* vArray, osg::IndexArray* ind ) : vec2(0), vec3(0), vec4(0), vec2d(0), vec3d(0), vec4d(0), vec4ub(0), - valArray(valArray), + valArray(vArray), inds( ind ), mode(NONE) { if ( valArray != NULL ) @@ -248,9 +248,9 @@ void daeWriter::updateCurrentDaeNode() } } -std::string daeWriter::uniquify( const std::string &_name ) +std::string daeWriter::uniquify( const std::string & uname ) { - const std::string baseName( _pluginOptions.namesUseCodepage ? osgDB::convertStringFromCurrentCodePageToUTF8(_name) : _name ); + const std::string baseName( _pluginOptions.namesUseCodepage ? osgDB::convertStringFromCurrentCodePageToUTF8(uname) : uname ); std::string newName( baseName ); if (_pluginOptions.renameIds) { diff --git a/src/osgPlugins/lua/LuaScriptEngine.cpp b/src/osgPlugins/lua/LuaScriptEngine.cpp index 93dcabd6b..de760f82a 100644 --- a/src/osgPlugins/lua/LuaScriptEngine.cpp +++ b/src/osgPlugins/lua/LuaScriptEngine.cpp @@ -1365,14 +1365,14 @@ static int callImageGet(lua_State* _lua) return 0; } - int i = 0; - int j = 0; - int k = 0; - if (n>=2 && lua_isnumber(_lua, 2)) i = static_cast(lua_tonumber(_lua, 2)); - if (n>=3 && lua_isnumber(_lua, 3)) j = static_cast(lua_tonumber(_lua, 3)); - if (n>=4 && lua_isnumber(_lua, 4)) k = static_cast(lua_tonumber(_lua, 4)); + int image_i = 0; + int image_j = 0; + int image_k = 0; + if (n>=2 && lua_isnumber(_lua, 2)) image_i = static_cast(lua_tonumber(_lua, 2)); + if (n>=3 && lua_isnumber(_lua, 3)) image_j = static_cast(lua_tonumber(_lua, 3)); + if (n>=4 && lua_isnumber(_lua, 4)) image_k = static_cast(lua_tonumber(_lua, 4)); - const unsigned char* ptr = image->data(i,j,k); + const unsigned char* ptr = image->data(image_i,image_j,image_k); unsigned int numComponents = osg::Image::computeNumComponents(image->getPixelFormat()); // OSG_NOTICE<<"Need to implement Image::get("<data(i,j,k); + unsigned char* ptr = image->data(image_i,image_j,image_k); unsigned int numComponents = osg::Image::computeNumComponents(image->getPixelFormat()); switch(image->getDataType()) @@ -1486,12 +1486,12 @@ static int callImageSet(lua_State* _lua) } bool positionSet = false; - int i = 0; - int j = 0; - int k = 0; - if (n>=3 && lua_isnumber(_lua, 2)) { i = static_cast(lua_tonumber(_lua, 2)); positionSet = true; } - if (n>=4 && lua_isnumber(_lua, 3)) { j = static_cast(lua_tonumber(_lua, 3)); positionSet = true; } - if (n>=5 && lua_isnumber(_lua, 4)) { k = static_cast(lua_tonumber(_lua, 4)); positionSet = true; } + int image_i = 0; + int image_j = 0; + int image_k = 0; + if (n>=3 && lua_isnumber(_lua, 2)) { image_i = static_cast(lua_tonumber(_lua, 2)); positionSet = true; } + if (n>=4 && lua_isnumber(_lua, 3)) { image_j = static_cast(lua_tonumber(_lua, 3)); positionSet = true; } + if (n>=5 && lua_isnumber(_lua, 4)) { image_k = static_cast(lua_tonumber(_lua, 4)); positionSet = true; } osg::Vec4d colour(1.0,1.0,1.0,1.0); if (lua_isnumber(_lua, n)) @@ -1587,15 +1587,15 @@ static int callImageSet(lua_State* _lua) if (positionSet) { - setImageColour(image, i,j,k, colourToWrite); + setImageColour(image, image_i,image_j,image_k, colourToWrite); } else { - for(k=0; kr(); ++k) + for(int k=0; kr(); ++k) { - for(j=0; jt(); ++j) + for(int j=0; jt(); ++j) { - for(i=0; is(); ++i) + for(int i=0; is(); ++i) { setImageColour(image, i,j,k, colourToWrite); } diff --git a/src/osgPlugins/osc/osc/OscPrintReceivedElements.cpp b/src/osgPlugins/osc/osc/OscPrintReceivedElements.cpp index bddafd9cf..1ab1c4bd2 100644 --- a/src/osgPlugins/osc/osc/OscPrintReceivedElements.cpp +++ b/src/osgPlugins/osc/osc/OscPrintReceivedElements.cpp @@ -45,7 +45,7 @@ std::ostream& operator<<( std::ostream & os, case TRUE_TYPE_TAG: os << "bool:true"; break; - + case FALSE_TYPE_TAG: os << "bool:false"; break; @@ -77,7 +77,7 @@ std::ostream& operator<<( std::ostream & os, case RGBA_COLOR_TYPE_TAG: { uint32 color = arg.AsRgbaColorUnchecked(); - + os << "RGBA:0x" << std::hex << std::setfill('0') << std::setw(2) << (int)((color>>24) & 0xFF) @@ -102,7 +102,7 @@ std::ostream& operator<<( std::ostream & os, os.unsetf(std::ios::basefield); } break; - + case INT64_TYPE_TAG: os << "int64:" << arg.AsInt64Unchecked(); break; @@ -121,11 +121,11 @@ std::ostream& operator<<( std::ostream & os, strcpy( s, timeString ); if( len ) s[ len - 1 ] = '\0'; - + os << " " << s; } break; - + case DOUBLE_TYPE_TAG: os << "double:" << arg.AsDoubleUnchecked(); break; @@ -133,8 +133,8 @@ std::ostream& operator<<( std::ostream & os, case STRING_TYPE_TAG: os << "OSC-string:`" << arg.AsStringUnchecked() << "'"; break; - - case SYMBOL_TYPE_TAG: + + case SYMBOL_TYPE_TAG: os << "OSC-string (symbol):`" << arg.AsSymbolUnchecked() << "'"; break; @@ -170,7 +170,7 @@ std::ostream& operator<<( std::ostream & os, const ReceivedMessage& m ) os << m.AddressPatternAsUInt32(); else os << m.AddressPattern(); - + bool first = true; for( ReceivedMessage::const_iterator i = m.ArgumentsBegin(); i != m.ArgumentsEnd(); ++i ){ @@ -190,23 +190,23 @@ std::ostream& operator<<( std::ostream & os, const ReceivedMessage& m ) } -std::ostream& operator<<( std::ostream & os, const ReceivedBundle& b ) +std::ostream& operator<<( std::ostream & os, const ReceivedBundle& rb ) { static int indent = 0; for( int j=0; j < indent; ++j ) os << " "; os << "{ ( "; - if( b.TimeTag() == 1 ) + if( rb.TimeTag() == 1 ) os << "immediate"; else - os << b.TimeTag(); + os << rb.TimeTag(); os << " )\n"; ++indent; - - for( ReceivedBundle::const_iterator i = b.ElementsBegin(); - i != b.ElementsEnd(); ++i ){ + + for( ReceivedBundle::const_iterator i = rb.ElementsBegin(); + i != rb.ElementsEnd(); ++i ){ if( i->IsBundle() ){ ReceivedBundle b(*i); os << b << "\n";