aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPaul Gilbert2015-06-04 19:21:48 -0400
committerPaul Gilbert2015-06-04 19:21:48 -0400
commitfd6da47906ed8cbb7fa96ea56aaf352bd103f6b3 (patch)
tree19472009517f9223dbe7379b30c3031aa3816da7 /engines
parent69f389cc157fb8e1c4e9241d843fe8ad215b71f4 (diff)
downloadscummvm-rg350-fd6da47906ed8cbb7fa96ea56aaf352bd103f6b3.tar.gz
scummvm-rg350-fd6da47906ed8cbb7fa96ea56aaf352bd103f6b3.tar.bz2
scummvm-rg350-fd6da47906ed8cbb7fa96ea56aaf352bd103f6b3.zip
SHERLOCK: Implemented remaining new sequence opcodes in checkObject
Diffstat (limited to 'engines')
-rw-r--r--engines/sherlock/objects.cpp47
1 files changed, 43 insertions, 4 deletions
diff --git a/engines/sherlock/objects.cpp b/engines/sherlock/objects.cpp
index ce303873dd..0b3c294376 100644
--- a/engines/sherlock/objects.cpp
+++ b/engines/sherlock/objects.cpp
@@ -750,6 +750,7 @@ void Object::toggleHidden() {
void Object::checkObject() {
Scene &scene = *_vm->_scene;
Sound &sound = *_vm->_sound;
+ Talk &talk = *_vm->_talk;
int checkFrame = _allow ? MAX_FRAME : FRAMES_END;
bool codeFound;
@@ -788,7 +789,10 @@ void Object::checkObject() {
++_frameNumber;
}
} else if (IS_ROSE_TATTOO && (v == TALK_SEQ_CODE || v == TALK_LISTEN_CODE)) {
- error("TODO");
+ if (_talkSeq)
+ setObjTalkSequence(_talkSeq);
+ else
+ setObjSequence(0, false);
} else if (v >= GOTO_CODE) {
// Goto code found
v -= GOTO_CODE;
@@ -828,11 +832,46 @@ void Object::checkObject() {
break;
}
} else if (IS_ROSE_TATTOO && v == TELEPORT_CODE) {
- error("TODO");
+ _position.x = READ_LE_UINT16(&_sequences[_frameNumber + 1]);
+ _position.y = READ_LE_UINT16(&_sequences[_frameNumber + 3]);
+
+ _frameNumber += 5;
} else if (IS_ROSE_TATTOO && v == CALL_TALK_CODE) {
- error("TODO");
+ Common::String filename;
+ for (int idx = 0; idx < 8; ++idx) {
+ if (_sequences[_frameNumber + 1 + idx] != 1)
+ filename += (char)_sequences[_frameNumber + 1 + idx];
+ else
+ break;
+ }
+
+ _frameNumber += 8;
+ talk.talkTo(filename);
+
} else if (IS_ROSE_TATTOO && v == HIDE_CODE) {
- error("TODO");
+ switch (_sequences[_frameNumber + 2]) {
+ case 1:
+ // Hide Object
+ if (scene._bgShapes[_sequences[_frameNumber + 1] - 1]._type != HIDDEN)
+ scene._bgShapes[_sequences[_frameNumber + 1] - 1].toggleHidden();
+ break;
+
+ case 2:
+ // Activate Object
+ if (scene._bgShapes[_sequences[_frameNumber + 1] - 1]._type == HIDDEN)
+ scene._bgShapes[_sequences[_frameNumber + 1] - 1].toggleHidden();
+ break;
+
+ case 3:
+ // Toggle Object
+ scene._bgShapes[_sequences[_frameNumber + 1] - 1].toggleHidden();
+ break;
+
+ default:
+ break;
+ }
+ _frameNumber += 3;
+
} else {
v -= 128;