diff options
Diffstat (limited to 'engines/mads/sequence.cpp')
-rw-r--r-- | engines/mads/sequence.cpp | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/engines/mads/sequence.cpp b/engines/mads/sequence.cpp index e5bf1631c2..2afe089d4a 100644 --- a/engines/mads/sequence.cpp +++ b/engines/mads/sequence.cpp @@ -237,8 +237,8 @@ bool SequenceList::loadSprites(int seqIndex) { if ((seqEntry._flags != 0) || (seqEntry._dynamicHotspotIndex >= 0)) { SpriteAsset &spriteSet = *scene._sprites[seqEntry._spritesIndex]; MSprite *frame = spriteSet.getFrame(seqEntry._frameIndex - 1); - int width = frame->getWidth() * seqEntry._scale / 200; - int height = frame->getHeight() * seqEntry._scale / 100; + int width = frame->w * seqEntry._scale / 200; + int height = frame->h * seqEntry._scale / 100; Common::Point pt = spriteSlot._position; // Handle sprite movement, if present @@ -259,7 +259,7 @@ bool SequenceList::loadSprites(int seqIndex) { } if (seqEntry._flags & 2) { - // Check for object having moved off-scren + // Check for object having moved off-screen if ((pt.x + width) < 0 || (pt.x + width) >= MADS_SCREEN_WIDTH || pt.y < 0 || (pt.y - height) >= MADS_SCENE_HEIGHT) { result = true; @@ -550,4 +550,26 @@ void SequenceList::setMotion(int seqIndex, int flags, int deltaX, int deltaY) { se._posAccum.x = se._posAccum.y = 0; } +int SequenceList::addStampCycle(int srcSpriteIdx, bool flipped, int sprite) { + int id; + + id = addSpriteCycle(srcSpriteIdx, flipped, 32767, 0, 0, 0); + if (id >= 0) { + setAnimRange(id, sprite, sprite); + _entries[id]._animType = ANIMTYPE_STAMP; + } + return (id); +} + +void SequenceList::setSeqPlayer(int idx, bool flag) { + Player &player = _vm->_game->_player; + int yp = player._playerPos.y + (player._centerOfGravity * player._currentScale) / 100; + setPosition(idx, Common::Point(player._playerPos.x, yp)); + setDepth(idx, player._currentDepth); + setScale(idx, player._currentScale); + + if (flag) + _vm->_game->syncTimers(SYNC_SEQ, idx, SYNC_PLAYER, 0); +} + } // End of namespace |