coding standard

This commit is contained in:
luiscuenca 2017-11-02 10:34:57 -07:00
parent 9e0e1ab5a5
commit 81509b3e92
2 changed files with 4 additions and 5 deletions

View file

@ -152,7 +152,7 @@ void Rig::overrideRoleAnimation(const QString& role, const QString& url, float f
const float REFERENCE_FRAMES_PER_SECOND = 30.0f; const float REFERENCE_FRAMES_PER_SECOND = 30.0f;
float timeScale = fps / REFERENCE_FRAMES_PER_SECOND; float timeScale = fps / REFERENCE_FRAMES_PER_SECOND;
auto clipNode = std::make_shared<AnimClip>(role, url, firstFrame, lastFrame, timeScale, loop, false); auto clipNode = std::make_shared<AnimClip>(role, url, firstFrame, lastFrame, timeScale, loop, false);
_roleAnimState[role] = { role, url, fps, loop, firstFrame, lastFrame }; _roleAnimStates[role] = { role, url, fps, loop, firstFrame, lastFrame };
AnimNode::Pointer parent = node->getParent(); AnimNode::Pointer parent = node->getParent();
parent->replaceChild(node, clipNode); parent->replaceChild(node, clipNode);
} else { } else {
@ -1640,9 +1640,8 @@ void Rig::initAnimGraph(const QUrl& url) {
overrideAnimation(origState.url, origState.fps, origState.loop, origState.firstFrame, origState.lastFrame); overrideAnimation(origState.url, origState.fps, origState.loop, origState.firstFrame, origState.lastFrame);
} }
// restore the role animations we had before reset. // restore the role animations we had before reset.
for (auto ite = _roleAnimState.begin(); ite != _roleAnimState.end(); ite++) { for (auto& roleAnimState : _roleAnimStates) {
auto role = ite->first; auto roleState = roleAnimState.second;
auto roleState = _roleAnimState[role];
overrideRoleAnimation(roleState.role, roleState.url, roleState.fps, roleState.loop, roleState.firstFrame, roleState.lastFrame); overrideRoleAnimation(roleState.role, roleState.url, roleState.fps, roleState.loop, roleState.firstFrame, roleState.lastFrame);
} }
_animLoading = false; _animLoading = false;

View file

@ -350,7 +350,7 @@ protected:
}; };
UserAnimState _userAnimState; UserAnimState _userAnimState;
std::map<QString, RoleAnimState> _roleAnimState; std::map<QString, RoleAnimState> _roleAnimStates;
float _leftHandOverlayAlpha { 0.0f }; float _leftHandOverlayAlpha { 0.0f };
float _rightHandOverlayAlpha { 0.0f }; float _rightHandOverlayAlpha { 0.0f };