Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

Diff Revisions 319 vs 321 for /trunk/Source Code/Geometry/Animations/AnimationController.cpp

Diff revisions: vs.
  @@ -33,18 +33,18 @@
33 33
34 34 for (U32 n = 0; n < mesh->mNumBones;++n){
35 35 const aiBone* bone = mesh->mBones[n];
36 - Unordered_map<std::string, Bone*>::iterator found = _bonesByName.find(bone->mName.data);
36 + hashMapImpl<stringImpl, Bone*>::iterator found = _bonesByName.find(bone->mName.data);
37 37 if(found != _bonesByName.end()){// FOUND IT!!! woohoo, make sure its not already in the bone list
38 38 bool skip = false;
39 - for(size_t j(0); j< _bones.size(); j++){
40 - std::string bname = bone->mName.data;
39 + for(vectorAlg::vecSize j(0); j< _bones.size(); j++){
40 + stringImpl bname = bone->mName.data;
41 41 if(_bones[j]->_name == bname) {
42 42 skip = true;// already inserted, skip this so as not to insert the same bone multiple times
43 43 break;
44 44 }
45 45 }
46 46 if(!skip){// only insert the bone if it has not already been inserted
47 - std::string tes = found->second->_name;
47 + stringImpl tes = found->second->_name;
48 48 found->second->_offsetMatrix = bone->mOffsetMatrix;
49 49 _bones.push_back(found->second);
50 50 _bonesToIndex[found->first] = (U32)_bones.size()-1;
  @@ -56,7 +56,7 @@
56 56 D32 timestep = 1.0/ANIMATION_TICKS_PER_SECOND;// ANIMATION_TICKS_PER_SECOND
57 57 mat4<F32> rotationmat;
58 58 vectorImpl<mat4<F32> > vec;
59 - for(size_t i(0); i< _animations.size(); i++){// pre calculate the animations
59 + for(vectorAlg::vecSize i(0); i< _animations.size(); i++){// pre calculate the animations
60 60 D32 dt = 0;
61 61 for(D32 ticks = 0; ticks < _animations[i]._duration; ticks += _animations[i]._ticksPerSecond/ANIMATION_TICKS_PER_SECOND){
62 62 dt +=timestep;
  @@ -64,12 +64,12 @@
64 64 _animations[i]._transforms.push_back(vec);
65 65 vectorImpl<mat4<F32> >& trans = _animations[i]._transforms.back();
66 66 if(GFX_DEVICE.getApi() == Direct3D){
67 - for( size_t a = 0; a < _transforms.size(); ++a){
67 + for( vectorAlg::vecSize a = 0; a < _transforms.size(); ++a){
68 68 AnimUtils::TransformMatrix(_bones[a]->_offsetMatrix * _bones[a]->_globalTransform, rotationmat);
69 69 trans.push_back(rotationmat);
70 70 }
71 71 }else{
72 - for( size_t a = 0; a < _transforms.size(); ++a){
72 + for( vectorAlg::vecSize a = 0; a < _transforms.size(); ++a){
73 73 AnimUtils::TransformMatrix(_bones[a]->_globalTransform * _bones[a]->_offsetMatrix, rotationmat);
74 74 trans.push_back(rotationmat);
75 75 }
  @@ -91,7 +91,7 @@
91 91 // get all the animation names so I can reference them by name and get the correct id
92 92 U16 i = 0;
93 93 for(AnimEvaluator& animation : _animations){
94 - _animationNameToId.insert(Unordered_map<std::string, U32>::value_type(animation._name, i++));
94 + _animationNameToId.insert(hashMapImpl<stringImpl, U32>::value_type(animation._name, i++));
95 95 }
96 96 }
97 97
  @@ -135,16 +135,16 @@
135 135 }
136 136 }
137 137
138 - Bone* SceneAnimator::GetBoneByName(const std::string& bname) const {
139 - Unordered_map<std::string, Bone*>::const_iterator found = _bonesByName.find(bname);
138 + Bone* SceneAnimator::GetBoneByName(const stringImpl& bname) const {
139 + hashMapImpl<stringImpl, Bone*>::const_iterator found = _bonesByName.find(bname);
140 140 if(found != _bonesByName.end())
141 141 return found->second;
142 142 else
143 143 return nullptr;
144 144 }
145 145
146 - I32 SceneAnimator::GetBoneIndex(const std::string& bname) const {
147 - Unordered_map<std::string, U32>::const_iterator found = _bonesToIndex.find(bname);
146 + I32 SceneAnimator::GetBoneIndex(const stringImpl& bname) const {
147 + hashMapImpl<stringImpl, U32>::const_iterator found = _bonesToIndex.find(bname);
148 148 if(found != _bonesToIndex.end())
149 149 return found->second;
150 150 else
  @@ -171,11 +171,11 @@
171 171 }
172 172
173 173 ///Renders the current skeleton pose at time index dt
174 - const vectorImpl<Line >& SceneAnimator::getSkeletonLines(I32 animationIndex, const D32 dt) {
174 + const vectorImpl<Line >& SceneAnimator::getSkeletonLines(U32 animationIndex, const D32 dt) {
175 175 I32 frameIndex = _animations[animationIndex].GetFrameIndexAt(dt);
176 176 LineCollection::iterator it = _skeletonLines.find(animationIndex);
177 177 if (it == _skeletonLines.end()) {
178 - std::pair<LineCollection::iterator, bool > result = _skeletonLines.insert(std::make_pair(animationIndex, LineMap()));
178 + hashAlg::pair<LineCollection::iterator, bool> result = hashAlg::insert(_skeletonLines, hashAlg::makePair(animationIndex, LineMap()));
179 179 assert(result.second);
180 180 it = result.first;
181 181 }