| 171 | } |
| 172 | |
| 173 | void Animation::updateCurrentGroup() |
| 174 | { |
| 175 | Debug::Log->trace( |
| 176 | " <Animation> Updating AnimationGroup '{}'", m_currentGroupName); |
| 177 | m_groups[m_currentGroupName]->next(); |
| 178 | if (m_groups[m_currentGroupName]->isOver()) |
| 179 | { |
| 180 | Debug::Log->trace( |
| 181 | " <Animation> AnimationGroup '{}' is over", m_currentGroupName); |
| 182 | if (m_codeIndex < m_code.size() - 1) |
| 183 | { |
| 184 | Debug::Log->trace(" <Animation> Restarting code execution"); |
| 185 | m_feedInstructions = true; |
| 186 | m_groups[m_currentGroupName]->reset(); |
| 187 | } |
| 188 | else |
| 189 | { |
| 190 | Debug::Log->trace( |
| 191 | " <Animation> Animation '{}' has no more code to execute"); |
| 192 | if (m_playMode == AnimationPlayMode::OneTime) |
| 193 | { |
| 194 | Debug::Log->trace(" <Animation> Animation '{}' will stay on " |
| 195 | "the last texture"); |
| 196 | m_groups[m_currentGroupName]->previous(true); |
| 197 | m_over = true; |
| 198 | } |
| 199 | else |
| 200 | { |
| 201 | Debug::Log->trace( |
| 202 | " <Animation> Animation '{}' will reset code execution"); |
| 203 | m_feedInstructions = true; |
| 204 | m_groups[m_currentGroupName]->reset(); |
| 205 | m_codeIndex = 0; |
| 206 | } |
| 207 | } |
| 208 | } |
| 209 | } |
| 210 | |
| 211 | void Animation::setActiveAnimationGroup(const std::string& groupName) |
| 212 | { |