Merged from svn/trunk changeset 12645. Removed redundent assert and associated variables to fix warnings.
This commit is contained in:
@@ -483,14 +483,11 @@ void WriterNodeVisitor::writeMaterials()
|
||||
// Ugly thing: it seems lib3ds_file_insert_material() doesn't support insertion in a random order (else materials are not assigned the right way)
|
||||
for (unsigned int iMat=0; iMat<nbMat; ++iMat)
|
||||
{
|
||||
bool found = false;
|
||||
for(MaterialMap::iterator itr = _materialMap.begin(); itr != _materialMap.end(); ++itr)
|
||||
{
|
||||
const Material & mat = itr->second;
|
||||
if (mat.index != static_cast<int>(iMat)) continue; // Ugly thing (2)
|
||||
found = true;
|
||||
|
||||
assert(mat.index>=0 && mat.index < static_cast<int>(_materialMap.size()));
|
||||
Lib3dsMaterial * mat3ds = lib3ds_material_new(osgDB::getSimpleFileName(mat.name).c_str());
|
||||
copyOsgColorToLib3dsColor(mat3ds->ambient, mat.ambient);
|
||||
copyOsgColorToLib3dsColor(mat3ds->diffuse, mat.diffuse);
|
||||
@@ -545,7 +542,6 @@ void WriterNodeVisitor::writeMaterials()
|
||||
lib3ds_file_insert_material(_file3ds, mat3ds, itr->second.index);
|
||||
break; // Ugly thing (3)
|
||||
}
|
||||
assert(found); // Ugly thing (4) - Implementation error if !found
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -784,19 +784,10 @@ void Geode::ProcessGeometry(ostream& fout, const unsigned int ioffset)
|
||||
// Check for a texture
|
||||
if (theState)
|
||||
{
|
||||
const osg::StateSet::TextureModeList& TextureModeList = theState->getTextureModeList();
|
||||
const osg::StateSet::TextureAttributeList& TextureAttributeList = theState->getTextureAttributeList();
|
||||
if (TextureAttributeList.size() > 0)
|
||||
{
|
||||
// Dont yet know how to handle more than one texture
|
||||
assert(TextureAttributeList.size() == 1);
|
||||
assert(TextureModeList.size() == 1);
|
||||
const osg::StateSet::ModeList& ModeList = TextureModeList[0];
|
||||
assert(ModeList.size() == 1);
|
||||
// Check for a single mode of GL_TEXTURE_2D and ON
|
||||
osg::StateSet::ModeList::value_type ModeValuePair = *ModeList.begin();
|
||||
assert(ModeValuePair.first == GL_TEXTURE_2D);
|
||||
assert(ModeValuePair.second == osg::StateAttribute::ON);
|
||||
const osg::StateSet::AttributeList& AttributeList = TextureAttributeList[0];
|
||||
// assert(AttributeList.size() == 1);
|
||||
const osg::Texture2D *pTexture2D = dynamic_cast<const osg::Texture2D*>(AttributeList.begin()->second.first.get());
|
||||
|
||||
Reference in New Issue
Block a user