aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorFilippos Karapetis2015-11-09 12:04:09 +0200
committerFilippos Karapetis2015-11-09 12:04:09 +0200
commitbff5a3e6802e9a7f00e7089a3d9c3516a82f27e7 (patch)
tree3a55b64004313a14c30ac448f13f88f45062c653 /engines
parent47f43770ae05477d2ea41858d48248391006ce59 (diff)
downloadscummvm-rg350-bff5a3e6802e9a7f00e7089a3d9c3516a82f27e7.tar.gz
scummvm-rg350-bff5a3e6802e9a7f00e7089a3d9c3516a82f27e7.tar.bz2
scummvm-rg350-bff5a3e6802e9a7f00e7089a3d9c3516a82f27e7.zip
MADS: Phantom: Implement Scene::drawToBackground()
This is used to conditionally display additional background objects. Also, added a TODO in Scene::deleteSequence()
Diffstat (limited to 'engines')
-rw-r--r--engines/mads/scene.cpp28
1 files changed, 23 insertions, 5 deletions
diff --git a/engines/mads/scene.cpp b/engines/mads/scene.cpp
index 4c48619ab9..4e7ec2f61c 100644
--- a/engines/mads/scene.cpp
+++ b/engines/mads/scene.cpp
@@ -793,8 +793,23 @@ void Scene::setCamera(Common::Point pos) {
_posAdjust = pos;
}
-void Scene::drawToBackground(int series_id, int sprite_id, Common::Point pos, int depth, int scale) {
- warning("TODO: Scene::drawToBackground");
+void Scene::drawToBackground(int spriteId, int frameId, Common::Point pos, int depth, int scale) {
+ SpriteAsset &asset = *_sprites[spriteId];
+
+ if (pos.x == -32000)
+ pos.x = asset.getFramePos(frameId - 1).x;
+ if (pos.y == -32000)
+ pos.y = asset.getFramePos(frameId - 1).y;
+
+ int slotIndex = _spriteSlots.add();
+ SpriteSlot &slot = _spriteSlots[slotIndex];
+ slot._spritesIndex = spriteId;
+ slot._frameNumber = frameId;
+ slot._seqIndex = 1;
+ slot._position = pos;
+ slot._depth = depth;
+ slot._scale = scale;
+ slot._flags = IMG_DELTA;
}
void Scene::deleteSequence(int idx) {
@@ -803,10 +818,13 @@ void Scene::deleteSequence(int idx) {
_sequences[idx]._active = false;
- if (!_sequences[idx]._doneFlag)
- doFrame(); // FIXME/CHECKME: Is this correct?
- else
+ if (!_sequences[idx]._doneFlag) {
+ warning("TODO: deleteSequence: Sequence %d not done", idx);
+ // TODO: This is wrong, and crashes Phantom at scene 102 when the door is opened
+ //doFrame(); // FIXME/CHECKME: Is this correct?
+ } else {
_sequences.remove(idx);
+ }
}
void Scene::loadSpeech(int idx) {