Fixed shadows warnings

This commit is contained in:
Robert Osfield
2016-05-26 09:48:16 +01:00
parent bdad1f60c9
commit bf8e22ae63
8 changed files with 71 additions and 71 deletions

View File

@@ -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);
}

View File

@@ -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<std::map<std::string, osg::ref_ptr<Camera> >::iterator,bool> res =
_camera_map.insert(std::pair<std::string, osg::ref_ptr<Camera> >(name, camera));
_camera_map.insert(std::pair<std::string, osg::ref_ptr<Camera> >(cameraName, camera));
_current_camera = (res.first)->second.get();
_can_add_camera_attributes = true;

View File

@@ -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)

View File

@@ -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<osg::Geometry*>(targetgeode->getDrawable(0));
if (pOsgGeometry)
osg::Geometry* geometry = dynamic_cast<osg::Geometry*>(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<osg::Geometry*>(targetgeode->getDrawable(0));
if (pOsgGeometry)
osg::Geometry* geometry = dynamic_cast<osg::Geometry*>(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<std::vector<GLuint> > indexLists;
resolveMeshArrays(group->getP_array(), group->getInput_array(), pDomMesh,
geometry, sources, indexLists);
for ( size_t i = 0; i < indexLists.size(); ++i)
{
const std::vector<GLuint>& 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<std::string,size_t>(id,texcoord_set));
// 2D Texcoords
osg::ref_ptr<osg::Array> array( createGeometryArray<osg::Vec2Array, osg::Vec2dArray, VertexIndices::TEXCOORD>(sources[texcoord_source], vertexIndicesIndexMap, readDoubleTexcoords, texcoord_set) );
if (array.valid())
osg::ref_ptr<osg::Array> array2d( createGeometryArray<osg::Vec2Array, osg::Vec2dArray, VertexIndices::TEXCOORD>(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<osg::Array> array( createGeometryArray<osg::Vec3Array, osg::Vec3dArray, VertexIndices::TEXCOORD>(sources[texcoord_source], vertexIndicesIndexMap, readDoubleTexcoords, texcoord_set) );
if (array.valid())
osg::ref_ptr<osg::Array> array3d( createGeometryArray<osg::Vec3Array, osg::Vec3dArray, VertexIndices::TEXCOORD>(sources[texcoord_source], vertexIndicesIndexMap, readDoubleTexcoords, texcoord_set) );
if (array3d.valid())
{
geometry->setTexCoordArray(texcoord_set, array.get());
geometry->setTexCoordArray(texcoord_set, array3d.get());
}
}
}

View File

@@ -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<osgAnimation::AnimationManagerBase*>(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<osgAnimation::Animation> animation = animationList[i];
osg::ref_ptr<osgAnimation::Animation> 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

View File

@@ -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)
{

View File

@@ -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<int>(lua_tonumber(_lua, 2));
if (n>=3 && lua_isnumber(_lua, 3)) j = static_cast<int>(lua_tonumber(_lua, 3));
if (n>=4 && lua_isnumber(_lua, 4)) k = static_cast<int>(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<int>(lua_tonumber(_lua, 2));
if (n>=3 && lua_isnumber(_lua, 3)) image_j = static_cast<int>(lua_tonumber(_lua, 3));
if (n>=4 && lua_isnumber(_lua, 4)) image_k = static_cast<int>(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("<<i<<", "<<j<<", "<<k<<") ptr="<<(void*)ptr<<", numComponents="<<numComponents<<std::endl;
@@ -1445,15 +1445,15 @@ static int callImageGet(lua_State* _lua)
return 0;
}
static void setImageColour(osg::Image* image, int i, int j, int k, const osg::Vec4d& colourToWrite)
static void setImageColour(osg::Image* image, int image_i, int image_j, int image_k, const osg::Vec4d& colourToWrite)
{
if (i>=image->s() || j>=image->t() || k>=image->r())
if (image_i>=image->s() || image_j>=image->t() || image_k>=image->r())
{
OSG_NOTICE<<"Warning: Image::set("<<i<<", "<<j<<", "<<k<<") out of range"<<std::endl;
OSG_NOTICE<<"Warning: Image::set("<<image_i<<", "<<image_j<<", "<<image_k<<") out of range"<<std::endl;
return;
}
unsigned char* ptr = image->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<int>(lua_tonumber(_lua, 2)); positionSet = true; }
if (n>=4 && lua_isnumber(_lua, 3)) { j = static_cast<int>(lua_tonumber(_lua, 3)); positionSet = true; }
if (n>=5 && lua_isnumber(_lua, 4)) { k = static_cast<int>(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<int>(lua_tonumber(_lua, 2)); positionSet = true; }
if (n>=4 && lua_isnumber(_lua, 3)) { image_j = static_cast<int>(lua_tonumber(_lua, 3)); positionSet = true; }
if (n>=5 && lua_isnumber(_lua, 4)) { image_k = static_cast<int>(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; k<image->r(); ++k)
for(int k=0; k<image->r(); ++k)
{
for(j=0; j<image->t(); ++j)
for(int j=0; j<image->t(); ++j)
{
for(i=0; i<image->s(); ++i)
for(int i=0; i<image->s(); ++i)
{
setImageColour(image, i,j,k, colourToWrite);
}

View File

@@ -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";