MYST3: Implement opcodes 145 and 146 - reload / redraw node

This commit is contained in:
Bastien Bouclet 2012-01-29 13:29:02 +01:00
parent c2e9233eb4
commit 7a4fb8fed3
3 changed files with 25 additions and 1 deletions

View File

@ -32,7 +32,14 @@ bool HotSpot::isPointInRectsCube(const Common::Point &p) {
rects[j].centerPitch - rects[j].height / 2,
rects[j].centerHeading + rects[j].width / 2,
rects[j].centerPitch + rects[j].height / 2);
if (rect.contains(p))
Common::Point lookAt = p;
// Make sure heading is in the correct range
if (rect.left > 360 || rect.right > 360)
lookAt.x += 360;
if (rect.contains(lookAt))
return true;
}

View File

@ -172,6 +172,8 @@ Script::Script(Myst3Engine *vm):
OP_2(139, goToRoomNode, kValue, kValue );
OP_1(140, zipToNode, kValue );
OP_2(141, zipToRoomNode, kValue, kValue );
OP_0(145, reloadNode );
OP_0(146, redrawFrame );
OP_1(147, moviePlay, kEvalValue );
OP_1(148, moviePlaySynchronized, kEvalValue );
OP_1(149, moviePlayFullFrame, kEvalValue );
@ -1775,6 +1777,19 @@ void Script::zipToRoomNode(Context &c, const Opcode &cmd) {
_vm->goToNode(0, 3);
}
void Script::reloadNode(Context &c, const Opcode &cmd) {
debugC(kDebugScript, "Opcode %d: Reload current node", cmd.op);
_vm->loadNode(0);
_vm->drawFrame();
}
void Script::redrawFrame(Context &c, const Opcode &cmd) {
debugC(kDebugScript, "Opcode %d: Reload current node", cmd.op);
_vm->drawFrame();
}
void Script::moviePlay(Context &c, const Opcode &cmd) {
debugC(kDebugScript, "Opcode %d: Play movie %d", cmd.op, cmd.args[0]);

View File

@ -222,6 +222,8 @@ private:
DECLARE_OPCODE(goToRoomNode);
DECLARE_OPCODE(zipToNode);
DECLARE_OPCODE(zipToRoomNode);
DECLARE_OPCODE(reloadNode);
DECLARE_OPCODE(redrawFrame);
DECLARE_OPCODE(moviePlay);
DECLARE_OPCODE(moviePlaySynchronized);
DECLARE_OPCODE(moviePlayFullFrame);