aboutsummaryrefslogtreecommitdiff
path: root/engines/mads/sequence.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2014-03-06 22:31:41 -0500
committerPaul Gilbert2014-03-06 22:31:41 -0500
commita77ed90618664e50705b3e59dd2111faec2f5f39 (patch)
treeb7f55059e7902cf0d2007fcecb015029aa21d37a /engines/mads/sequence.cpp
parentc9186f51b9502a4cfb1881f2db4f92eeb6227144 (diff)
downloadscummvm-rg350-a77ed90618664e50705b3e59dd2111faec2f5f39.tar.gz
scummvm-rg350-a77ed90618664e50705b3e59dd2111faec2f5f39.tar.bz2
scummvm-rg350-a77ed90618664e50705b3e59dd2111faec2f5f39.zip
MADS: Implementing support methods needed for scene 804 initialisation
Diffstat (limited to 'engines/mads/sequence.cpp')
-rw-r--r--engines/mads/sequence.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/engines/mads/sequence.cpp b/engines/mads/sequence.cpp
index 8f25007b48..33febe3ec7 100644
--- a/engines/mads/sequence.cpp
+++ b/engines/mads/sequence.cpp
@@ -367,4 +367,23 @@ void SequenceList::scan() {
void SequenceList::setDepth(int seqIndex, int depth) {
_entries[seqIndex]._depth = depth;
}
+
+int SequenceList::addSpriteCycle(int srcSpriteIdx, bool flipped, int numTicks, int triggerCountdown, int timeoutTicks, int extraTicks) {
+ Scene &scene = _vm->_game->_scene;
+ MSprite *spriteFrame = scene._spriteSlots.getSprite(srcSpriteIdx).getFrame(0);
+ int depth = scene._depthSurface.getDepth(Common::Point(spriteFrame->_pos.x +
+ (spriteFrame->w / 2), spriteFrame->_pos.y + (spriteFrame->h / 2)));
+
+ return add(srcSpriteIdx, flipped, 1, triggerCountdown, timeoutTicks, extraTicks, numTicks, 0, 0,
+ true, 100, depth - 1, 1, ANIMTYPE_CYCLED, 0, 0);
+}
+
+int SequenceList::startCycle(int srcSpriteIndex, bool flipped, int cycleIndex) {
+ int result = addSpriteCycle(srcSpriteIndex, flipped, INDEFINITE_TIMEOUT, 0, 0, 0);
+ if (result >= 0)
+ setAnimRange(result, cycleIndex, cycleIndex);
+
+ return result;
+}
+
} // End of namespace