| 207 | } |
| 208 | |
| 209 | void AnimatedPartSet::finishAnimations() { |
| 210 | for (auto& pair : m_stateTypes) { |
| 211 | auto& stateType = pair.second; |
| 212 | |
| 213 | while (true) { |
| 214 | auto const& state = *stateType.activeStatePointer; |
| 215 | |
| 216 | if (state.animationMode == End) { |
| 217 | stateType.activeState.timer = state.cycle; |
| 218 | } else if (state.animationMode == Transition) { |
| 219 | stateType.activeState.stateName = state.transitionState; |
| 220 | stateType.activeState.timer = 0.0f; |
| 221 | stateType.activeStatePointer = stateType.states.get(state.transitionState).get(); |
| 222 | continue; |
| 223 | } |
| 224 | break; |
| 225 | } |
| 226 | |
| 227 | stateType.activeStateDirty = true; |
| 228 | } |
| 229 | |
| 230 | for (auto& pair : m_parts) |
| 231 | pair.second.activePartDirty = true; |
| 232 | } |
| 233 | |
| 234 | AnimatedPartSet::AnimationMode AnimatedPartSet::stringToAnimationMode(String const& string) { |
| 235 | if (string.equals("end", String::CaseInsensitive)) { |