From 84e2c82877937927ec05205d9f699baff7351455 Mon Sep 17 00:00:00 2001 From: aramis_acg Date: Fri, 6 Mar 2009 12:37:08 +0000 Subject: [PATCH] [ 2666245 ] Remove unused vars git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@357 67173fc5-114c-0410-ac8e-9d2fd5bffc1f --- code/FindInvalidDataProcess.cpp | 2 +- code/GenVertexNormalsProcess.cpp | 3 +-- code/IRRLoader.cpp | 42 +++++++++++++------------------- code/IRRMeshLoader.cpp | 1 - code/MD3Loader.cpp | 1 - code/SceneCombiner.cpp | 2 -- code/SkeletonMeshBuilder.cpp | 3 +-- code/SortByPTypeProcess.cpp | 1 - 8 files changed, 20 insertions(+), 35 deletions(-) diff --git a/code/FindInvalidDataProcess.cpp b/code/FindInvalidDataProcess.cpp index 878db4b8d..7cff0877b 100644 --- a/code/FindInvalidDataProcess.cpp +++ b/code/FindInvalidDataProcess.cpp @@ -109,7 +109,7 @@ void FindInvalidDataProcess::Execute( aiScene* pScene) bool out = false; std::vector meshMapping(pScene->mNumMeshes); - unsigned int real = 0, realAnimations = 0; + unsigned int real = 0; // Process meshes for( unsigned int a = 0; a < pScene->mNumMeshes; a++) diff --git a/code/GenVertexNormalsProcess.cpp b/code/GenVertexNormalsProcess.cpp index 6c84d031d..8d6219e45 100644 --- a/code/GenVertexNormalsProcess.cpp +++ b/code/GenVertexNormalsProcess.cpp @@ -150,8 +150,7 @@ bool GenVertexNormalsProcess::GenMeshVertexNormals (aiMesh* pMesh, unsigned int // check whether we can reuse the SpatialSort of a previous step. SpatialSort* vertexFinder = NULL; SpatialSort _vertexFinder; - float posEpsilon; - const float epsilon = 1e-5f; + float posEpsilon = 1e-5f; if (shared) { std::vector >* avf; shared->GetProperty(AI_SPP_SPATIAL_SORT,avf); diff --git a/code/IRRLoader.cpp b/code/IRRLoader.cpp index 266ad1ffb..8cccc04ac 100644 --- a/code/IRRLoader.cpp +++ b/code/IRRLoader.cpp @@ -308,7 +308,7 @@ void IRRImporter::ComputeAnimations(Node* root, aiNode* real, std::vectoranimators.empty())return; - const aiMatrix4x4& transform = real->mTransformation; +// const aiMatrix4x4& transform = real->mTransformation; unsigned int total = 0; for (std::list::iterator it = root->animators.begin(); @@ -409,11 +409,13 @@ void IRRImporter::ComputeAnimations(Node* root, aiNode* real, std::vectormNumRotationKeys = (unsigned int)(max*fps); anim->mRotationKeys = new aiQuatKey[anim->mNumRotationKeys]; - // begin with a zero angle aiVector3D angle; for (unsigned int i = 0; i < anim->mNumRotationKeys;++i) @@ -445,16 +445,12 @@ void IRRImporter::ComputeAnimations(Node* root, aiNode* real, std::vectormPostState = aiAnimBehaviour_REPEAT; - anim->mPreState = aiAnimBehaviour_CONSTANT; + anim->mPostState = anim->mPreState = aiAnimBehaviour_REPEAT; } break; case Animator::FLY_CIRCLE: { - anim->mPostState = aiAnimBehaviour_REPEAT; - anim->mPreState = aiAnimBehaviour_CONSTANT; - // ----------------------------------------------------- // Find out how much time we'll need to perform a // full circle. @@ -484,14 +480,15 @@ void IRRImporter::ComputeAnimations(Node* root, aiNode* real, std::vectormPostState = anim->mPreState = aiAnimBehaviour_REPEAT; } break; case Animator::FLY_STRAIGHT: { - anim->mPostState = (in.loop ? aiAnimBehaviour_REPEAT : aiAnimBehaviour_CONSTANT); - anim->mPreState = aiAnimBehaviour_CONSTANT; - + anim->mPostState = anim->mPreState = (in.loop ? aiAnimBehaviour_REPEAT : aiAnimBehaviour_CONSTANT); const double seconds = in.timeForWay / 1000.; const double tdelta = 1000. / fps; @@ -516,9 +513,8 @@ void IRRImporter::ComputeAnimations(Node* root, aiNode* real, std::vectormPostState = aiAnimBehaviour_REPEAT; - anim->mPreState = aiAnimBehaviour_CONSTANT; - + // repeat outside the defined time range + anim->mPostState = anim->mPreState = aiAnimBehaviour_REPEAT; const int size = (int)in.splineKeys.size(); if (!size) { @@ -663,7 +659,7 @@ void IRRImporter::GenerateGraph(Node* root,aiNode* rootOut ,aiScene* scene, unsigned int& defMatIdx) { unsigned int oldMeshSize = (unsigned int)meshes.size(); - unsigned int meshTrafoAssign = 0; + //unsigned int meshTrafoAssign = 0; // Now determine the type of the node switch (root->type) @@ -686,7 +682,7 @@ void IRRImporter::GenerateGraph(Node* root,aiNode* rootOut ,aiScene* scene, } attach.push_back(AttachmentInfo(scene,rootOut)); -#if 0 +#if 0 /* currently unused */ meshTrafoAssign = 1; // If the root node of the scene is animated - and *this* node @@ -695,16 +691,12 @@ void IRRImporter::GenerateGraph(Node* root,aiNode* rootOut ,aiScene* scene, for (unsigned int i = 0; i < scene->mNumAnimations;++i) { aiAnimation* anim = scene->mAnimations[i]; - for (unsigned int a = 0; a < anim->mNumChannels;++a) - { - if (scene->mRootNode->mName == anim->mChannels[a]->mNodeName) - { - if (root->animators.empty()) - { + for (unsigned int a = 0; a < anim->mNumChannels;++a) { + if (scene->mRootNode->mName == anim->mChannels[a]->mNodeName) { + if (root->animators.empty()) { meshTrafoAssign = 2; } - else - { + else { meshTrafoAssign = 3; aiNode* dummy = new aiNode(); dummy->mName.Set("$CSpaceSeam$"); diff --git a/code/IRRMeshLoader.cpp b/code/IRRMeshLoader.cpp index b2df463c5..8c1051172 100644 --- a/code/IRRMeshLoader.cpp +++ b/code/IRRMeshLoader.cpp @@ -132,7 +132,6 @@ void IRRMeshImporter::InternReadFile( const std::string& pFile, int textMeaning = 0; int vertexFormat = 0; // 0 = normal; 1 = 2 tcoords, 2 = tangents bool useColors = false; - bool needLightMap = false; // Parse the XML file while (reader->read()) diff --git a/code/MD3Loader.cpp b/code/MD3Loader.cpp index de7f17af8..26907185a 100644 --- a/code/MD3Loader.cpp +++ b/code/MD3Loader.cpp @@ -769,7 +769,6 @@ void MD3Importer::InternReadFile( const std::string& pFile, // Read all surfaces from the file unsigned int iNum = pcHeader->NUM_SURFACES; unsigned int iNumMaterials = 0; - unsigned int iDefaultMatIndex = 0xFFFFFFFF; while (iNum-- > 0) { // Ensure correct endianess diff --git a/code/SceneCombiner.cpp b/code/SceneCombiner.cpp index 97e3a790f..2864a1f46 100644 --- a/code/SceneCombiner.cpp +++ b/code/SceneCombiner.cpp @@ -187,8 +187,6 @@ void SceneCombiner::MergeScenes(aiScene** _dest,std::vector& src, if (*_dest)(*_dest)->~aiScene(); else *_dest = new aiScene(); - aiScene* dest = *_dest; - // Create a dummy scene to serve as master for the others aiScene* master = new aiScene(); master->mRootNode = new aiNode(); diff --git a/code/SkeletonMeshBuilder.cpp b/code/SkeletonMeshBuilder.cpp index 776ddb260..0fa155e76 100644 --- a/code/SkeletonMeshBuilder.cpp +++ b/code/SkeletonMeshBuilder.cpp @@ -77,13 +77,12 @@ SkeletonMeshBuilder::SkeletonMeshBuilder( aiScene* pScene) void SkeletonMeshBuilder::CreateGeometry( const aiNode* pNode) { // add a joint entry for the node. - const unsigned int boneIndex = mBones.size(); const unsigned int vertexStartIndex = mVertices.size(); // now build the geometry. if( pNode->mNumChildren > 0) { - // If the node has childs, we build little pointers to each of them + // If the node has children, we build little pointers to each of them for( unsigned int a = 0; a < pNode->mNumChildren; a++) { // find a suitable coordinate system diff --git a/code/SortByPTypeProcess.cpp b/code/SortByPTypeProcess.cpp index 279aa5651..e08227069 100644 --- a/code/SortByPTypeProcess.cpp +++ b/code/SortByPTypeProcess.cpp @@ -190,7 +190,6 @@ void SortByPTypeProcess::Execute( aiScene* pScene) continue; } bAnyChanges = true; - const unsigned int first = (unsigned int)outMeshes.size(); // reuse our current mesh arrays for the submesh // with the largest numer of primitives