Apply modernize-loop-convert again

pull/4699/head
Turo Lamminen 2022-08-23 14:02:36 +03:00
parent 5f28c51c03
commit 712671e81a
1 changed files with 7 additions and 11 deletions

View File

@ -209,11 +209,9 @@ void SMDImporter::FixTimeValues() {
double dDelta = (double)iSmallestFrame; double dDelta = (double)iSmallestFrame;
double dMax = 0.0f; double dMax = 0.0f;
for (auto &asBone : asBones) { for (auto &asBone : asBones) {
for (std::vector<SMD::Bone::Animation::MatrixKey>::iterator for (auto &asKey : asBone.sAnim.asKeys) {
iKey = asBone.sAnim.asKeys.begin(); asKey.dTime -= dDelta;
iKey != asBone.sAnim.asKeys.end();++iKey) { dMax = std::max(dMax, asKey.dTime);
(*iKey).dTime -= dDelta;
dMax = std::max(dMax, (*iKey).dTime);
} }
} }
dLengthOfAnim = dMax; dLengthOfAnim = dMax;
@ -522,15 +520,13 @@ void SMDImporter::CreateOutputAnimation(int index, const std::string &name) {
aiVectorKey* pVecKeys = p->mPositionKeys = new aiVectorKey[p->mNumRotationKeys]; aiVectorKey* pVecKeys = p->mPositionKeys = new aiVectorKey[p->mNumRotationKeys];
aiQuatKey* pRotKeys = p->mRotationKeys = new aiQuatKey[p->mNumRotationKeys]; aiQuatKey* pRotKeys = p->mRotationKeys = new aiQuatKey[p->mNumRotationKeys];
for (std::vector<SMD::Bone::Animation::MatrixKey>::const_iterator for (const auto &asKey : asBone.sAnim.asKeys) {
qq = asBone.sAnim.asKeys.begin(); pRotKeys->mTime = pVecKeys->mTime = asKey.dTime;
qq != asBone.sAnim.asKeys.end(); ++qq) {
pRotKeys->mTime = pVecKeys->mTime = (*qq).dTime;
// compute the rotation quaternion from the euler angles // compute the rotation quaternion from the euler angles
// aiQuaternion: The order of the parameters is yzx? // aiQuaternion: The order of the parameters is yzx?
pRotKeys->mValue = aiQuaternion((*qq).vRot.y, (*qq).vRot.z, (*qq).vRot.x); pRotKeys->mValue = aiQuaternion(asKey.vRot.y, asKey.vRot.z, asKey.vRot.x);
pVecKeys->mValue = (*qq).vPos; pVecKeys->mValue = asKey.vPos;
++pVecKeys; ++pRotKeys; ++pVecKeys; ++pRotKeys;
} }