diff options
-rw-r--r-- | engines/sci/graphics/animate.cpp | 10 | ||||
-rw-r--r-- | engines/sci/graphics/animate.h | 4 |
2 files changed, 6 insertions, 8 deletions
diff --git a/engines/sci/graphics/animate.cpp b/engines/sci/graphics/animate.cpp index 6f5a7ceac4..4aa19db9f4 100644 --- a/engines/sci/graphics/animate.cpp +++ b/engines/sci/graphics/animate.cpp @@ -204,15 +204,13 @@ void GfxAnimate::fill(byte &old_picNotValid, bool maySetNsRect) { // Get the corresponding view view = _cache->getView(it->viewId); - uint16 viewLoopCount = view->getLoopCount(); // adjust loop and cel, if any of those is invalid - if (it->loopNo >= viewLoopCount) { - it->loopNo = viewLoopCount - 1; + if (it->loopNo >= view->getLoopCount()) { + it->loopNo = 0; writeSelectorValue(_s->_segMan, curObject, SELECTOR(loop), it->loopNo); } - uint16 viewCelCount = view->getCelCount(it->loopNo); - if (it->celNo >= viewCelCount) { - it->celNo = viewCelCount - 1; + if (it->celNo >= view->getCelCount(it->loopNo)) { + it->celNo = 0; writeSelectorValue(_s->_segMan, curObject, SELECTOR(cel), it->celNo); } diff --git a/engines/sci/graphics/animate.h b/engines/sci/graphics/animate.h index 4739eb0d31..f25e54915e 100644 --- a/engines/sci/graphics/animate.h +++ b/engines/sci/graphics/animate.h @@ -60,8 +60,8 @@ struct AnimateEntry { int16 givenOrderNo; reg_t object; GuiResourceId viewId; - uint16 loopNo; - uint16 celNo; + int16 loopNo; + int16 celNo; int16 paletteNo; int16 x, y, z; int16 priority; |