- refraing from using magic numbers like 0xffffffff all over the repository, rather use UINT_MAX/SIZE_MAX ..

- minor re-formatting and refactoring at some old code spots.

git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@970 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
This commit is contained in:
aramis_acg
2011-04-22 21:29:18 +00:00
parent 14c6467aac
commit 6f30639d7f
40 changed files with 194 additions and 190 deletions

View File

@@ -948,13 +948,14 @@ void ColladaLoader::CreateAnimation( aiScene* pScene, const ColladaParser& pPars
}
// determine which transform step is affected by this channel
entry.mTransformIndex = 0xffffffff;
entry.mTransformIndex = SIZE_MAX;
for( size_t a = 0; a < srcNode->mTransforms.size(); ++a)
if( srcNode->mTransforms[a].mID == entry.mTransformId)
entry.mTransformIndex = a;
if( entry.mTransformIndex == 0xffffffff)
if( entry.mTransformIndex == SIZE_MAX) {
continue;
}
entry.mChannel = &(*cit);
entries.push_back( entry);
@@ -1154,12 +1155,12 @@ void ColladaLoader::AddTexture ( Assimp::MaterialHelper& mat, const ColladaParse
mat.AddProperty((float*)&sampler.mWeighting , 1,
_AI_MATKEY_TEXBLEND_BASE, type, idx);
// UV source index ... if we didn't resolve the mapping it is actually just
// UV source index ... if we didn't resolve the mapping, it is actually just
// a guess but it works in most cases. We search for the frst occurence of a
// number in the channel name. We assume it is the zero-based index into the
// UV channel array of all corresponding meshes. It could also be one-based
// for some exporters, but we won't care of it unless someone complains about.
if (sampler.mUVId != 0xffffffff)
if (sampler.mUVId != UINT_MAX)
map = sampler.mUVId;
else {
map = -1;
@@ -1289,16 +1290,6 @@ void ColladaLoader::BuildMaterials( const ColladaParser& pParser, aiScene* pScen
aiString name( matIt->first);
mat->AddProperty(&name,AI_MATKEY_NAME);
// MEGA SUPER MONSTER HACK by Alex ... It's all my fault, yes.
// We store the reference to the effect in the material and
// return ... we'll add the actual material properties later
// after we processed all meshes. During mesh processing,
// we evaluate vertex input mappings. Afterwards we should be
// able to correctly setup source UV channels for textures.
// ... moved to ColladaLoader::FillMaterials()
// *duck*
// store the material
mMaterialIndexByName[matIt->first] = newMats.size();
newMats.push_back( std::pair<Collada::Effect*, aiMaterial*>(const_cast<Collada::Effect*>(&effect),mat) );