diff --git a/code/ColladaLoader.cpp b/code/ColladaLoader.cpp index 203d8b3be..144133e2f 100644 --- a/code/ColladaLoader.cpp +++ b/code/ColladaLoader.cpp @@ -178,8 +178,8 @@ aiNode* ColladaLoader::BuildHierarchy( const ColladaParser& pParser, const Colla // create a node for it aiNode* node = new aiNode(); - // find a name for the new node. It's more complicated than you might think - node->mName.Set( FindNameForNode( pNode)); + // find a name for the new node. It's more complicated than you might think + node->mName.Set( FindNameForNode( pNode)); // calculate the transformation matrix for it node->mTransformation = pParser.CalculateResultTransform( pNode->mTransforms); @@ -192,18 +192,17 @@ aiNode* ColladaLoader::BuildHierarchy( const ColladaParser& pParser, const Colla node->mNumChildren = pNode->mChildren.size()+instances.size(); node->mChildren = new aiNode*[node->mNumChildren]; - unsigned int a = 0; - for(; a < pNode->mChildren.size(); a++) + for( size_t a = 0; a < pNode->mChildren.size(); a++) { node->mChildren[a] = BuildHierarchy( pParser, pNode->mChildren[a]); node->mChildren[a]->mParent = node; } // ... and finally the resolved node instances - for(; a < node->mNumChildren; a++) + for( size_t a = 0; a < instances.size(); a++) { - node->mChildren[a] = BuildHierarchy( pParser, instances[a-pNode->mChildren.size()]); - node->mChildren[a]->mParent = node; + node->mChildren[pNode->mChildren.size() + a] = BuildHierarchy( pParser, instances[a]); + node->mChildren[pNode->mChildren.size() + a]->mParent = node; } // construct meshes @@ -1263,7 +1262,7 @@ void ColladaLoader::BuildMaterials( const ColladaParser& pParser, aiScene* pScen // ------------------------------------------------------------------------------------------------ // Resolves the texture name for the given effect texture entry -const aiString& ColladaLoader::FindFilenameForEffectTexture( const ColladaParser& pParser, +aiString ColladaLoader::FindFilenameForEffectTexture( const ColladaParser& pParser, const Collada::Effect& pEffect, const std::string& pName) { // recurse through the param references until we end up at an image diff --git a/code/ColladaLoader.h b/code/ColladaLoader.h index ccd8cac01..cc245b91b 100644 --- a/code/ColladaLoader.h +++ b/code/ColladaLoader.h @@ -173,7 +173,7 @@ protected: aiTextureType type, unsigned int idx = 0); /** Resolves the texture name for the given effect texture entry */ - const aiString& FindFilenameForEffectTexture( const ColladaParser& pParser, + aiString FindFilenameForEffectTexture( const ColladaParser& pParser, const Collada::Effect& pEffect, const std::string& pName); /** Converts a path read from a collada file to the usual representation */ @@ -201,11 +201,11 @@ protected: /** Finds a node in the collada scene by the given name */ const Collada::Node* FindNode( const Collada::Node* pNode, const std::string& pName) const; - /** Finds a node in the collada scene by the given SID */ - const Collada::Node* FindNodeBySID( const Collada::Node* pNode, const std::string& pSID) const; + /** Finds a node in the collada scene by the given SID */ + const Collada::Node* FindNodeBySID( const Collada::Node* pNode, const std::string& pSID) const; - /** Finds a proper name for a node derived from the collada-node's properties */ - std::string FindNameForNode( const Collada::Node* pNode) const; + /** Finds a proper name for a node derived from the collada-node's properties */ + std::string FindNameForNode( const Collada::Node* pNode) const; protected: /** Filename, for a verbose error message */