Got rid of the while loop in updateFrameCount in ModelEntityItem_cpp

This commit is contained in:
amantley 2017-12-12 09:12:11 -08:00
parent 29538851b6
commit 079d9639e4

View file

@ -287,10 +287,7 @@ void ModelEntityItem::updateFrameCount() {
_currentFrame += (deltaTime * getAnimationFPS());
if (_currentFrame > getAnimationLastFrame()) {
if (getAnimationLoop()) {
//_currentFrame = getAnimationFirstFrame() + (int)(glm::floor(_currentFrame - getAnimationFirstFrame())) % (updatedFrameCount - 1);
while (_currentFrame > (getAnimationFirstFrame() + (updatedFrameCount - 1))) {
_currentFrame = _currentFrame - (updatedFrameCount - 1);
}
_currentFrame = getAnimationFirstFrame() + (int)(glm::floor(_currentFrame - getAnimationFirstFrame())) % (updatedFrameCount - 1);
} else {
_currentFrame = getAnimationLastFrame();
}