aboutsummaryrefslogtreecommitdiff
path: root/engines/illusions/actor.cpp
diff options
context:
space:
mode:
authorjohndoe1232014-04-14 13:48:24 +0200
committerEugene Sandulenko2018-07-20 06:43:33 +0000
commit097d130e7dd5de95050e800419f4d07aabb7562b (patch)
tree5eb111d454b9e14c7140ac0a8935894600b3dafa /engines/illusions/actor.cpp
parente131362590a768240454cc2b27f4548ba481ebfb (diff)
downloadscummvm-rg350-097d130e7dd5de95050e800419f4d07aabb7562b.tar.gz
scummvm-rg350-097d130e7dd5de95050e800419f4d07aabb7562b.tar.bz2
scummvm-rg350-097d130e7dd5de95050e800419f4d07aabb7562b.zip
ILLUSIONS: Implement RegionLayer and related code
Diffstat (limited to 'engines/illusions/actor.cpp')
-rw-r--r--engines/illusions/actor.cpp27
1 files changed, 25 insertions, 2 deletions
diff --git a/engines/illusions/actor.cpp b/engines/illusions/actor.cpp
index 83fd748496..030097bba9 100644
--- a/engines/illusions/actor.cpp
+++ b/engines/illusions/actor.cpp
@@ -71,11 +71,13 @@ Actor::Actor(IllusionsEngine *vm)
_frames = 0;
_scaleLayer = 0;
_priorityLayer = 0;
+ _regionLayer = 0;
_position.x = 0;
_position.y = 0;
_position2.x = 0;
_position2.y = 0;
_facing = 64;
+ _regionIndex = 0;
_fontId = 0;
_actorIndex = 0;
_parentObjectId = 0;
@@ -1069,7 +1071,7 @@ void Controls::placeActor(uint32 actorTypeId, Common::Point placePt, uint32 sequ
}
if (actorType->_regionLayerIndex) {
- // TODO actor->_regionLayer = bgRes->getPriorityLayer(actorType->_regionLayerIndex - 1);
+ actor->_regionLayer = bgRes->getRegionLayer(actorType->_regionLayerIndex - 1);
actor->_flags |= 0x20;
}
@@ -1355,7 +1357,28 @@ void Controls::actorControlRoutine(Control *control, uint32 deltaTime) {
}
if (actor->_flags & 0x20) {
- // TODO Update transition sequence (seems to be unused in BBDOU?)
+ // Update transition sequence
+ int regionIndex = actor->_regionLayer->getRegionIndex(actor->_position);
+ if (actor->_regionIndex != regionIndex) {
+ if (regionIndex) {
+ uint32 savedSequenceId = actor->_sequenceId;
+ byte *savedSeqCodeIp = actor->_seqCodeIp;
+ int savedSeqCodeValue1 = actor->_seqCodeValue1;
+ int savedSeqCodeValue3 = actor->_seqCodeValue3;
+ uint32 regionSequenceId = actor->_regionLayer->getRegionSequenceId(regionIndex);
+ debug("Running transition sequence %08X", regionSequenceId);
+ Sequence *sequence = _vm->_dict->findSequence(regionSequenceId);
+ actor->_sequenceId = regionSequenceId;
+ actor->_seqCodeIp = sequence->_sequenceCode;
+ actor->_seqCodeValue3 = 0;
+ control->sequenceActor();
+ actor->_sequenceId = savedSequenceId;
+ actor->_seqCodeIp = savedSeqCodeIp;
+ actor->_seqCodeValue3 = savedSeqCodeValue3;
+ actor->_seqCodeValue1 = savedSeqCodeValue1;
+ }
+ actor->_regionIndex = regionIndex;
+ }
}
}