MOHAWK: Myst: Improve script execution tracing
This commit is contained in:
parent
3e99dd8ccc
commit
a99397f126
25 changed files with 432 additions and 941 deletions
|
@ -28,6 +28,7 @@
|
|||
#include "mohawk/myst_sound.h"
|
||||
#include "mohawk/video.h"
|
||||
|
||||
#include "common/debug-channels.h"
|
||||
#include "common/system.h"
|
||||
#include "common/memstream.h"
|
||||
#include "common/textconsole.h"
|
||||
|
@ -100,8 +101,8 @@ void MystScriptParser::setupCommonOpcodes() {
|
|||
OPCODE(4, o_redrawCard);
|
||||
// Opcode 5 Not Present
|
||||
OPCODE(6, o_goToDestForward);
|
||||
OPCODE(7, o_goToDestLeft);
|
||||
OPCODE(8, o_goToDestRight);
|
||||
OPCODE(7, o_goToDestRight);
|
||||
OPCODE(8, o_goToDestLeft);
|
||||
OPCODE(9, o_triggerMovie);
|
||||
OPCODE(10, o_toggleVarNoRedraw);
|
||||
// Opcode 11 Not Present
|
||||
|
@ -150,13 +151,10 @@ void MystScriptParser::setupCommonOpcodes() {
|
|||
#undef OPCODE
|
||||
|
||||
void MystScriptParser::runScript(MystScript script, MystArea *invokingResource) {
|
||||
debugC(kDebugScript, "Script Size: %d", script->size());
|
||||
|
||||
_scriptNestingLevel++;
|
||||
|
||||
for (uint16 i = 0; i < script->size(); i++) {
|
||||
MystScriptEntry &entry = (*script)[i];
|
||||
debugC(kDebugScript, "\tOpcode %d: %d", i, entry.opcode);
|
||||
|
||||
if (entry.type == kMystScriptNormal)
|
||||
_invokingResource = invokingResource;
|
||||
|
@ -175,7 +173,11 @@ void MystScriptParser::runOpcode(uint16 op, uint16 var, const ArgumentsArray &ar
|
|||
bool ranOpcode = false;
|
||||
for (uint16 i = 0; i < _opcodes.size(); i++)
|
||||
if (_opcodes[i]->op == op) {
|
||||
(this->*(_opcodes[i]->proc)) (op, var, args);
|
||||
if (DebugMan.isDebugChannelEnabled(kDebugScript)) {
|
||||
debugC(kDebugScript, "Running command: %s", describeCommand(*_opcodes[i], var, args).c_str());
|
||||
}
|
||||
|
||||
(this->*(_opcodes[i]->proc)) (var, args);
|
||||
ranOpcode = true;
|
||||
break;
|
||||
}
|
||||
|
@ -198,6 +200,22 @@ const Common::String MystScriptParser::getOpcodeDesc(uint16 op) {
|
|||
return Common::String::format("%d", op);
|
||||
}
|
||||
|
||||
Common::String MystScriptParser::describeCommand(const MystOpcode &command, uint16 var, const ArgumentsArray &args) {
|
||||
Common::String desc = Common::String::format("%s(", command.desc);
|
||||
|
||||
if (var != 0) {
|
||||
desc += Common::String::format("var = %d%s", var, args.size() != 0 ? ", " : "");
|
||||
}
|
||||
|
||||
for (uint16 j = 0; j < args.size(); j++) {
|
||||
desc += Common::String::format("%d", args[j]);
|
||||
if (j != args.size() - 1)
|
||||
desc += ", ";
|
||||
}
|
||||
desc += ")";
|
||||
return desc;
|
||||
}
|
||||
|
||||
MystScript MystScriptParser::readScript(Common::SeekableReadStream *stream, MystScriptType type) {
|
||||
assert(stream);
|
||||
assert(type != kMystScriptNone);
|
||||
|
@ -280,44 +298,22 @@ void MystScriptParser::animatedUpdate(const ArgumentsArray &args, uint16 delay)
|
|||
}
|
||||
}
|
||||
|
||||
void MystScriptParser::unknown(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
warning("Unimplemented opcode 0x%02x (%d)", op, op);
|
||||
warning("\tUses var %d", var);
|
||||
warning("\tArg count = %d", args.size());
|
||||
|
||||
if (!args.empty()) {
|
||||
Common::String str;
|
||||
str += Common::String::format("%d", args[0]);
|
||||
|
||||
for (uint16 i = 1; i < args.size(); i++)
|
||||
str += Common::String::format(", %d", args[i]);
|
||||
|
||||
warning("\tArgs: %s\n", str.c_str());
|
||||
}
|
||||
void MystScriptParser::NOP(uint16 var, const ArgumentsArray &args) {
|
||||
}
|
||||
|
||||
void MystScriptParser::NOP(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
}
|
||||
|
||||
void MystScriptParser::o_toggleVar(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Toggle var %d", op, var);
|
||||
|
||||
void MystScriptParser::o_toggleVar(uint16 var, const ArgumentsArray &args) {
|
||||
toggleVar(var);
|
||||
_vm->redrawArea(var);
|
||||
}
|
||||
|
||||
void MystScriptParser::o_setVar(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Set var %d: %d", op, var, args[0]);
|
||||
|
||||
void MystScriptParser::o_setVar(uint16 var, const ArgumentsArray &args) {
|
||||
if (setVarValue(var, args[0]))
|
||||
_vm->redrawArea(var);
|
||||
}
|
||||
|
||||
void MystScriptParser::o_changeCardSwitch4(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
void MystScriptParser::o_changeCardSwitch4(uint16 var, const ArgumentsArray &args) {
|
||||
uint16 value = getVar(var);
|
||||
|
||||
debugC(kDebugScript, "Opcode %d: changeCardSwitch var %d: %d", op, var, value);
|
||||
|
||||
if (value)
|
||||
_vm->changeToCard(args[value -1 ], kTransitionDissolve);
|
||||
else if (_invokingResource != nullptr)
|
||||
|
@ -326,11 +322,9 @@ void MystScriptParser::o_changeCardSwitch4(uint16 op, uint16 var, const Argument
|
|||
warning("Missing invokingResource in altDest call");
|
||||
}
|
||||
|
||||
void MystScriptParser::o_changeCardSwitchLtR(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
void MystScriptParser::o_changeCardSwitchLtR(uint16 var, const ArgumentsArray &args) {
|
||||
uint16 value = getVar(var);
|
||||
|
||||
debugC(kDebugScript, "Opcode %d: changeCardSwitch var %d: %d", op, var, value);
|
||||
|
||||
if (value)
|
||||
_vm->changeToCard(args[value -1 ], kTransitionLeftToRight);
|
||||
else if (_invokingResource != nullptr)
|
||||
|
@ -339,11 +333,9 @@ void MystScriptParser::o_changeCardSwitchLtR(uint16 op, uint16 var, const Argume
|
|||
warning("Missing invokingResource in altDest call");
|
||||
}
|
||||
|
||||
void MystScriptParser::o_changeCardSwitchRtL(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
void MystScriptParser::o_changeCardSwitchRtL(uint16 var, const ArgumentsArray &args) {
|
||||
uint16 value = getVar(var);
|
||||
|
||||
debugC(kDebugScript, "Opcode %d: changeCardSwitch var %d: %d", op, var, value);
|
||||
|
||||
if (value)
|
||||
_vm->changeToCard(args[value -1 ], kTransitionRightToLeft);
|
||||
else if (_invokingResource != nullptr)
|
||||
|
@ -352,7 +344,7 @@ void MystScriptParser::o_changeCardSwitchRtL(uint16 op, uint16 var, const Argume
|
|||
warning("Missing invokingResource in altDest call");
|
||||
}
|
||||
|
||||
void MystScriptParser::o_takePage(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
void MystScriptParser::o_takePage(uint16 var, const ArgumentsArray &args) {
|
||||
// In most game releases, the first opcode argument is the new mouse cursor.
|
||||
// However, in the original v1.0 English release this opcode takes no argument.
|
||||
uint16 cursorId; // = args[0];
|
||||
|
@ -375,8 +367,6 @@ void MystScriptParser::o_takePage(uint16 op, uint16 var, const ArgumentsArray &a
|
|||
|
||||
uint16 oldPage = _globals.heldPage;
|
||||
|
||||
debugC(kDebugScript, "Opcode %d: takePage Var %d CursorId %d", op, var, cursorId);
|
||||
|
||||
// Take / drop page
|
||||
toggleVar(var);
|
||||
|
||||
|
@ -394,61 +384,48 @@ void MystScriptParser::o_takePage(uint16 op, uint16 var, const ArgumentsArray &a
|
|||
}
|
||||
}
|
||||
|
||||
void MystScriptParser::o_redrawCard(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Redraw card", op);
|
||||
|
||||
void MystScriptParser::o_redrawCard(uint16 var, const ArgumentsArray &args) {
|
||||
_vm->drawCardBackground();
|
||||
_vm->drawResourceImages();
|
||||
_vm->_gfx->copyBackBufferToScreen(Common::Rect(544, 333));
|
||||
}
|
||||
|
||||
void MystScriptParser::o_goToDest(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Change To Dest of Invoking Resource", op);
|
||||
|
||||
void MystScriptParser::o_goToDest(uint16 var, const ArgumentsArray &args) {
|
||||
if (_invokingResource != nullptr)
|
||||
_vm->changeToCard(_invokingResource->getDest(), kTransitionCopy);
|
||||
else
|
||||
warning("Opcode %d: Missing invokingResource", op);
|
||||
warning("Opcode o_goToDest: Missing invokingResource");
|
||||
}
|
||||
|
||||
void MystScriptParser::o_goToDestForward(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Change To Dest of Invoking Resource", op);
|
||||
|
||||
void MystScriptParser::o_goToDestForward(uint16 var, const ArgumentsArray &args) {
|
||||
if (_invokingResource != nullptr)
|
||||
_vm->changeToCard(_invokingResource->getDest(), kTransitionDissolve);
|
||||
else
|
||||
warning("Opcode %d: Missing invokingResource", op);
|
||||
warning("Opcode o_goToDestForward: Missing invokingResource");
|
||||
}
|
||||
|
||||
void MystScriptParser::o_goToDestLeft(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Change To Dest of Invoking Resource", op);
|
||||
|
||||
void MystScriptParser::o_goToDestRight(uint16 var, const ArgumentsArray &args) {
|
||||
if (_invokingResource != nullptr)
|
||||
_vm->changeToCard(_invokingResource->getDest(), kTransitionPartToRight);
|
||||
else
|
||||
warning("Opcode %d: Missing invokingResource", op);
|
||||
warning("Opcode o_goToDestRight: Missing invokingResource");
|
||||
}
|
||||
|
||||
void MystScriptParser::o_goToDestRight(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Change To Dest of Invoking Resource", op);
|
||||
|
||||
void MystScriptParser::o_goToDestLeft(uint16 var, const ArgumentsArray &args) {
|
||||
if (_invokingResource != nullptr)
|
||||
_vm->changeToCard(_invokingResource->getDest(), kTransitionPartToLeft);
|
||||
else
|
||||
warning("Opcode %d: Missing invokingResource", op);
|
||||
warning("Opcode o_goToDestLeft: Missing invokingResource");
|
||||
}
|
||||
|
||||
void MystScriptParser::o_goToDestUp(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Change To Dest of Invoking Resource", op);
|
||||
|
||||
void MystScriptParser::o_goToDestUp(uint16 var, const ArgumentsArray &args) {
|
||||
if (_invokingResource != nullptr)
|
||||
_vm->changeToCard(_invokingResource->getDest(), kTransitionTopToBottom);
|
||||
else
|
||||
warning("Opcode %d: Missing invokingResource", op);
|
||||
warning("Opcode o_goToDestUp: Missing invokingResource");
|
||||
}
|
||||
|
||||
void MystScriptParser::o_triggerMovie(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Trigger Type 6 Resource Movie..", op);
|
||||
void MystScriptParser::o_triggerMovie(uint16 var, const ArgumentsArray &args) {
|
||||
// The original has code to pause the background music before playing the movie,
|
||||
// if the movie has a sound track, as well as code to resume it afterwards. But since
|
||||
// the movie has not yet been loaded at this point, it is impossible to know
|
||||
|
@ -458,46 +435,31 @@ void MystScriptParser::o_triggerMovie(uint16 op, uint16 var, const ArgumentsArra
|
|||
if (args.size() == 1)
|
||||
direction = args[0];
|
||||
|
||||
debugC(kDebugScript, "\tDirection: %d", direction);
|
||||
|
||||
// Trigger resource 6 movie overriding play direction
|
||||
MystAreaVideo *resource = getInvokingResource<MystAreaVideo>();
|
||||
resource->setDirection(direction);
|
||||
resource->playMovie();
|
||||
}
|
||||
|
||||
void MystScriptParser::o_toggleVarNoRedraw(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: toggleVarNoRedraw", op);
|
||||
|
||||
void MystScriptParser::o_toggleVarNoRedraw(uint16 var, const ArgumentsArray &args) {
|
||||
toggleVar(var);
|
||||
}
|
||||
|
||||
void MystScriptParser::o_drawAreaState(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: drawAreaState, state: %d", op, args[0]);
|
||||
debugC(kDebugScript, "\tVar: %d", var);
|
||||
|
||||
void MystScriptParser::o_drawAreaState(uint16 var, const ArgumentsArray &args) {
|
||||
MystAreaImageSwitch *parent = static_cast<MystAreaImageSwitch *>(getInvokingResource<MystArea>()->_parent);
|
||||
parent->drawConditionalDataToScreen(args[0]);
|
||||
}
|
||||
|
||||
void MystScriptParser::o_redrawAreaForVar(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: redraw area", op);
|
||||
debugC(kDebugScript, "\tvar: %d", var);
|
||||
|
||||
void MystScriptParser::o_redrawAreaForVar(uint16 var, const ArgumentsArray &args) {
|
||||
_vm->redrawArea(var);
|
||||
}
|
||||
|
||||
void MystScriptParser::o_changeCardDirectional(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
void MystScriptParser::o_changeCardDirectional(uint16 var, const ArgumentsArray &args) {
|
||||
|
||||
// Used by Channelwood Card 3262 (In Elevator)
|
||||
debugC(kDebugScript, "Opcode %d: Change Card with optional directional update", op);
|
||||
|
||||
uint16 cardId = args[0];
|
||||
uint16 directionalUpdateDataSize = args[1];
|
||||
|
||||
debugC(kDebugScript, "\tcardId: %d", cardId);
|
||||
debugC(kDebugScript, "\tdirectonal update data size: %d", directionalUpdateDataSize);
|
||||
|
||||
_vm->changeToCard(cardId, kNoTransition);
|
||||
|
||||
animatedUpdate(ArgumentsArray(args.begin() + 2, directionalUpdateDataSize), 0);
|
||||
|
@ -507,24 +469,16 @@ void MystScriptParser::o_changeCardDirectional(uint16 op, uint16 var, const Argu
|
|||
// but with the current cardId stored.
|
||||
// Opcode 18 then "pops" this stored CardId and returns to that card.
|
||||
|
||||
void MystScriptParser::o_changeCardPush(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Jump to Card Id, Storing Current Card Id", op);
|
||||
|
||||
void MystScriptParser::o_changeCardPush(uint16 var, const ArgumentsArray &args) {
|
||||
_savedCardId = _vm->getCurCard();
|
||||
|
||||
uint16 cardId = args[0];
|
||||
TransitionType transition = static_cast<TransitionType>(args[1]);
|
||||
|
||||
debugC(kDebugScript, "\tCurrent CardId: %d", _savedCardId);
|
||||
debugC(kDebugScript, "\tJump to CardId: %d", cardId);
|
||||
|
||||
_vm->changeToCard(cardId, transition);
|
||||
}
|
||||
|
||||
void MystScriptParser::o_changeCardPop(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Return To Stored Card Id", op);
|
||||
debugC(kDebugScript, "\tCardId: %d", _savedCardId);
|
||||
|
||||
void MystScriptParser::o_changeCardPop(uint16 var, const ArgumentsArray &args) {
|
||||
if (_savedCardId == 0) {
|
||||
warning("No pushed card to go back to");
|
||||
return;
|
||||
|
@ -535,14 +489,10 @@ void MystScriptParser::o_changeCardPop(uint16 op, uint16 var, const ArgumentsArr
|
|||
_vm->changeToCard(_savedCardId, transition);
|
||||
}
|
||||
|
||||
void MystScriptParser::o_enableAreas(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Enable Hotspots", op);
|
||||
|
||||
void MystScriptParser::o_enableAreas(uint16 var, const ArgumentsArray &args) {
|
||||
uint16 count = args[0];
|
||||
|
||||
for (uint16 i = 0; i < count; i++) {
|
||||
debugC(kDebugScript, "Enable hotspot index %d", args[i + 1]);
|
||||
|
||||
MystArea *resource = nullptr;
|
||||
if (args[i + 1] == 0xFFFF)
|
||||
resource = _invokingResource;
|
||||
|
@ -556,14 +506,10 @@ void MystScriptParser::o_enableAreas(uint16 op, uint16 var, const ArgumentsArray
|
|||
}
|
||||
}
|
||||
|
||||
void MystScriptParser::o_disableAreas(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Disable Hotspots", op);
|
||||
|
||||
void MystScriptParser::o_disableAreas(uint16 var, const ArgumentsArray &args) {
|
||||
uint16 count = args[0];
|
||||
|
||||
for (uint16 i = 0; i < count; i++) {
|
||||
debugC(kDebugScript, "Disable hotspot index %d", args[i + 1]);
|
||||
|
||||
MystArea *resource = nullptr;
|
||||
if (args[i + 1] == 0xFFFF)
|
||||
resource = _invokingResource;
|
||||
|
@ -577,20 +523,14 @@ void MystScriptParser::o_disableAreas(uint16 op, uint16 var, const ArgumentsArra
|
|||
}
|
||||
}
|
||||
|
||||
void MystScriptParser::o_directionalUpdate(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Transition / Directional update", op);
|
||||
|
||||
void MystScriptParser::o_directionalUpdate(uint16 var, const ArgumentsArray &args) {
|
||||
animatedUpdate(args, 0);
|
||||
}
|
||||
|
||||
void MystScriptParser::o_toggleAreasActivation(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Toggle areas activation", op);
|
||||
|
||||
void MystScriptParser::o_toggleAreasActivation(uint16 var, const ArgumentsArray &args) {
|
||||
uint16 count = args[0];
|
||||
|
||||
for (uint16 i = 0; i < count; i++) {
|
||||
debugC(kDebugScript, "Enable/Disable hotspot index %d", args[i + 1]);
|
||||
|
||||
MystArea *resource = nullptr;
|
||||
if (args[i + 1] == 0xFFFF)
|
||||
resource = _invokingResource;
|
||||
|
@ -604,33 +544,24 @@ void MystScriptParser::o_toggleAreasActivation(uint16 op, uint16 var, const Argu
|
|||
}
|
||||
}
|
||||
|
||||
void MystScriptParser::o_playSound(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
void MystScriptParser::o_playSound(uint16 var, const ArgumentsArray &args) {
|
||||
uint16 soundId = args[0];
|
||||
|
||||
debugC(kDebugScript, "Opcode %d: playSound", op);
|
||||
debugC(kDebugScript, "\tsoundId: %d", soundId);
|
||||
|
||||
_vm->_sound->playEffect(soundId);
|
||||
}
|
||||
|
||||
void MystScriptParser::o_stopSoundBackground(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: stopSoundBackground", op);
|
||||
void MystScriptParser::o_stopSoundBackground(uint16 var, const ArgumentsArray &args) {
|
||||
_vm->_sound->stopBackground();
|
||||
}
|
||||
|
||||
void MystScriptParser::o_playSoundBlocking(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
void MystScriptParser::o_playSoundBlocking(uint16 var, const ArgumentsArray &args) {
|
||||
uint16 soundId = args[0];
|
||||
|
||||
debugC(kDebugScript, "Opcode %d: playSoundBlocking", op);
|
||||
debugC(kDebugScript, "\tsoundId: %d", soundId);
|
||||
|
||||
_vm->_sound->stopEffect();
|
||||
_vm->playSoundBlocking(soundId);
|
||||
}
|
||||
|
||||
void MystScriptParser::o_copyBackBufferToScreen(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Copy back buffer to screen", op);
|
||||
|
||||
void MystScriptParser::o_copyBackBufferToScreen(uint16 var, const ArgumentsArray &args) {
|
||||
Common::Rect rect;
|
||||
if (args[0] == 0xFFFF) {
|
||||
// Used in Stoneship Card 2111 (Compass Rose)
|
||||
|
@ -648,7 +579,7 @@ void MystScriptParser::o_copyBackBufferToScreen(uint16 op, uint16 var, const Arg
|
|||
_vm->_gfx->copyBackBufferToScreen(rect);
|
||||
}
|
||||
|
||||
void MystScriptParser::o_copyImageToBackBuffer(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
void MystScriptParser::o_copyImageToBackBuffer(uint16 var, const ArgumentsArray &args) {
|
||||
uint16 imageId = args[0];
|
||||
|
||||
// WORKAROUND wrong image id in mechanical staircase
|
||||
|
@ -668,8 +599,6 @@ void MystScriptParser::o_copyImageToBackBuffer(uint16 op, uint16 var, const Argu
|
|||
dstRect.right = dstRect.left + srcRect.width();
|
||||
dstRect.bottom = dstRect.top + srcRect.height();
|
||||
|
||||
debugC(kDebugScript, "Opcode %d: Copy image to back buffer", op);
|
||||
debugC(kDebugScript, "\timageId: %d", imageId);
|
||||
debugC(kDebugScript, "\tsrcRect.left: %d", srcRect.left);
|
||||
debugC(kDebugScript, "\tsrcRect.top: %d", srcRect.top);
|
||||
debugC(kDebugScript, "\tsrcRect.right: %d", srcRect.right);
|
||||
|
@ -682,11 +611,9 @@ void MystScriptParser::o_copyImageToBackBuffer(uint16 op, uint16 var, const Argu
|
|||
_vm->_gfx->copyImageSectionToBackBuffer(imageId, srcRect, dstRect);
|
||||
}
|
||||
|
||||
void MystScriptParser::o_changeBackgroundSound(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
void MystScriptParser::o_changeBackgroundSound(uint16 var, const ArgumentsArray &args) {
|
||||
// Used on Stoneship Card 2080
|
||||
// Used on Channelwood Card 3225 with argc = 8 i.e. Conditional Sound List
|
||||
debugC(kDebugScript, "Opcode %d: Process Sound Block", op);
|
||||
|
||||
Common::MemoryWriteStreamDynamic writeStream = Common::MemoryWriteStreamDynamic(DisposeAfterUse::YES);
|
||||
for (uint i = 0; i < args.size(); i++) {
|
||||
writeStream.writeUint16LE(args[i]);
|
||||
|
@ -698,27 +625,21 @@ void MystScriptParser::o_changeBackgroundSound(uint16 op, uint16 var, const Argu
|
|||
_vm->applySoundBlock(soundBlock);
|
||||
}
|
||||
|
||||
void MystScriptParser::o_soundPlaySwitch(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Switch Choice of Play Sound", op);
|
||||
|
||||
void MystScriptParser::o_soundPlaySwitch(uint16 var, const ArgumentsArray &args) {
|
||||
uint16 value = getVar(var);
|
||||
|
||||
if (value < args.size()) {
|
||||
uint16 soundId = args[value];
|
||||
debugC(kDebugScript, "\tvar: %d", var);
|
||||
debugC(kDebugScript, "\tsoundId: %d", soundId);
|
||||
|
||||
if (soundId)
|
||||
_vm->_sound->playEffect(soundId);
|
||||
}
|
||||
}
|
||||
|
||||
void MystScriptParser::o_soundResumeBackground(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: soundResumeBackground", op);
|
||||
void MystScriptParser::o_soundResumeBackground(uint16 var, const ArgumentsArray &args) {
|
||||
_vm->_sound->resumeBackground();
|
||||
}
|
||||
|
||||
void MystScriptParser::o_copyImageToScreen(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
void MystScriptParser::o_copyImageToScreen(uint16 var, const ArgumentsArray &args) {
|
||||
uint16 imageId = args[0];
|
||||
|
||||
Common::Rect srcRect = Common::Rect(args[1], args[2], args[3], args[4]);
|
||||
|
@ -734,8 +655,6 @@ void MystScriptParser::o_copyImageToScreen(uint16 op, uint16 var, const Argument
|
|||
dstRect.right = dstRect.left + srcRect.width();
|
||||
dstRect.bottom = dstRect.top + srcRect.height();
|
||||
|
||||
debugC(kDebugScript, "Opcode %d: Copy image to screen", op);
|
||||
debugC(kDebugScript, "\timageId: %d", imageId);
|
||||
debugC(kDebugScript, "\tsrcRect.left: %d", srcRect.left);
|
||||
debugC(kDebugScript, "\tsrcRect.top: %d", srcRect.top);
|
||||
debugC(kDebugScript, "\tsrcRect.right: %d", srcRect.right);
|
||||
|
@ -748,73 +667,51 @@ void MystScriptParser::o_copyImageToScreen(uint16 op, uint16 var, const Argument
|
|||
_vm->_gfx->copyImageSectionToScreen(imageId, srcRect, dstRect);
|
||||
}
|
||||
|
||||
void MystScriptParser::o_changeCard(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Change Card", op);
|
||||
|
||||
void MystScriptParser::o_changeCard(uint16 var, const ArgumentsArray &args) {
|
||||
uint16 cardId = args[0];
|
||||
TransitionType transition = static_cast<TransitionType>(args[1]);
|
||||
|
||||
debugC(kDebugScript, "\tTarget Card: %d", cardId);
|
||||
|
||||
_vm->changeToCard(cardId, transition);
|
||||
}
|
||||
|
||||
void MystScriptParser::o_drawImageChangeCard(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Draw Full Screen Image, Delay then Change Card", op);
|
||||
|
||||
void MystScriptParser::o_drawImageChangeCard(uint16 var, const ArgumentsArray &args) {
|
||||
uint16 imageId = args[0];
|
||||
uint16 cardId = args[1];
|
||||
TransitionType transition = static_cast<TransitionType>(args[2]);
|
||||
|
||||
debugC(kDebugScript, "\timageId: %d", imageId);
|
||||
debugC(kDebugScript, "\tcardId: %d", cardId);
|
||||
|
||||
_vm->_gfx->copyImageToScreen(imageId, Common::Rect(0, 0, 544, 333));
|
||||
_vm->wait(200);
|
||||
|
||||
_vm->changeToCard(cardId, transition);
|
||||
}
|
||||
|
||||
void MystScriptParser::o_changeMainCursor(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Change main cursor", op);
|
||||
|
||||
void MystScriptParser::o_changeMainCursor(uint16 var, const ArgumentsArray &args) {
|
||||
uint16 cursorId = args[0];
|
||||
|
||||
debugC(kDebugScript, "Cursor: %d", cursorId);
|
||||
|
||||
_vm->setMainCursor(cursorId);
|
||||
_vm->_cursor->setCursor(cursorId);
|
||||
}
|
||||
|
||||
void MystScriptParser::o_hideCursor(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Hide Cursor", op);
|
||||
void MystScriptParser::o_hideCursor(uint16 var, const ArgumentsArray &args) {
|
||||
_vm->_cursor->hideCursor();
|
||||
}
|
||||
|
||||
void MystScriptParser::o_showCursor(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Show Cursor", op);
|
||||
void MystScriptParser::o_showCursor(uint16 var, const ArgumentsArray &args) {
|
||||
_vm->_cursor->showCursor();
|
||||
}
|
||||
|
||||
void MystScriptParser::o_delay(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
void MystScriptParser::o_delay(uint16 var, const ArgumentsArray &args) {
|
||||
// Used on Mechanical Card 6327 (Elevator)
|
||||
debugC(kDebugScript, "Opcode %d: Delay", op);
|
||||
|
||||
uint16 time = args[0];
|
||||
|
||||
debugC(kDebugScript, "\tTime: %d", time);
|
||||
|
||||
_vm->wait(time);
|
||||
}
|
||||
|
||||
void MystScriptParser::o_changeStack(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: changeStack", op);
|
||||
|
||||
void MystScriptParser::o_changeStack(uint16 var, const ArgumentsArray &args) {
|
||||
uint16 targetStack = args[0];
|
||||
uint16 soundIdLinkSrc = args[1];
|
||||
uint16 soundIdLinkDst = args[2];
|
||||
|
||||
debugC(kDebugScript, "\tTarget Stack: %d", targetStack);
|
||||
debugC(kDebugScript, "\tSource Stack Link Sound: %d", soundIdLinkSrc);
|
||||
debugC(kDebugScript, "\tDestination Stack Link Sound: %d", soundIdLinkDst);
|
||||
|
||||
|
@ -831,9 +728,7 @@ void MystScriptParser::o_changeStack(uint16 op, uint16 var, const ArgumentsArray
|
|||
}
|
||||
}
|
||||
|
||||
void MystScriptParser::o_changeCardPlaySoundDirectional(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Play Sound, Change Card and Directional Update Screen Region", op);
|
||||
|
||||
void MystScriptParser::o_changeCardPlaySoundDirectional(uint16 var, const ArgumentsArray &args) {
|
||||
uint16 cardId = args[0];
|
||||
uint16 soundId = args[1];
|
||||
uint16 delayBetweenSteps = args[2];
|
||||
|
@ -852,9 +747,7 @@ void MystScriptParser::o_changeCardPlaySoundDirectional(uint16 op, uint16 var, c
|
|||
animatedUpdate(ArgumentsArray(args.begin() + 4, dataSize), delayBetweenSteps);
|
||||
}
|
||||
|
||||
void MystScriptParser::o_directionalUpdatePlaySound(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Play Sound and Directional Update Screen Region", op);
|
||||
|
||||
void MystScriptParser::o_directionalUpdatePlaySound(uint16 var, const ArgumentsArray &args) {
|
||||
uint16 soundId = args[0];
|
||||
uint16 delayBetweenSteps = args[1];
|
||||
uint16 dataSize = args[2];
|
||||
|
@ -869,29 +762,23 @@ void MystScriptParser::o_directionalUpdatePlaySound(uint16 op, uint16 var, const
|
|||
animatedUpdate(ArgumentsArray(args.begin() + 3, dataSize), delayBetweenSteps);
|
||||
}
|
||||
|
||||
void MystScriptParser::o_saveMainCursor(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Save main cursor", op);
|
||||
|
||||
void MystScriptParser::o_saveMainCursor(uint16 var, const ArgumentsArray &args) {
|
||||
_savedCursorId = _vm->getMainCursor();
|
||||
}
|
||||
|
||||
void MystScriptParser::o_restoreMainCursor(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Restore main cursor", op);
|
||||
|
||||
void MystScriptParser::o_restoreMainCursor(uint16 var, const ArgumentsArray &args) {
|
||||
_vm->setMainCursor(_savedCursorId);
|
||||
}
|
||||
|
||||
void MystScriptParser::o_soundWaitStop(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
void MystScriptParser::o_soundWaitStop(uint16 var, const ArgumentsArray &args) {
|
||||
// Used on Selenitic Card 1191 (Maze Runner)
|
||||
// Used on Mechanical Card 6267 (Code Lock)
|
||||
// Used when Button is pushed...
|
||||
debugC(kDebugScript, "Opcode %d: Wait for foreground sound to finish", op);
|
||||
|
||||
while (_vm->_sound->isEffectPlaying())
|
||||
_vm->doFrame();
|
||||
}
|
||||
|
||||
void MystScriptParser::o_quit(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
void MystScriptParser::o_quit(uint16 var, const ArgumentsArray &args) {
|
||||
_vm->quitGame();
|
||||
}
|
||||
|
||||
|
@ -902,7 +789,7 @@ void MystScriptParser::showMap() {
|
|||
}
|
||||
}
|
||||
|
||||
void MystScriptParser::o_exitMap(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
void MystScriptParser::o_exitMap(uint16 var, const ArgumentsArray &args) {
|
||||
_vm->changeToCard(_savedMapCardId, kTransitionCopy);
|
||||
}
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ namespace Mohawk {
|
|||
|
||||
typedef Common::Array<uint16> ArgumentsArray;
|
||||
|
||||
#define DECLARE_OPCODE(x) void x(uint16 op, uint16 var, const ArgumentsArray &args)
|
||||
#define DECLARE_OPCODE(x) void x(uint16 var, const ArgumentsArray &args)
|
||||
|
||||
class MohawkEngine_Myst;
|
||||
class MystArea;
|
||||
|
@ -88,8 +88,6 @@ public:
|
|||
|
||||
void animatedUpdate(const ArgumentsArray &args, uint16 delay);
|
||||
|
||||
DECLARE_OPCODE(unknown);
|
||||
|
||||
// Common opcodes
|
||||
DECLARE_OPCODE(o_toggleVar);
|
||||
DECLARE_OPCODE(o_setVar);
|
||||
|
@ -100,8 +98,8 @@ public:
|
|||
DECLARE_OPCODE(o_redrawCard);
|
||||
DECLARE_OPCODE(o_goToDest);
|
||||
DECLARE_OPCODE(o_goToDestForward);
|
||||
DECLARE_OPCODE(o_goToDestLeft);
|
||||
DECLARE_OPCODE(o_goToDestRight);
|
||||
DECLARE_OPCODE(o_goToDestLeft);
|
||||
DECLARE_OPCODE(o_goToDestUp);
|
||||
DECLARE_OPCODE(o_triggerMovie);
|
||||
DECLARE_OPCODE(o_toggleVarNoRedraw);
|
||||
|
@ -146,7 +144,7 @@ protected:
|
|||
MohawkEngine_Myst *_vm;
|
||||
MystGameState::Globals &_globals;
|
||||
|
||||
typedef void (MystScriptParser::*OpcodeProcMyst)(uint16 op, uint16 var, const ArgumentsArray &args);
|
||||
typedef void (MystScriptParser::*OpcodeProcMyst)(uint16 var, const ArgumentsArray &args);
|
||||
|
||||
struct MystOpcode {
|
||||
MystOpcode(uint16 o, OpcodeProcMyst p, const char *d) : op(o), proc(p), desc(d) {}
|
||||
|
@ -175,6 +173,8 @@ protected:
|
|||
private:
|
||||
MystArea *_invokingResource;
|
||||
int32 _scriptNestingLevel;
|
||||
|
||||
Common::String describeCommand(const MystOpcode &command, uint16 var, const ArgumentsArray &args);
|
||||
};
|
||||
|
||||
template<class T>
|
||||
|
|
|
@ -299,9 +299,7 @@ bool Channelwood::pipeChangeValve(bool open, uint16 mask) {
|
|||
return false;
|
||||
}
|
||||
|
||||
void Channelwood::o_bridgeToggle(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Bridge rise / skink video", op);
|
||||
|
||||
void Channelwood::o_bridgeToggle(uint16 var, const ArgumentsArray &args) {
|
||||
VideoEntryPtr bridge = _vm->_video->playMovie(_vm->wrapMovieFilename("bridge", kChannelwoodStack));
|
||||
if (!bridge)
|
||||
error("Failed to open 'bridge' movie");
|
||||
|
@ -317,9 +315,7 @@ void Channelwood::o_bridgeToggle(uint16 op, uint16 var, const ArgumentsArray &ar
|
|||
_vm->waitUntilMovieEnds(bridge);
|
||||
}
|
||||
|
||||
void Channelwood::o_pipeExtend(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Play Pipe Movie and Sound", op);
|
||||
|
||||
void Channelwood::o_pipeExtend(uint16 var, const ArgumentsArray &args) {
|
||||
uint16 soundId = args[0];
|
||||
debugC(kDebugScript, "\tsoundId: %d", soundId);
|
||||
|
||||
|
@ -340,9 +336,7 @@ void Channelwood::o_pipeExtend(uint16 op, uint16 var, const ArgumentsArray &args
|
|||
_vm->_sound->resumeBackground();
|
||||
}
|
||||
|
||||
void Channelwood::o_drawImageChangeCardAndVolume(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Draw Full Screen Image, Change Card, and change volume", op);
|
||||
|
||||
void Channelwood::o_drawImageChangeCardAndVolume(uint16 var, const ArgumentsArray &args) {
|
||||
uint16 imageId = args[0];
|
||||
uint16 cardId = args[1];
|
||||
|
||||
|
@ -361,8 +355,7 @@ void Channelwood::o_drawImageChangeCardAndVolume(uint16 op, uint16 var, const Ar
|
|||
}
|
||||
|
||||
|
||||
void Channelwood::o_waterTankValveOpen(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Do Water Tank Valve Open Animation", op);
|
||||
void Channelwood::o_waterTankValveOpen(uint16 var, const ArgumentsArray &args) {
|
||||
Common::Rect rect = getInvokingResource<MystArea>()->getRect();
|
||||
|
||||
for (uint i = 0; i < 2; i++)
|
||||
|
@ -374,18 +367,14 @@ void Channelwood::o_waterTankValveOpen(uint16 op, uint16 var, const ArgumentsArr
|
|||
pipeChangeValve(true, 0x80);
|
||||
}
|
||||
|
||||
void Channelwood::o_leverStartMove(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Generic lever start move", op);
|
||||
|
||||
void Channelwood::o_leverStartMove(uint16 var, const ArgumentsArray &args) {
|
||||
MystVideoInfo *lever = getInvokingResource<MystVideoInfo>();
|
||||
lever->drawFrame(0);
|
||||
_vm->_cursor->setCursor(700);
|
||||
_leverPulled = false;
|
||||
}
|
||||
|
||||
void Channelwood::o_leverMove(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Generic lever move", op);
|
||||
|
||||
void Channelwood::o_leverMove(uint16 var, const ArgumentsArray &args) {
|
||||
MystVideoInfo *lever = getInvokingResource<MystVideoInfo>();
|
||||
|
||||
if (lever->pullLeverV()) {
|
||||
|
@ -398,9 +387,7 @@ void Channelwood::o_leverMove(uint16 op, uint16 var, const ArgumentsArray &args)
|
|||
}
|
||||
}
|
||||
|
||||
void Channelwood::o_leverMoveFail(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Generic lever move", op);
|
||||
|
||||
void Channelwood::o_leverMoveFail(uint16 var, const ArgumentsArray &args) {
|
||||
MystVideoInfo *lever = getInvokingResource<MystVideoInfo>();
|
||||
|
||||
if (lever->pullLeverV()) {
|
||||
|
@ -415,9 +402,7 @@ void Channelwood::o_leverMoveFail(uint16 op, uint16 var, const ArgumentsArray &a
|
|||
}
|
||||
}
|
||||
|
||||
void Channelwood::o_leverEndMove(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Generic lever end move", op);
|
||||
|
||||
void Channelwood::o_leverEndMove(uint16 var, const ArgumentsArray &args) {
|
||||
// Get current lever frame
|
||||
MystVideoInfo *lever = getInvokingResource<MystVideoInfo>();
|
||||
|
||||
|
@ -431,13 +416,13 @@ void Channelwood::o_leverEndMove(uint16 op, uint16 var, const ArgumentsArray &ar
|
|||
_vm->checkCursorHints();
|
||||
}
|
||||
|
||||
void Channelwood::o_leverEndMoveResumeBackground(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
void Channelwood::o_leverEndMoveResumeBackground(uint16 var, const ArgumentsArray &args) {
|
||||
_vm->_sound->resumeBackground();
|
||||
o_leverEndMove(op, var, args);
|
||||
o_leverEndMove(var, args);
|
||||
}
|
||||
|
||||
void Channelwood::o_leverEndMoveWithSound(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
o_leverEndMove(op, var, args);
|
||||
void Channelwood::o_leverEndMoveWithSound(uint16 var, const ArgumentsArray &args) {
|
||||
o_leverEndMove(var, args);
|
||||
|
||||
MystVideoInfo *lever = getInvokingResource<MystVideoInfo>();
|
||||
uint16 soundId = lever->getList3(0);
|
||||
|
@ -445,22 +430,20 @@ void Channelwood::o_leverEndMoveWithSound(uint16 op, uint16 var, const Arguments
|
|||
_vm->_sound->playEffect(soundId);
|
||||
}
|
||||
|
||||
void Channelwood::o_leverElev3StartMove(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
void Channelwood::o_leverElev3StartMove(uint16 var, const ArgumentsArray &args) {
|
||||
_vm->_gfx->copyImageToScreen(3970, Common::Rect(544, 333));
|
||||
_vm->doFrame();
|
||||
o_leverStartMove(op, var, args);
|
||||
o_leverStartMove(var, args);
|
||||
}
|
||||
|
||||
void Channelwood::o_leverElev3EndMove(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
o_leverEndMove(op, var, args);
|
||||
void Channelwood::o_leverElev3EndMove(uint16 var, const ArgumentsArray &args) {
|
||||
o_leverEndMove(var, args);
|
||||
_vm->_gfx->copyImageToScreen(3265, Common::Rect(544, 333));
|
||||
_vm->doFrame();
|
||||
_vm->_sound->playEffect(5265);
|
||||
}
|
||||
|
||||
void Channelwood::o_pumpLeverMove(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Pump lever move", op);
|
||||
|
||||
void Channelwood::o_pumpLeverMove(uint16 var, const ArgumentsArray &args) {
|
||||
MystVideoInfo *lever = getInvokingResource<MystVideoInfo>();
|
||||
|
||||
if (lever->pullLeverV()) {
|
||||
|
@ -472,8 +455,8 @@ void Channelwood::o_pumpLeverMove(uint16 op, uint16 var, const ArgumentsArray &a
|
|||
}
|
||||
}
|
||||
|
||||
void Channelwood::o_pumpLeverEndMove(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
o_leverEndMove(op, var, args);
|
||||
void Channelwood::o_pumpLeverEndMove(uint16 var, const ArgumentsArray &args) {
|
||||
o_leverEndMove(var, args);
|
||||
|
||||
MystVideoInfo *lever = getInvokingResource<MystVideoInfo>();
|
||||
uint16 soundId = lever->getList3(0);
|
||||
|
@ -481,9 +464,7 @@ void Channelwood::o_pumpLeverEndMove(uint16 op, uint16 var, const ArgumentsArray
|
|||
_vm->_sound->playBackground(soundId, 36864);
|
||||
}
|
||||
|
||||
void Channelwood::o_stairsDoorToggle(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Play stairs door video", op);
|
||||
|
||||
void Channelwood::o_stairsDoorToggle(uint16 var, const ArgumentsArray &args) {
|
||||
MystAreaVideo *movie = getInvokingResource<MystAreaVideo>();
|
||||
|
||||
if (_state.stairsUpperDoorState) {
|
||||
|
@ -497,9 +478,7 @@ void Channelwood::o_stairsDoorToggle(uint16 op, uint16 var, const ArgumentsArray
|
|||
}
|
||||
}
|
||||
|
||||
void Channelwood::o_valveHandleMove1(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Valve handle move", op);
|
||||
|
||||
void Channelwood::o_valveHandleMove1(uint16 var, const ArgumentsArray &args) {
|
||||
MystVideoInfo *handle = getInvokingResource<MystVideoInfo>();
|
||||
const Common::Point &mouse = _vm->_system->getEventManager()->getMousePos();
|
||||
|
||||
|
@ -513,21 +492,17 @@ void Channelwood::o_valveHandleMove1(uint16 op, uint16 var, const ArgumentsArray
|
|||
}
|
||||
}
|
||||
|
||||
void Channelwood::o_valveHandleMoveStart1(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Valve handle move start", op);
|
||||
|
||||
void Channelwood::o_valveHandleMoveStart1(uint16 var, const ArgumentsArray &args) {
|
||||
MystVideoInfo *handle = getInvokingResource<MystVideoInfo>();
|
||||
uint16 soundId = handle->getList1(0);
|
||||
if (soundId)
|
||||
_vm->_sound->playEffect(soundId);
|
||||
_vm->_cursor->setCursor(700);
|
||||
|
||||
o_valveHandleMove1(op, var, args);
|
||||
o_valveHandleMove1(var, args);
|
||||
}
|
||||
|
||||
void Channelwood::o_valveHandleMoveStop(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Valve handle move stop", op);
|
||||
|
||||
void Channelwood::o_valveHandleMoveStop(uint16 var, const ArgumentsArray &args) {
|
||||
MystVideoInfo *handle = getInvokingResource<MystVideoInfo>();
|
||||
|
||||
// Update state with valve position
|
||||
|
@ -548,9 +523,7 @@ void Channelwood::o_valveHandleMoveStop(uint16 op, uint16 var, const ArgumentsAr
|
|||
_vm->checkCursorHints();
|
||||
}
|
||||
|
||||
void Channelwood::o_valveHandleMove2(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Valve handle move", op);
|
||||
|
||||
void Channelwood::o_valveHandleMove2(uint16 var, const ArgumentsArray &args) {
|
||||
MystVideoInfo *handle = getInvokingResource<MystVideoInfo>();
|
||||
const Common::Point &mouse = _vm->_system->getEventManager()->getMousePos();
|
||||
|
||||
|
@ -564,21 +537,17 @@ void Channelwood::o_valveHandleMove2(uint16 op, uint16 var, const ArgumentsArray
|
|||
}
|
||||
}
|
||||
|
||||
void Channelwood::o_valveHandleMoveStart2(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Valve handle move start", op);
|
||||
|
||||
void Channelwood::o_valveHandleMoveStart2(uint16 var, const ArgumentsArray &args) {
|
||||
MystVideoInfo *handle = getInvokingResource<MystVideoInfo>();
|
||||
uint16 soundId = handle->getList1(0);
|
||||
if (soundId)
|
||||
_vm->_sound->playEffect(soundId);
|
||||
_vm->_cursor->setCursor(700);
|
||||
|
||||
o_valveHandleMove2(op, var, args);
|
||||
o_valveHandleMove2(var, args);
|
||||
}
|
||||
|
||||
void Channelwood::o_valveHandleMove3(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Valve handle move", op);
|
||||
|
||||
void Channelwood::o_valveHandleMove3(uint16 var, const ArgumentsArray &args) {
|
||||
MystVideoInfo *handle = getInvokingResource<MystVideoInfo>();
|
||||
const Common::Point &mouse = _vm->_system->getEventManager()->getMousePos();
|
||||
|
||||
|
@ -592,21 +561,17 @@ void Channelwood::o_valveHandleMove3(uint16 op, uint16 var, const ArgumentsArray
|
|||
}
|
||||
}
|
||||
|
||||
void Channelwood::o_valveHandleMoveStart3(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Valve handle move start", op);
|
||||
|
||||
void Channelwood::o_valveHandleMoveStart3(uint16 var, const ArgumentsArray &args) {
|
||||
MystVideoInfo *handle = getInvokingResource<MystVideoInfo>();
|
||||
uint16 soundId = handle->getList1(0);
|
||||
if (soundId)
|
||||
_vm->_sound->playEffect(soundId);
|
||||
_vm->_cursor->setCursor(700);
|
||||
|
||||
o_valveHandleMove3(op, var, args);
|
||||
o_valveHandleMove3(var, args);
|
||||
}
|
||||
|
||||
void Channelwood::o_hologramMonitor(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Hologram monitor", op);
|
||||
|
||||
void Channelwood::o_hologramMonitor(uint16 var, const ArgumentsArray &args) {
|
||||
// Used on Card 3012 (Temple Hologram Monitor)
|
||||
uint16 button = args[0]; // 0 to 3
|
||||
|
||||
|
@ -644,23 +609,19 @@ void Channelwood::o_hologramMonitor(uint16 op, uint16 var, const ArgumentsArray
|
|||
video->moveTo(226, 68);
|
||||
break;
|
||||
default:
|
||||
warning("Opcode %d Control Variable Out of Range", op);
|
||||
warning("Opcode o_hologramMonitor Control Variable Out of Range");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Channelwood::o_drawerOpen(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Open Sirius drawer", op);
|
||||
|
||||
void Channelwood::o_drawerOpen(uint16 var, const ArgumentsArray &args) {
|
||||
_siriusDrawerState = 1;
|
||||
_vm->redrawArea(18, false);
|
||||
_vm->redrawArea(102, false);
|
||||
}
|
||||
|
||||
void Channelwood::o_hologramTemple(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Temple hologram", op);
|
||||
|
||||
void Channelwood::o_hologramTemple(uint16 var, const ArgumentsArray &args) {
|
||||
_vm->_sound->pauseBackground();
|
||||
|
||||
// Used on Card 3333 (Temple Hologram)
|
||||
|
@ -678,22 +639,19 @@ void Channelwood::o_hologramTemple(uint16 op, uint16 var, const ArgumentsArray &
|
|||
_vm->playMovieBlocking(_vm->wrapMovieFilename("holosmsg", kChannelwoodStack), 127, 45);
|
||||
break;
|
||||
default:
|
||||
warning("Opcode %d Control Variable Out of Range", op);
|
||||
warning("Opcode o_hologramTemple Control Variable Out of Range");
|
||||
break;
|
||||
}
|
||||
|
||||
_vm->_sound->resumeBackground();
|
||||
}
|
||||
|
||||
void Channelwood::o_executeMouseUp(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Execute mouse up", op);
|
||||
|
||||
void Channelwood::o_executeMouseUp(uint16 var, const ArgumentsArray &args) {
|
||||
MystArea *resource = _vm->getViewResource<MystArea>(args[0]);
|
||||
resource->handleMouseUp();
|
||||
}
|
||||
|
||||
void Channelwood::o_waterTankValveClose(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Do Water Tank Valve Close Animation", op);
|
||||
void Channelwood::o_waterTankValveClose(uint16 var, const ArgumentsArray &args) {
|
||||
Common::Rect rect = getInvokingResource<MystArea>()->getRect();
|
||||
|
||||
for (uint i = 0; i < 2; i++)
|
||||
|
@ -705,10 +663,8 @@ void Channelwood::o_waterTankValveClose(uint16 op, uint16 var, const ArgumentsAr
|
|||
pipeChangeValve(false, 0x80);
|
||||
}
|
||||
|
||||
void Channelwood::o_elevatorMovies(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
void Channelwood::o_elevatorMovies(uint16 var, const ArgumentsArray &args) {
|
||||
// Used by Card 3262 (Elevator)
|
||||
debugC(kDebugScript, "Opcode %d: Elevator movie", op);
|
||||
|
||||
uint16 elevator = args[0];
|
||||
uint16 direction = args[1];
|
||||
|
||||
|
@ -750,9 +706,7 @@ void Channelwood::o_elevatorMovies(uint16 op, uint16 var, const ArgumentsArray &
|
|||
_vm->_sound->resumeBackground();
|
||||
}
|
||||
|
||||
void Channelwood::o_soundReplace(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Play sound if not already playing", op);
|
||||
|
||||
void Channelwood::o_soundReplace(uint16 var, const ArgumentsArray &args) {
|
||||
uint16 soundId = args[0];
|
||||
|
||||
if (!_vm->_sound->isEffectPlaying()) {
|
||||
|
@ -760,18 +714,15 @@ void Channelwood::o_soundReplace(uint16 op, uint16 var, const ArgumentsArray &ar
|
|||
}
|
||||
}
|
||||
|
||||
void Channelwood::o_lever_init(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Generic lever init", op);
|
||||
void Channelwood::o_lever_init(uint16 var, const ArgumentsArray &args) {
|
||||
_leverAction = getInvokingResource<MystArea>();
|
||||
}
|
||||
|
||||
void Channelwood::o_pipeValve_init(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Water valve init", op);
|
||||
void Channelwood::o_pipeValve_init(uint16 var, const ArgumentsArray &args) {
|
||||
_valveVar = var;
|
||||
}
|
||||
|
||||
void Channelwood::o_drawer_init(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Sirius's drawer init", op);
|
||||
void Channelwood::o_drawer_init(uint16 var, const ArgumentsArray &args) {
|
||||
_siriusDrawerState = 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ struct MystScriptEntry;
|
|||
|
||||
namespace MystStacks {
|
||||
|
||||
#define DECLARE_OPCODE(x) void x(uint16 op, uint16 var, const ArgumentsArray &args)
|
||||
#define DECLARE_OPCODE(x) void x(uint16 var, const ArgumentsArray &args)
|
||||
|
||||
class Channelwood : public MystScriptParser {
|
||||
public:
|
||||
|
|
|
@ -90,7 +90,7 @@ uint16 Credits::getVar(uint16 var) {
|
|||
}
|
||||
}
|
||||
|
||||
void Credits::o_runCredits(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
void Credits::o_runCredits(uint16 var, const ArgumentsArray &args) {
|
||||
// Activate the credits
|
||||
_creditsRunning = true;
|
||||
_curImage = 0;
|
||||
|
|
|
@ -33,7 +33,7 @@ struct MystScriptEntry;
|
|||
|
||||
namespace MystStacks {
|
||||
|
||||
#define DECLARE_OPCODE(x) void x(uint16 op, uint16 var, const ArgumentsArray &args)
|
||||
#define DECLARE_OPCODE(x) void x(uint16 var, const ArgumentsArray &args)
|
||||
|
||||
class Credits : public MystScriptParser {
|
||||
public:
|
||||
|
|
|
@ -76,22 +76,18 @@ void Demo::runPersistentScripts() {
|
|||
}
|
||||
}
|
||||
|
||||
void Demo::o_stopIntro(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Unk", op);
|
||||
void Demo::o_stopIntro(uint16 var, const ArgumentsArray &args) {
|
||||
// The original also seems to stop the movies. Not needed with this engine.
|
||||
_vm->_gfx->fadeToBlack();
|
||||
}
|
||||
|
||||
void Demo::o_fadeFromBlack(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Fade from black", op);
|
||||
|
||||
void Demo::o_fadeFromBlack(uint16 var, const ArgumentsArray &args) {
|
||||
// FIXME: This glitches when enabled. The backbuffer is drawn to screen,
|
||||
// and then the fading occurs, causing the background to appear for one frame.
|
||||
// _vm->_gfx->fadeFromBlack();
|
||||
}
|
||||
|
||||
void Demo::o_fadeToBlack(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Fade to black", op);
|
||||
void Demo::o_fadeToBlack(uint16 var, const ArgumentsArray &args) {
|
||||
_vm->_gfx->fadeToBlack();
|
||||
}
|
||||
|
||||
|
@ -122,9 +118,7 @@ void Demo::returnToMenu_run() {
|
|||
}
|
||||
}
|
||||
|
||||
void Demo::o_returnToMenu_init(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Return to menu init", op);
|
||||
|
||||
void Demo::o_returnToMenu_init(uint16 var, const ArgumentsArray &args) {
|
||||
// Used on Card 2001, 2002 and 2003
|
||||
_returnToMenuNextTime = _vm->_system->getMillis() + 5000;
|
||||
_returnToMenuRunning = true;
|
||||
|
|
|
@ -33,7 +33,7 @@ struct MystScriptEntry;
|
|||
|
||||
namespace MystStacks {
|
||||
|
||||
#define DECLARE_OPCODE(x) void x(uint16 op, uint16 var, const ArgumentsArray &args)
|
||||
#define DECLARE_OPCODE(x) void x(uint16 var, const ArgumentsArray &args)
|
||||
|
||||
class Demo : public Intro {
|
||||
public:
|
||||
|
|
|
@ -95,8 +95,7 @@ uint16 Dni::getVar(uint16 var) {
|
|||
}
|
||||
}
|
||||
|
||||
void Dni::o_handPage(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Hand page to Atrus", op);
|
||||
void Dni::o_handPage(uint16 var, const ArgumentsArray &args) {
|
||||
// Used in Card 5014 (Atrus)
|
||||
|
||||
// Find Atrus movie
|
||||
|
@ -214,9 +213,7 @@ void Dni::atrus_run() {
|
|||
}
|
||||
}
|
||||
|
||||
void Dni::o_atrus_init(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Atrus init", op);
|
||||
|
||||
void Dni::o_atrus_init(uint16 var, const ArgumentsArray &args) {
|
||||
_atrusRunning = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ struct MystScriptEntry;
|
|||
|
||||
namespace MystStacks {
|
||||
|
||||
#define DECLARE_OPCODE(x) void x(uint16 op, uint16 var, const ArgumentsArray &args)
|
||||
#define DECLARE_OPCODE(x) void x(uint16 var, const ArgumentsArray &args)
|
||||
|
||||
class Dni : public MystScriptParser {
|
||||
public:
|
||||
|
|
|
@ -79,15 +79,12 @@ uint16 Intro::getVar(uint16 var) {
|
|||
}
|
||||
}
|
||||
|
||||
void Intro::o_useLinkBook(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
void Intro::o_useLinkBook(uint16 var, const ArgumentsArray &args) {
|
||||
// Hard coded SoundId valid only for Intro Stack.
|
||||
// Other stacks use Opcode 40, which takes SoundId values as arguments.
|
||||
const uint16 soundIdLinkSrc = 5;
|
||||
const uint16 soundIdLinkDst[] = { 2282, 3029, 6396, 7122, 3137, 0, 9038, 5134, 0, 4739, 4741 };
|
||||
|
||||
debugC(kDebugScript, "Opcode %d: o_useLinkBook", op);
|
||||
debugC(kDebugScript, "\tvar: %d", var);
|
||||
|
||||
// Change to dest stack
|
||||
_vm->changeToStack(_stackMap[_globals.currentAge], _startCard[_globals.currentAge], soundIdLinkSrc, soundIdLinkDst[_globals.currentAge]);
|
||||
}
|
||||
|
@ -146,7 +143,7 @@ void Intro::introMovies_run() {
|
|||
}
|
||||
}
|
||||
|
||||
void Intro::o_playIntroMovies(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
void Intro::o_playIntroMovies(uint16 var, const ArgumentsArray &args) {
|
||||
_introMoviesRunning = true;
|
||||
_introStep = 0;
|
||||
}
|
||||
|
@ -165,9 +162,7 @@ void Intro::mystLinkBook_run() {
|
|||
}
|
||||
}
|
||||
|
||||
void Intro::o_mystLinkBook_init(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Myst link book init", op);
|
||||
|
||||
void Intro::o_mystLinkBook_init(uint16 var, const ArgumentsArray &args) {
|
||||
_linkBookMovie = getInvokingResource<MystAreaVideo>();
|
||||
_startTime = 1;
|
||||
_linkBookRunning = true;
|
||||
|
|
|
@ -34,7 +34,7 @@ struct MystScriptEntry;
|
|||
|
||||
namespace MystStacks {
|
||||
|
||||
#define DECLARE_OPCODE(x) void x(uint16 op, uint16 var, const ArgumentsArray &args)
|
||||
#define DECLARE_OPCODE(x) void x(uint16 var, const ArgumentsArray &args)
|
||||
|
||||
class Intro : public MystScriptParser {
|
||||
public:
|
||||
|
|
|
@ -33,7 +33,7 @@ struct MystScriptEntry;
|
|||
|
||||
namespace MystStacks {
|
||||
|
||||
#define DECLARE_OPCODE(x) void x(uint16 op, uint16 var, const ArgumentsArray &args)
|
||||
#define DECLARE_OPCODE(x) void x(uint16 var, const ArgumentsArray &args)
|
||||
|
||||
class MakingOf : public MystScriptParser {
|
||||
public:
|
||||
|
|
|
@ -271,15 +271,11 @@ bool Mechanical::setVarValue(uint16 var, uint16 value) {
|
|||
return refresh;
|
||||
}
|
||||
|
||||
void Mechanical::o_throneEnablePassage(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Enable throne passage", op);
|
||||
|
||||
void Mechanical::o_throneEnablePassage(uint16 var, const ArgumentsArray &args) {
|
||||
_vm->_resources[args[0]]->setEnabled(getVar(var));
|
||||
}
|
||||
|
||||
void Mechanical::o_birdCrankStart(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Mechanical bird crank start", op);
|
||||
|
||||
void Mechanical::o_birdCrankStart(uint16 var, const ArgumentsArray &args) {
|
||||
MystAreaDrag *crank = getInvokingResource<MystAreaDrag>();
|
||||
|
||||
uint16 crankSoundId = crank->getList2(0);
|
||||
|
@ -292,9 +288,7 @@ void Mechanical::o_birdCrankStart(uint16 op, uint16 var, const ArgumentsArray &a
|
|||
crankMovie->playMovie();
|
||||
}
|
||||
|
||||
void Mechanical::o_birdCrankStop(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Mechanical bird crank stop", op);
|
||||
|
||||
void Mechanical::o_birdCrankStop(uint16 var, const ArgumentsArray &args) {
|
||||
MystAreaDrag *crank = getInvokingResource<MystAreaDrag>();
|
||||
|
||||
MystAreaVideo *crankMovie = static_cast<MystAreaVideo *>(crank->getSubResource(0));
|
||||
|
@ -309,16 +303,12 @@ void Mechanical::o_birdCrankStop(uint16 op, uint16 var, const ArgumentsArray &ar
|
|||
_bird->playMovie();
|
||||
}
|
||||
|
||||
void Mechanical::o_snakeBoxTrigger(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Trigger Playing Of Snake Movie", op);
|
||||
|
||||
void Mechanical::o_snakeBoxTrigger(uint16 var, const ArgumentsArray &args) {
|
||||
// Used on Mechanical Card 6043 (Weapons Rack with Snake Box)
|
||||
_snakeBox->playMovie();
|
||||
}
|
||||
|
||||
void Mechanical::o_fortressStaircaseMovie(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Play Stairs Movement Movie", op);
|
||||
|
||||
void Mechanical::o_fortressStaircaseMovie(uint16 var, const ArgumentsArray &args) {
|
||||
VideoEntryPtr staircase = _vm->_video->playMovie(_vm->wrapMovieFilename("hhstairs", kMechanicalStack));
|
||||
if (!staircase)
|
||||
error("Failed to open hhstairs movie");
|
||||
|
@ -334,9 +324,7 @@ void Mechanical::o_fortressStaircaseMovie(uint16 op, uint16 var, const Arguments
|
|||
_vm->waitUntilMovieEnds(staircase);
|
||||
}
|
||||
|
||||
void Mechanical::o_elevatorRotationStart(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Elevator rotation lever start", op);
|
||||
|
||||
void Mechanical::o_elevatorRotationStart(uint16 var, const ArgumentsArray &args) {
|
||||
MystVideoInfo *lever = getInvokingResource<MystVideoInfo>();
|
||||
lever->drawFrame(0);
|
||||
|
||||
|
@ -348,9 +336,7 @@ void Mechanical::o_elevatorRotationStart(uint16 op, uint16 var, const ArgumentsA
|
|||
_vm->_cursor->setCursor(700);
|
||||
}
|
||||
|
||||
void Mechanical::o_elevatorRotationMove(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Elevator rotation lever move", op);
|
||||
|
||||
void Mechanical::o_elevatorRotationMove(uint16 var, const ArgumentsArray &args) {
|
||||
const Common::Point &mouse = _vm->_system->getEventManager()->getMousePos();
|
||||
MystVideoInfo *lever = getInvokingResource<MystVideoInfo>();
|
||||
|
||||
|
@ -366,9 +352,7 @@ void Mechanical::o_elevatorRotationMove(uint16 op, uint16 var, const ArgumentsAr
|
|||
lever->drawFrame(step);
|
||||
}
|
||||
|
||||
void Mechanical::o_elevatorRotationStop(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Elevator rotation lever stop", op);
|
||||
|
||||
void Mechanical::o_elevatorRotationStop(uint16 var, const ArgumentsArray &args) {
|
||||
const Common::Point &mouse = _vm->_system->getEventManager()->getMousePos();
|
||||
MystVideoInfo *lever = getInvokingResource<MystVideoInfo>();
|
||||
|
||||
|
@ -414,18 +398,14 @@ void Mechanical::o_elevatorRotationStop(uint16 op, uint16 var, const ArgumentsAr
|
|||
_vm->checkCursorHints();
|
||||
}
|
||||
|
||||
void Mechanical::o_fortressRotationSpeedStart(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d Fortress rotation speed lever start", op);
|
||||
|
||||
void Mechanical::o_fortressRotationSpeedStart(uint16 var, const ArgumentsArray &args) {
|
||||
_vm->_cursor->setCursor(700);
|
||||
|
||||
MystVideoInfo *lever = getInvokingResource<MystVideoInfo>();
|
||||
lever->drawFrame(0);
|
||||
}
|
||||
|
||||
void Mechanical::o_fortressRotationSpeedMove(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d Fortress rotation speed lever move", op);
|
||||
|
||||
void Mechanical::o_fortressRotationSpeedMove(uint16 var, const ArgumentsArray &args) {
|
||||
const Common::Point &mouse = _vm->_system->getEventManager()->getMousePos();
|
||||
MystVideoInfo *lever = getInvokingResource<MystVideoInfo>();
|
||||
|
||||
|
@ -441,9 +421,7 @@ void Mechanical::o_fortressRotationSpeedMove(uint16 op, uint16 var, const Argume
|
|||
lever->drawFrame(step);
|
||||
}
|
||||
|
||||
void Mechanical::o_fortressRotationSpeedStop(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d Fortress rotation speed lever stop", op);
|
||||
|
||||
void Mechanical::o_fortressRotationSpeedStop(uint16 var, const ArgumentsArray &args) {
|
||||
MystVideoInfo *lever = getInvokingResource<MystVideoInfo>();
|
||||
|
||||
// Release lever
|
||||
|
@ -457,18 +435,14 @@ void Mechanical::o_fortressRotationSpeedStop(uint16 op, uint16 var, const Argume
|
|||
_vm->checkCursorHints();
|
||||
}
|
||||
|
||||
void Mechanical::o_fortressRotationBrakeStart(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d Fortress rotation brake lever start", op);
|
||||
|
||||
void Mechanical::o_fortressRotationBrakeStart(uint16 var, const ArgumentsArray &args) {
|
||||
_vm->_cursor->setCursor(700);
|
||||
|
||||
MystVideoInfo *lever = getInvokingResource<MystVideoInfo>();
|
||||
lever->drawFrame(_fortressRotationBrake);
|
||||
}
|
||||
|
||||
void Mechanical::o_fortressRotationBrakeMove(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d Fortress rotation brake lever move", op);
|
||||
|
||||
void Mechanical::o_fortressRotationBrakeMove(uint16 var, const ArgumentsArray &args) {
|
||||
const Common::Point &mouse = _vm->_system->getEventManager()->getMousePos();
|
||||
MystVideoInfo *lever = getInvokingResource<MystVideoInfo>();
|
||||
|
||||
|
@ -484,27 +458,21 @@ void Mechanical::o_fortressRotationBrakeMove(uint16 op, uint16 var, const Argume
|
|||
lever->drawFrame(step);
|
||||
}
|
||||
|
||||
void Mechanical::o_fortressRotationBrakeStop(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d Fortress rotation brake lever stop", op);
|
||||
|
||||
void Mechanical::o_fortressRotationBrakeStop(uint16 var, const ArgumentsArray &args) {
|
||||
MystVideoInfo *lever = getInvokingResource<MystVideoInfo>();
|
||||
lever->drawFrame(_fortressRotationBrake);
|
||||
|
||||
_vm->checkCursorHints();
|
||||
}
|
||||
|
||||
void Mechanical::o_fortressSimulationSpeedStart(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d Fortress rotation simulator speed lever start", op);
|
||||
|
||||
void Mechanical::o_fortressSimulationSpeedStart(uint16 var, const ArgumentsArray &args) {
|
||||
_vm->_cursor->setCursor(700);
|
||||
|
||||
MystVideoInfo *lever = getInvokingResource<MystVideoInfo>();
|
||||
lever->drawFrame(0);
|
||||
}
|
||||
|
||||
void Mechanical::o_fortressSimulationSpeedMove(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d Fortress rotation simulator speed lever move", op);
|
||||
|
||||
void Mechanical::o_fortressSimulationSpeedMove(uint16 var, const ArgumentsArray &args) {
|
||||
const Common::Point &mouse = _vm->_system->getEventManager()->getMousePos();
|
||||
MystVideoInfo *lever = getInvokingResource<MystVideoInfo>();
|
||||
|
||||
|
@ -520,9 +488,7 @@ void Mechanical::o_fortressSimulationSpeedMove(uint16 op, uint16 var, const Argu
|
|||
lever->drawFrame(step);
|
||||
}
|
||||
|
||||
void Mechanical::o_fortressSimulationSpeedStop(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d Fortress rotation simulator speed lever stop", op);
|
||||
|
||||
void Mechanical::o_fortressSimulationSpeedStop(uint16 var, const ArgumentsArray &args) {
|
||||
MystVideoInfo *lever = getInvokingResource<MystVideoInfo>();
|
||||
|
||||
// Release lever
|
||||
|
@ -536,18 +502,14 @@ void Mechanical::o_fortressSimulationSpeedStop(uint16 op, uint16 var, const Argu
|
|||
_vm->checkCursorHints();
|
||||
}
|
||||
|
||||
void Mechanical::o_fortressSimulationBrakeStart(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d Fortress rotation simulator brake lever start", op);
|
||||
|
||||
void Mechanical::o_fortressSimulationBrakeStart(uint16 var, const ArgumentsArray &args) {
|
||||
_vm->_cursor->setCursor(700);
|
||||
|
||||
MystVideoInfo *lever = getInvokingResource<MystVideoInfo>();
|
||||
lever->drawFrame(_fortressSimulationBrake);
|
||||
}
|
||||
|
||||
void Mechanical::o_fortressSimulationBrakeMove(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d Fortress rotation simulator brake lever move", op);
|
||||
|
||||
void Mechanical::o_fortressSimulationBrakeMove(uint16 var, const ArgumentsArray &args) {
|
||||
const Common::Point &mouse = _vm->_system->getEventManager()->getMousePos();
|
||||
MystVideoInfo *lever = getInvokingResource<MystVideoInfo>();
|
||||
|
||||
|
@ -563,21 +525,17 @@ void Mechanical::o_fortressSimulationBrakeMove(uint16 op, uint16 var, const Argu
|
|||
lever->drawFrame(step);
|
||||
}
|
||||
|
||||
void Mechanical::o_fortressSimulationBrakeStop(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d Fortress rotation simulator brake lever stop", op);
|
||||
|
||||
void Mechanical::o_fortressSimulationBrakeStop(uint16 var, const ArgumentsArray &args) {
|
||||
MystVideoInfo *lever = getInvokingResource<MystVideoInfo>();
|
||||
lever->drawFrame(_fortressSimulationBrake);
|
||||
|
||||
_vm->checkCursorHints();
|
||||
}
|
||||
|
||||
void Mechanical::o_elevatorWindowMovie(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
void Mechanical::o_elevatorWindowMovie(uint16 var, const ArgumentsArray &args) {
|
||||
uint16 startTime = args[0];
|
||||
uint16 endTime = args[1];
|
||||
|
||||
debugC(kDebugScript, "Opcode %d Movie Time Index %d to %d", op, startTime, endTime);
|
||||
|
||||
VideoEntryPtr window = _vm->_video->playMovie(_vm->wrapMovieFilename("ewindow", kMechanicalStack));
|
||||
if (!window)
|
||||
error("Failed to open ewindow movie");
|
||||
|
@ -587,9 +545,7 @@ void Mechanical::o_elevatorWindowMovie(uint16 op, uint16 var, const ArgumentsArr
|
|||
_vm->waitUntilMovieEnds(window);
|
||||
}
|
||||
|
||||
void Mechanical::o_elevatorGoMiddle(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Elevator go middle from top", op);
|
||||
|
||||
void Mechanical::o_elevatorGoMiddle(uint16 var, const ArgumentsArray &args) {
|
||||
_elevatorTooLate = false;
|
||||
_elevatorTopCounter = 5;
|
||||
_elevatorGoingMiddle = true;
|
||||
|
@ -634,7 +590,7 @@ void Mechanical::elevatorGoMiddle_run() {
|
|||
_vm->wait(500);
|
||||
_vm->_sound->playEffect(9120);
|
||||
static uint16 moviePos[2] = { 3540, 5380 };
|
||||
o_elevatorWindowMovie(121, 0, ArgumentsArray(moviePos, ARRAYSIZE(moviePos)));
|
||||
o_elevatorWindowMovie(0, ArgumentsArray(moviePos, ARRAYSIZE(moviePos)));
|
||||
_vm->_gfx->copyBackBufferToScreen(Common::Rect(544, 333));
|
||||
_vm->_sound->playEffect(10120);
|
||||
_vm->_cursor->showCursor();
|
||||
|
@ -647,12 +603,10 @@ void Mechanical::elevatorGoMiddle_run() {
|
|||
}
|
||||
}
|
||||
|
||||
void Mechanical::o_elevatorTopMovie(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
void Mechanical::o_elevatorTopMovie(uint16 var, const ArgumentsArray &args) {
|
||||
uint16 startTime = args[0];
|
||||
uint16 endTime = args[1];
|
||||
|
||||
debugC(kDebugScript, "Opcode %d Movie Time Index %d to %d", op, startTime, endTime);
|
||||
|
||||
VideoEntryPtr window = _vm->_video->playMovie(_vm->wrapMovieFilename("hcelev", kMechanicalStack));
|
||||
if (!window)
|
||||
error("Failed to open hcelev movie");
|
||||
|
@ -662,9 +616,7 @@ void Mechanical::o_elevatorTopMovie(uint16 op, uint16 var, const ArgumentsArray
|
|||
_vm->waitUntilMovieEnds(window);
|
||||
}
|
||||
|
||||
void Mechanical::o_fortressRotationSetPosition(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Set fortress position", op);
|
||||
|
||||
void Mechanical::o_fortressRotationSetPosition(uint16 var, const ArgumentsArray &args) {
|
||||
VideoEntryPtr gears = _fortressRotationGears->getVideo();
|
||||
uint32 moviePosition = Audio::Timestamp(gears->getTime(), 600).totalNumberOfFrames();
|
||||
|
||||
|
@ -676,15 +628,11 @@ void Mechanical::o_fortressRotationSetPosition(uint16 op, uint16 var, const Argu
|
|||
_fortressPosition = (moviePosition + 900) / 1800 % 4;
|
||||
}
|
||||
|
||||
void Mechanical::o_mystStaircaseMovie(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Myst book staircase video", op);
|
||||
|
||||
void Mechanical::o_mystStaircaseMovie(uint16 var, const ArgumentsArray &args) {
|
||||
_vm->playMovieBlocking(_vm->wrapMovieFilename("sstairs", kMechanicalStack), 199, 108);
|
||||
}
|
||||
|
||||
void Mechanical::o_elevatorWaitTimeout(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Wait for the elevator to go middle", op);
|
||||
|
||||
void Mechanical::o_elevatorWaitTimeout(uint16 var, const ArgumentsArray &args) {
|
||||
// Wait while the elevator times out
|
||||
while (_elevatorGoingMiddle) {
|
||||
runPersistentScripts();
|
||||
|
@ -692,58 +640,42 @@ void Mechanical::o_elevatorWaitTimeout(uint16 op, uint16 var, const ArgumentsArr
|
|||
}
|
||||
}
|
||||
|
||||
void Mechanical::o_crystalEnterYellow(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Crystal enter", op);
|
||||
|
||||
void Mechanical::o_crystalEnterYellow(uint16 var, const ArgumentsArray &args) {
|
||||
_crystalLit = 3;
|
||||
_vm->redrawArea(20);
|
||||
}
|
||||
|
||||
void Mechanical::o_crystalEnterGreen(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Crystal enter", op);
|
||||
|
||||
void Mechanical::o_crystalEnterGreen(uint16 var, const ArgumentsArray &args) {
|
||||
_crystalLit = 1;
|
||||
_vm->redrawArea(21);
|
||||
}
|
||||
|
||||
void Mechanical::o_crystalEnterRed(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Crystal enter", op);
|
||||
|
||||
void Mechanical::o_crystalEnterRed(uint16 var, const ArgumentsArray &args) {
|
||||
_crystalLit = 2;
|
||||
_vm->redrawArea(22);
|
||||
}
|
||||
|
||||
void Mechanical::o_crystalLeaveYellow(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Crystal leave", op);
|
||||
|
||||
void Mechanical::o_crystalLeaveYellow(uint16 var, const ArgumentsArray &args) {
|
||||
_crystalLit = 0;
|
||||
_vm->redrawArea(20);
|
||||
}
|
||||
|
||||
void Mechanical::o_crystalLeaveGreen(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Crystal leave", op);
|
||||
|
||||
void Mechanical::o_crystalLeaveGreen(uint16 var, const ArgumentsArray &args) {
|
||||
_crystalLit = 0;
|
||||
_vm->redrawArea(21);
|
||||
}
|
||||
|
||||
void Mechanical::o_crystalLeaveRed(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Crystal leave", op);
|
||||
|
||||
void Mechanical::o_crystalLeaveRed(uint16 var, const ArgumentsArray &args) {
|
||||
_crystalLit = 0;
|
||||
_vm->redrawArea(22);
|
||||
}
|
||||
|
||||
void Mechanical::o_throne_init(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
void Mechanical::o_throne_init(uint16 var, const ArgumentsArray &args) {
|
||||
// Used on Card 6238 (Sirrus' Throne) and Card 6027 (Achenar's Throne)
|
||||
debugC(kDebugScript, "Opcode %d: Brother throne init", op);
|
||||
|
||||
getInvokingResource<MystArea>()->setEnabled(getVar(var));
|
||||
}
|
||||
|
||||
void Mechanical::o_fortressStaircase_init(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Staircase init", op);
|
||||
|
||||
void Mechanical::o_fortressStaircase_init(uint16 var, const ArgumentsArray &args) {
|
||||
_vm->_resources[args[0]]->setEnabled(!_state.staircaseState);
|
||||
_vm->_resources[args[1]]->setEnabled(!_state.staircaseState);
|
||||
_vm->_resources[args[2]]->setEnabled(_state.staircaseState);
|
||||
|
@ -759,17 +691,13 @@ void Mechanical::birdSing_run() {
|
|||
}
|
||||
}
|
||||
|
||||
void Mechanical::o_bird_init(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Mechanical bird init", op);
|
||||
|
||||
void Mechanical::o_bird_init(uint16 var, const ArgumentsArray &args) {
|
||||
_birdSinging = false;
|
||||
_birdSingEndTime = 0;
|
||||
_bird = getInvokingResource<MystAreaVideo>();
|
||||
}
|
||||
|
||||
void Mechanical::o_snakeBox_init(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Snake box init", op);
|
||||
|
||||
void Mechanical::o_snakeBox_init(uint16 var, const ArgumentsArray &args) {
|
||||
_snakeBox = getInvokingResource<MystAreaVideo>();
|
||||
}
|
||||
|
||||
|
@ -790,9 +718,7 @@ void Mechanical::elevatorRotation_run() {
|
|||
}
|
||||
}
|
||||
|
||||
void Mechanical::o_elevatorRotation_init(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Elevator rotation init", op);
|
||||
|
||||
void Mechanical::o_elevatorRotation_init(uint16 var, const ArgumentsArray &args) {
|
||||
_elevatorRotationSoundId = args[0];
|
||||
_elevatorRotationGearPosition = 0;
|
||||
_elevatorRotationLeverMoving = false;
|
||||
|
@ -870,9 +796,7 @@ void Mechanical::fortressRotation_run() {
|
|||
}
|
||||
}
|
||||
|
||||
void Mechanical::o_fortressRotation_init(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Fortress rotation init", op);
|
||||
|
||||
void Mechanical::o_fortressRotation_init(uint16 var, const ArgumentsArray &args) {
|
||||
_fortressRotationGears = getInvokingResource<MystAreaVideo>();
|
||||
|
||||
VideoEntryPtr gears = _fortressRotationGears->playMovie();
|
||||
|
@ -1020,9 +944,7 @@ void Mechanical::fortressSimulation_run() {
|
|||
}
|
||||
}
|
||||
|
||||
void Mechanical::o_fortressSimulation_init(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Fortress rotation simulator init", op);
|
||||
|
||||
void Mechanical::o_fortressSimulation_init(uint16 var, const ArgumentsArray &args) {
|
||||
_fortressSimulationHolo = getInvokingResource<MystAreaVideo>();
|
||||
|
||||
_fortressSimulationStartSound1 = args[0];
|
||||
|
@ -1042,9 +964,7 @@ void Mechanical::o_fortressSimulation_init(uint16 op, uint16 var, const Argument
|
|||
_vm->_cursor->hideCursor();
|
||||
}
|
||||
|
||||
void Mechanical::o_fortressSimulationStartup_init(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Fortress rotation simulator startup init", op);
|
||||
|
||||
void Mechanical::o_fortressSimulationStartup_init(uint16 var, const ArgumentsArray &args) {
|
||||
_fortressSimulationStartup = getInvokingResource<MystAreaVideo>();
|
||||
}
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ struct MystScriptEntry;
|
|||
|
||||
namespace MystStacks {
|
||||
|
||||
#define DECLARE_OPCODE(x) void x(uint16 op, uint16 var, const ArgumentsArray &args)
|
||||
#define DECLARE_OPCODE(x) void x(uint16 var, const ArgumentsArray &args)
|
||||
|
||||
class Mechanical : public MystScriptParser {
|
||||
public:
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -33,7 +33,7 @@ struct MystScriptEntry;
|
|||
|
||||
namespace MystStacks {
|
||||
|
||||
#define DECLARE_OPCODE(x) void x(uint16 op, uint16 var, const ArgumentsArray &args)
|
||||
#define DECLARE_OPCODE(x) void x(uint16 var, const ArgumentsArray &args)
|
||||
|
||||
class Myst : public MystScriptParser {
|
||||
public:
|
||||
|
@ -96,8 +96,10 @@ protected:
|
|||
DECLARE_OPCODE(o_cabinSafeHandleMove);
|
||||
DECLARE_OPCODE(o_cabinSafeHandleEndMove);
|
||||
DECLARE_OPCODE(o_treePressureReleaseStart);
|
||||
DECLARE_OPCODE(o_observatoryMonthChangeStart);
|
||||
DECLARE_OPCODE(o_observatoryDayChangeStart);
|
||||
DECLARE_OPCODE(o_observatoryMonthChangeStartIncrease);
|
||||
DECLARE_OPCODE(o_observatoryMonthChangeStartDecrease);
|
||||
DECLARE_OPCODE(o_observatoryDayChangeStartIncrease);
|
||||
DECLARE_OPCODE(o_observatoryDayChangeStartDecrease);
|
||||
DECLARE_OPCODE(o_observatoryGoButton);
|
||||
DECLARE_OPCODE(o_observatoryMonthSliderMove);
|
||||
DECLARE_OPCODE(o_observatoryDaySliderMove);
|
||||
|
@ -143,7 +145,8 @@ protected:
|
|||
DECLARE_OPCODE(o_clockWheelEndTurn);
|
||||
DECLARE_OPCODE(o_clockHourWheelStartTurn);
|
||||
DECLARE_OPCODE(o_clockLeverStartMove);
|
||||
DECLARE_OPCODE(o_clockLeverMove);
|
||||
DECLARE_OPCODE(o_clockLeverMoveLeft);
|
||||
DECLARE_OPCODE(o_clockLeverMoveRight);
|
||||
DECLARE_OPCODE(o_clockLeverEndMove);
|
||||
DECLARE_OPCODE(o_clockResetLeverStartMove);
|
||||
DECLARE_OPCODE(o_clockResetLeverMove);
|
||||
|
@ -151,9 +154,11 @@ protected:
|
|||
|
||||
DECLARE_OPCODE(o_libraryCombinationBookStartRight);
|
||||
DECLARE_OPCODE(o_libraryCombinationBookStartLeft);
|
||||
DECLARE_OPCODE(o_observatoryTimeChangeStart);
|
||||
DECLARE_OPCODE(o_observatoryTimeChangeStartIncrease);
|
||||
DECLARE_OPCODE(o_observatoryTimeChangeStartDecrease);
|
||||
DECLARE_OPCODE(o_observatoryChangeSettingStop);
|
||||
DECLARE_OPCODE(o_observatoryYearChangeStart);
|
||||
DECLARE_OPCODE(o_observatoryYearChangeStartIncrease);
|
||||
DECLARE_OPCODE(o_observatoryYearChangeStartDecrease);
|
||||
DECLARE_OPCODE(o_dockVaultForceClose);
|
||||
DECLARE_OPCODE(o_imagerEraseStop);
|
||||
|
||||
|
@ -311,6 +316,7 @@ protected:
|
|||
void clockWheelStartTurn(uint16 wheel);
|
||||
void clockWheelTurn(uint16 var);
|
||||
|
||||
void clockLeverMove(bool leftLever);
|
||||
void clockGearForwardOneStep(uint16 gear);
|
||||
void clockWeightDownOneStep();
|
||||
void clockGearsCheckSolution();
|
||||
|
@ -336,6 +342,10 @@ protected:
|
|||
bool observatoryIsDDMMYYYY2400();
|
||||
void observatorySetTargetToSetting();
|
||||
void observatoryUpdateVisualizer(uint16 x, uint16 y);
|
||||
void observatoryMonthChangeStart(bool increase);
|
||||
void observatoryDayChangeStart(bool increase);
|
||||
void observatoryYearChangeStart(bool increase);
|
||||
void observatoryTimeChangeStart(bool increase);
|
||||
void observatoryIncrementMonth(int16 increment);
|
||||
void observatoryIncrementDay(int16 increment);
|
||||
void observatoryIncrementYear(int16 increment);
|
||||
|
|
|
@ -79,28 +79,22 @@ void Preview::runPersistentScripts() {
|
|||
speech_run();
|
||||
}
|
||||
|
||||
void Preview::o_fadeToBlack(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Fade to black", op);
|
||||
void Preview::o_fadeToBlack(uint16 var, const ArgumentsArray &args) {
|
||||
_vm->_gfx->fadeToBlack();
|
||||
}
|
||||
|
||||
void Preview::o_fadeFromBlack(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Fade from black", op);
|
||||
void Preview::o_fadeFromBlack(uint16 var, const ArgumentsArray &args) {
|
||||
|
||||
_vm->_gfx->fadeFromBlack();
|
||||
}
|
||||
|
||||
void Preview::o_stayHere(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Stay here dialog", op);
|
||||
|
||||
void Preview::o_stayHere(uint16 var, const ArgumentsArray &args) {
|
||||
// Nuh-uh! No leaving the library in the demo!
|
||||
GUI::MessageDialog dialog("You can't leave the library in the demo.");
|
||||
dialog.runModal();
|
||||
}
|
||||
|
||||
void Preview::o_speechStop(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Speech stop", op);
|
||||
|
||||
void Preview::o_speechStop(uint16 var, const ArgumentsArray &args) {
|
||||
_vm->_sound->stopSpeech();
|
||||
_speechRunning = false;
|
||||
_globals.currentAge = 2;
|
||||
|
@ -225,22 +219,18 @@ void Preview::speech_run() {
|
|||
}
|
||||
}
|
||||
|
||||
void Preview::o_speech_init(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Speech init", op);
|
||||
|
||||
void Preview::o_speech_init(uint16 var, const ArgumentsArray &args) {
|
||||
// Used for Card 3000 (Closed Myst Book)
|
||||
_speechStep = 0;
|
||||
_speechRunning = true;
|
||||
}
|
||||
|
||||
void Preview::o_library_init(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Library init", op);
|
||||
|
||||
void Preview::o_library_init(uint16 var, const ArgumentsArray &args) {
|
||||
// Used for Card 3002 (Myst Island Overview)
|
||||
_library = getInvokingResource<MystAreaImageSwitch>();
|
||||
}
|
||||
|
||||
void Preview::o_libraryBookcaseTransformDemo_init(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
void Preview::o_libraryBookcaseTransformDemo_init(uint16 var, const ArgumentsArray &args) {
|
||||
if (_libraryBookcaseChanged) {
|
||||
MystAreaActionSwitch *resource = getInvokingResource<MystAreaActionSwitch>();
|
||||
_libraryBookcaseMovie = static_cast<MystAreaVideo *>(resource->getSubResource(getVar(303)));
|
||||
|
|
|
@ -35,7 +35,7 @@ struct MystScriptEntry;
|
|||
|
||||
namespace MystStacks {
|
||||
|
||||
#define DECLARE_OPCODE(x) void x(uint16 op, uint16 var, const ArgumentsArray &args)
|
||||
#define DECLARE_OPCODE(x) void x(uint16 var, const ArgumentsArray &args)
|
||||
|
||||
class Preview : public Myst {
|
||||
public:
|
||||
|
|
|
@ -285,7 +285,7 @@ bool Selenitic::setVarValue(uint16 var, uint16 value) {
|
|||
return refresh;
|
||||
}
|
||||
|
||||
void Selenitic::o_mazeRunnerMove(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
void Selenitic::o_mazeRunnerMove(uint16 var, const ArgumentsArray &args) {
|
||||
uint16 oldPosition = _mazeRunnerPosition;
|
||||
uint16 move = var;
|
||||
|
||||
|
@ -566,16 +566,11 @@ void Selenitic::mazeRunnerPlaySoundHelp() {
|
|||
_mazeRunnerLight->drawConditionalDataToScreen(0);
|
||||
}
|
||||
|
||||
void Selenitic::o_mazeRunnerSoundRepeat(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
void Selenitic::o_mazeRunnerSoundRepeat(uint16 var, const ArgumentsArray &args) {
|
||||
mazeRunnerPlaySoundHelp();
|
||||
}
|
||||
|
||||
/**
|
||||
* Sound receiver sigma button
|
||||
*/
|
||||
void Selenitic::o_soundReceiverSigma(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Sound receiver sigma button", op);
|
||||
|
||||
void Selenitic::o_soundReceiverSigma(uint16 var, const ArgumentsArray &args) {
|
||||
_vm->_cursor->hideCursor();
|
||||
|
||||
_soundReceiverCurrentSource->drawConditionalDataToScreen(0);
|
||||
|
@ -622,26 +617,15 @@ void Selenitic::o_soundReceiverSigma(uint16 op, uint16 var, const ArgumentsArray
|
|||
_vm->_cursor->showCursor();
|
||||
}
|
||||
|
||||
/**
|
||||
* Sound receiver right button
|
||||
*/
|
||||
void Selenitic::o_soundReceiverRight(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Sound receiver right", op);
|
||||
|
||||
void Selenitic::o_soundReceiverRight(uint16 var, const ArgumentsArray &args) {
|
||||
soundReceiverLeftRight(1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sound receiver left button
|
||||
*/
|
||||
void Selenitic::o_soundReceiverLeft(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Sound receiver left", op);
|
||||
|
||||
void Selenitic::o_soundReceiverLeft(uint16 var, const ArgumentsArray &args) {
|
||||
soundReceiverLeftRight(2);
|
||||
}
|
||||
|
||||
void Selenitic::soundReceiverLeftRight(uint direction) {
|
||||
|
||||
if (_soundReceiverSigmaPressed) {
|
||||
_soundReceiverSigmaButton->drawConditionalDataToScreen(0);
|
||||
_soundReceiverSigmaPressed = false;
|
||||
|
@ -694,12 +678,7 @@ void Selenitic::soundReceiverDrawAngle() {
|
|||
_vm->redrawResource(_soundReceiverAngle4);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sound receiver source selection buttons
|
||||
*/
|
||||
void Selenitic::o_soundReceiverSource(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Sound receiver source", op);
|
||||
|
||||
void Selenitic::o_soundReceiverSource(uint16 var, const ArgumentsArray &args) {
|
||||
if (_soundReceiverSigmaPressed) {
|
||||
_soundReceiverSigmaButton->drawConditionalDataToScreen(0);
|
||||
_soundReceiverSigmaPressed = false;
|
||||
|
@ -731,7 +710,7 @@ void Selenitic::o_soundReceiverSource(uint16 op, uint16 var, const ArgumentsArra
|
|||
_vm->_cursor->showCursor();
|
||||
}
|
||||
|
||||
void Selenitic::o_mazeRunnerDoorButton(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
void Selenitic::o_mazeRunnerDoorButton(uint16 var, const ArgumentsArray &args) {
|
||||
// Used for Selenitic Maze Runner Exit Logic
|
||||
uint16 cardIdExit = args[0];
|
||||
uint16 cardIdEntry = args[1];
|
||||
|
@ -748,9 +727,7 @@ void Selenitic::o_mazeRunnerDoorButton(uint16 op, uint16 var, const ArgumentsArr
|
|||
}
|
||||
}
|
||||
|
||||
void Selenitic::o_soundReceiverUpdateSound(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Sound receiver update sound", op);
|
||||
|
||||
void Selenitic::o_soundReceiverUpdateSound(uint16 var, const ArgumentsArray &args) {
|
||||
soundReceiverUpdateSound();
|
||||
}
|
||||
|
||||
|
@ -796,9 +773,7 @@ MystAreaSlider *Selenitic::soundLockSliderFromVar(uint16 var) {
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
void Selenitic::o_soundLockMove(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Sound lock move", op);
|
||||
|
||||
void Selenitic::o_soundLockMove(uint16 var, const ArgumentsArray &args) {
|
||||
MystAreaSlider *slider = soundLockSliderFromVar(var);
|
||||
|
||||
uint16 soundId = soundLockCurrentSound(slider->_pos.y, true);
|
||||
|
@ -808,9 +783,7 @@ void Selenitic::o_soundLockMove(uint16 op, uint16 var, const ArgumentsArray &arg
|
|||
}
|
||||
}
|
||||
|
||||
void Selenitic::o_soundLockStartMove(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Sound lock start move", op);
|
||||
|
||||
void Selenitic::o_soundLockStartMove(uint16 var, const ArgumentsArray &args) {
|
||||
MystAreaSlider *slider = soundLockSliderFromVar(var);
|
||||
|
||||
_vm->_cursor->setCursor(700);
|
||||
|
@ -820,9 +793,7 @@ void Selenitic::o_soundLockStartMove(uint16 op, uint16 var, const ArgumentsArray
|
|||
_vm->_sound->playEffect(_soundLockSoundId, true);
|
||||
}
|
||||
|
||||
void Selenitic::o_soundLockEndMove(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Sound lock end move", op);
|
||||
|
||||
void Selenitic::o_soundLockEndMove(uint16 var, const ArgumentsArray &args) {
|
||||
MystAreaSlider *slider = soundLockSliderFromVar(var);
|
||||
uint16 *value = &_state.soundLockSliderPositions[0];
|
||||
|
||||
|
@ -879,9 +850,7 @@ void Selenitic::soundLockCheckSolution(MystAreaSlider *slider, uint16 value, uin
|
|||
_vm->_sound->stopEffect();
|
||||
}
|
||||
|
||||
void Selenitic::o_soundLockButton(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Sound lock button", op);
|
||||
|
||||
void Selenitic::o_soundLockButton(uint16 var, const ArgumentsArray &args) {
|
||||
bool solved = true;
|
||||
|
||||
_vm->_sound->pauseBackground();
|
||||
|
@ -920,9 +889,7 @@ void Selenitic::o_soundLockButton(uint16 op, uint16 var, const ArgumentsArray &a
|
|||
_vm->_cursor->showCursor();
|
||||
}
|
||||
|
||||
void Selenitic::o_soundReceiverEndMove(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Sound receiver end move", op);
|
||||
|
||||
void Selenitic::o_soundReceiverEndMove(uint16 var, const ArgumentsArray &args) {
|
||||
uint16 oldDirection = _soundReceiverDirection;
|
||||
|
||||
if (_soundReceiverDirection) {
|
||||
|
@ -937,15 +904,15 @@ void Selenitic::o_soundReceiverEndMove(uint16 op, uint16 var, const ArgumentsArr
|
|||
}
|
||||
}
|
||||
|
||||
void Selenitic::o_mazeRunnerCompass_init(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
void Selenitic::o_mazeRunnerCompass_init(uint16 var, const ArgumentsArray &args) {
|
||||
_mazeRunnerCompass = getInvokingResource<MystAreaImageSwitch>();
|
||||
}
|
||||
|
||||
void Selenitic::o_mazeRunnerWindow_init(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
void Selenitic::o_mazeRunnerWindow_init(uint16 var, const ArgumentsArray &args) {
|
||||
_mazeRunnerWindow = getInvokingResource<MystAreaImageSwitch>();
|
||||
}
|
||||
|
||||
void Selenitic::o_mazeRunnerLight_init(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
void Selenitic::o_mazeRunnerLight_init(uint16 var, const ArgumentsArray &args) {
|
||||
_mazeRunnerLight = getInvokingResource<MystAreaImageSwitch>();
|
||||
}
|
||||
|
||||
|
@ -1065,9 +1032,7 @@ void Selenitic::soundReceiverSolution(uint16 source, uint16 &solution, bool &ena
|
|||
}
|
||||
}
|
||||
|
||||
void Selenitic::o_soundReceiver_init(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Sound receiver init", op);
|
||||
|
||||
void Selenitic::o_soundReceiver_init(uint16 var, const ArgumentsArray &args) {
|
||||
// Used for Card 1245 (Sound Receiver)
|
||||
_soundReceiverRunning = true;
|
||||
|
||||
|
@ -1094,9 +1059,7 @@ void Selenitic::o_soundReceiver_init(uint16 op, uint16 var, const ArgumentsArray
|
|||
_soundReceiverSigmaPressed = false;
|
||||
}
|
||||
|
||||
void Selenitic::o_soundLock_init(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Sound lock init", op);
|
||||
|
||||
void Selenitic::o_soundLock_init(uint16 var, const ArgumentsArray &args) {
|
||||
for (uint i = 0; i < _vm->_resources.size(); i++) {
|
||||
if (_vm->_resources[i]->type == kMystAreaSlider) {
|
||||
switch (_vm->_resources[i]->getImageSwitchVar()) {
|
||||
|
@ -1129,11 +1092,11 @@ void Selenitic::o_soundLock_init(uint16 op, uint16 var, const ArgumentsArray &ar
|
|||
_soundLockSoundId = 0;
|
||||
}
|
||||
|
||||
void Selenitic::o_mazeRunnerRight_init(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
void Selenitic::o_mazeRunnerRight_init(uint16 var, const ArgumentsArray &args) {
|
||||
_mazeRunnerRightButton = getInvokingResource<MystAreaImageSwitch>();
|
||||
}
|
||||
|
||||
void Selenitic::o_mazeRunnerLeft_init(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
void Selenitic::o_mazeRunnerLeft_init(uint16 var, const ArgumentsArray &args) {
|
||||
_mazeRunnerLeftButton = getInvokingResource<MystAreaImageSwitch>();
|
||||
}
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ struct MystScriptEntry;
|
|||
|
||||
namespace MystStacks {
|
||||
|
||||
#define DECLARE_OPCODE(x) void x(uint16 op, uint16 var, const ArgumentsArray &args)
|
||||
#define DECLARE_OPCODE(x) void x(uint16 var, const ArgumentsArray &args)
|
||||
|
||||
class Selenitic : public MystScriptParser {
|
||||
public:
|
||||
|
|
|
@ -68,18 +68,14 @@ void Slides::runPersistentScripts() {
|
|||
}
|
||||
}
|
||||
|
||||
void Slides::o_returnToMenu(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Return to menu", op);
|
||||
|
||||
void Slides::o_returnToMenu(uint16 var, const ArgumentsArray &args) {
|
||||
// Go to the information screens of the menu
|
||||
_vm->changeToStack(kDemoStack, 2002, 0, 0);
|
||||
}
|
||||
|
||||
void Slides::o_setCardSwap(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
void Slides::o_setCardSwap(uint16 var, const ArgumentsArray &args) {
|
||||
_nextCardID = args[0];
|
||||
|
||||
debugC(kDebugScript, "Opcode %d: Set next card %d", op, _nextCardID);
|
||||
|
||||
_nextCardTime = _vm->_system->getMillis() + 5000;
|
||||
_cardSwapEnabled = true;
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@ struct MystScriptEntry;
|
|||
|
||||
namespace MystStacks {
|
||||
|
||||
#define DECLARE_OPCODE(x) void x(uint16 op, uint16 var, const ArgumentsArray &args)
|
||||
#define DECLARE_OPCODE(x) void x(uint16 var, const ArgumentsArray &args)
|
||||
|
||||
class Slides : public MystScriptParser {
|
||||
public:
|
||||
|
|
|
@ -383,9 +383,7 @@ bool Stoneship::setVarValue(uint16 var, uint16 value) {
|
|||
return refresh;
|
||||
}
|
||||
|
||||
void Stoneship::o_pumpTurnOff(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Turn off previous pump selection", op);
|
||||
|
||||
void Stoneship::o_pumpTurnOff(uint16 var, const ArgumentsArray &args) {
|
||||
if (_state.pumpState) {
|
||||
uint16 buttonVar = 0;
|
||||
|
||||
|
@ -413,17 +411,13 @@ void Stoneship::o_pumpTurnOff(uint16 op, uint16 var, const ArgumentsArray &args)
|
|||
}
|
||||
}
|
||||
|
||||
void Stoneship::o_brotherDoorOpen(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Open brother door", op);
|
||||
|
||||
void Stoneship::o_brotherDoorOpen(uint16 var, const ArgumentsArray &args) {
|
||||
_brotherDoorOpen = 1;
|
||||
_vm->redrawArea(19, 0);
|
||||
animatedUpdate(args, 5);
|
||||
}
|
||||
|
||||
void Stoneship::o_cabinBookMovie(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Play Book Room Movie", op);
|
||||
|
||||
void Stoneship::o_cabinBookMovie(uint16 var, const ArgumentsArray &args) {
|
||||
uint16 startTime = args[0];
|
||||
uint16 endTime = args[1];
|
||||
|
||||
|
@ -436,9 +430,7 @@ void Stoneship::o_cabinBookMovie(uint16 op, uint16 var, const ArgumentsArray &ar
|
|||
_vm->waitUntilMovieEnds(book);
|
||||
}
|
||||
|
||||
void Stoneship::o_drawerOpenSirius(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Open drawer", op);
|
||||
|
||||
void Stoneship::o_drawerOpenSirius(uint16 var, const ArgumentsArray &args) {
|
||||
MystAreaImageSwitch *drawer = _vm->getViewResource<MystAreaImageSwitch>(args[0]);
|
||||
|
||||
if (drawer->getImageSwitchVar() == 35) {
|
||||
|
@ -454,20 +446,17 @@ void Stoneship::o_drawerOpenSirius(uint16 op, uint16 var, const ArgumentsArray &
|
|||
_vm->_gfx->runTransition(transition, drawer->getRect(), 25, 5);
|
||||
}
|
||||
|
||||
void Stoneship::o_drawerClose(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Close drawer", op);
|
||||
void Stoneship::o_drawerClose(uint16 var, const ArgumentsArray &args) {
|
||||
drawerClose(args[0]);
|
||||
}
|
||||
|
||||
void Stoneship::o_telescopeStart(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
void Stoneship::o_telescopeStart(uint16 var, const ArgumentsArray &args) {
|
||||
const Common::Point &mouse = _vm->_system->getEventManager()->getMousePos();
|
||||
_telescopeOldMouse = mouse.x;
|
||||
_vm->_cursor->setCursor(700);
|
||||
}
|
||||
|
||||
void Stoneship::o_telescopeMove(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Telescope move", op);
|
||||
|
||||
void Stoneship::o_telescopeMove(uint16 var, const ArgumentsArray &args) {
|
||||
MystAreaDrag *display = getInvokingResource<MystAreaDrag>();
|
||||
const Common::Point &mouse = _vm->_system->getEventManager()->getMousePos();
|
||||
|
||||
|
@ -483,13 +472,11 @@ void Stoneship::o_telescopeMove(uint16 op, uint16 var, const ArgumentsArray &arg
|
|||
telescopeLighthouseDraw();
|
||||
}
|
||||
|
||||
void Stoneship::o_telescopeStop(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
void Stoneship::o_telescopeStop(uint16 var, const ArgumentsArray &args) {
|
||||
_vm->checkCursorHints();
|
||||
}
|
||||
|
||||
void Stoneship::o_generatorStart(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Generator start", op);
|
||||
|
||||
void Stoneship::o_generatorStart(uint16 var, const ArgumentsArray &args) {
|
||||
MystAreaDrag *handle = getInvokingResource<MystAreaDrag>();
|
||||
|
||||
uint16 soundId = handle->getList1(0);
|
||||
|
@ -513,9 +500,7 @@ void Stoneship::o_generatorStart(uint16 op, uint16 var, const ArgumentsArray &ar
|
|||
_vm->_sound->playEffect(soundId, true);
|
||||
}
|
||||
|
||||
void Stoneship::o_generatorStop(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Generator stop", op);
|
||||
|
||||
void Stoneship::o_generatorStop(uint16 var, const ArgumentsArray &args) {
|
||||
_batteryCharging = false;
|
||||
|
||||
if (_state.generatorDuration) {
|
||||
|
@ -580,18 +565,14 @@ void Stoneship::batteryDeplete_run() {
|
|||
}
|
||||
}
|
||||
|
||||
void Stoneship::o_drawerOpenAchenar(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Open drawer", op);
|
||||
|
||||
void Stoneship::o_drawerOpenAchenar(uint16 var, const ArgumentsArray &args) {
|
||||
MystAreaImageSwitch *drawer = _vm->getViewResource<MystAreaImageSwitch>(args[0]);
|
||||
drawer->drawConditionalDataToScreen(0, 0);
|
||||
_vm->_gfx->runTransition(kTransitionTopToBottom, drawer->getRect(), 25, 5);
|
||||
}
|
||||
|
||||
void Stoneship::o_hologramPlayback(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
void Stoneship::o_hologramPlayback(uint16 var, const ArgumentsArray &args) {
|
||||
// Used for Card 2013 (Achenar's Rose-Skull Hologram)
|
||||
debugC(kDebugScript, "Opcode %d: Rose-Skull Hologram Playback", op);
|
||||
|
||||
uint16 startPoint = args[0];
|
||||
uint16 endPoint = args[1];
|
||||
// uint16 direction = args[2];
|
||||
|
@ -610,14 +591,11 @@ void Stoneship::o_hologramPlayback(uint16 op, uint16 var, const ArgumentsArray &
|
|||
_vm->waitUntilMovieEnds(displayMovie);
|
||||
}
|
||||
|
||||
void Stoneship::o_hologramSelectionStart(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Hologram start move", op);
|
||||
void Stoneship::o_hologramSelectionStart(uint16 var, const ArgumentsArray &args) {
|
||||
//_vm->_cursor->setCursor(0);
|
||||
}
|
||||
|
||||
void Stoneship::o_hologramSelectionMove(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Hologram move", op);
|
||||
|
||||
void Stoneship::o_hologramSelectionMove(uint16 var, const ArgumentsArray &args) {
|
||||
MystAreaDrag *handle = getInvokingResource<MystAreaDrag>();
|
||||
const Common::Point &mouse = _vm->_system->getEventManager()->getMousePos();
|
||||
|
||||
|
@ -642,13 +620,11 @@ void Stoneship::o_hologramSelectionMove(uint16 op, uint16 var, const ArgumentsAr
|
|||
}
|
||||
}
|
||||
|
||||
void Stoneship::o_hologramSelectionStop(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Hologram stop move", op);
|
||||
void Stoneship::o_hologramSelectionStop(uint16 var, const ArgumentsArray &args) {
|
||||
_vm->checkCursorHints();
|
||||
}
|
||||
|
||||
void Stoneship::o_compassButton(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Compass rose button pressed", op);
|
||||
void Stoneship::o_compassButton(uint16 var, const ArgumentsArray &args) {
|
||||
// Used on Card 2111 (Compass Rose)
|
||||
// Called when Button Clicked.
|
||||
uint16 correctButton = args[0];
|
||||
|
@ -666,12 +642,10 @@ void Stoneship::o_compassButton(uint16 op, uint16 var, const ArgumentsArray &arg
|
|||
_batteryDepleting = false;
|
||||
}
|
||||
|
||||
o_redrawCard(op, var, args);
|
||||
o_redrawCard(var, args);
|
||||
}
|
||||
|
||||
void Stoneship::o_chestValveVideos(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Chest valve videos", op);
|
||||
|
||||
void Stoneship::o_chestValveVideos(uint16 var, const ArgumentsArray &args) {
|
||||
Common::String movie = _vm->wrapMovieFilename("ligspig", kStoneshipStack);
|
||||
|
||||
_vm->_sound->playEffect(2132);
|
||||
|
@ -721,9 +695,7 @@ void Stoneship::o_chestValveVideos(uint16 op, uint16 var, const ArgumentsArray &
|
|||
}
|
||||
}
|
||||
|
||||
void Stoneship::o_chestDropKey(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: drop chest key", op);
|
||||
|
||||
void Stoneship::o_chestDropKey(uint16 var, const ArgumentsArray &args) {
|
||||
// If holding Key to Lamp Room Trapdoor, drop to bottom of
|
||||
// Lighthouse...
|
||||
if (_state.trapdoorKeyState == 1) {
|
||||
|
@ -732,9 +704,7 @@ void Stoneship::o_chestDropKey(uint16 op, uint16 var, const ArgumentsArray &args
|
|||
}
|
||||
}
|
||||
|
||||
void Stoneship::o_trapLockOpen(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Trap lock open video", op);
|
||||
|
||||
void Stoneship::o_trapLockOpen(uint16 var, const ArgumentsArray &args) {
|
||||
Common::String movie = _vm->wrapMovieFilename("openloc", kStoneshipStack);
|
||||
|
||||
VideoEntryPtr lock = _vm->_video->playMovie(movie);
|
||||
|
@ -759,13 +729,10 @@ void Stoneship::o_trapLockOpen(uint16 op, uint16 var, const ArgumentsArray &args
|
|||
_vm->_sound->playEffect(4143);
|
||||
}
|
||||
|
||||
void Stoneship::o_sideDoorsMovies(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
void Stoneship::o_sideDoorsMovies(uint16 var, const ArgumentsArray &args) {
|
||||
// Used for Cards 2285, 2289, 2247, 2251 (Side Doors in Tunnels Down To Brothers Rooms)
|
||||
uint16 movieId = args[0];
|
||||
|
||||
debugC(kDebugScript, "Opcode %d: Play Side Door Movies", op);
|
||||
debugC(kDebugScript, "\tmovieId: %d", movieId);
|
||||
|
||||
_vm->_cursor->hideCursor();
|
||||
_vm->_sound->pauseBackground();
|
||||
|
||||
|
@ -795,24 +762,18 @@ void Stoneship::o_sideDoorsMovies(uint16 op, uint16 var, const ArgumentsArray &a
|
|||
_vm->_cursor->showCursor();
|
||||
}
|
||||
|
||||
void Stoneship::o_cloudOrbEnter(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Cloud orb enter", op);
|
||||
|
||||
void Stoneship::o_cloudOrbEnter(uint16 var, const ArgumentsArray &args) {
|
||||
_vm->_sound->playEffect(_cloudOrbSound, true);
|
||||
_cloudOrbMovie->playMovie();
|
||||
}
|
||||
|
||||
void Stoneship::o_cloudOrbLeave(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Cloud orb leave", op);
|
||||
|
||||
void Stoneship::o_cloudOrbLeave(uint16 var, const ArgumentsArray &args) {
|
||||
_cloudOrbMovie->pauseMovie(true);
|
||||
_vm->_sound->playEffect(_cloudOrbStopSound);
|
||||
_vm->_gfx->runTransition(kTransitionTopToBottom, getInvokingResource<MystArea>()->getRect(), 4, 0);
|
||||
}
|
||||
|
||||
void Stoneship::o_drawerCloseOpened(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Close open drawer", op);
|
||||
|
||||
void Stoneship::o_drawerCloseOpened(uint16 var, const ArgumentsArray &args) {
|
||||
uint16 drawerOpen = getVar(var);
|
||||
if (drawerOpen)
|
||||
drawerClose(args[0] + drawerOpen - 1);
|
||||
|
@ -827,15 +788,13 @@ void Stoneship::drawerClose(uint16 drawer) {
|
|||
_vm->_gfx->runTransition(kTransitionBottomToTop, res->getRect(), 25, 5);
|
||||
}
|
||||
|
||||
void Stoneship::o_hologramDisplay_init(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Hologram display init", op);
|
||||
void Stoneship::o_hologramDisplay_init(uint16 var, const ArgumentsArray &args) {
|
||||
_hologramDisplay = getInvokingResource<MystAreaVideo>();
|
||||
|
||||
_hologramDisplayPos = 0;
|
||||
}
|
||||
|
||||
void Stoneship::o_hologramSelection_init(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Hologram selection init", op);
|
||||
void Stoneship::o_hologramSelection_init(uint16 var, const ArgumentsArray &args) {
|
||||
_hologramSelection = getInvokingResource<MystAreaVideo>();
|
||||
}
|
||||
|
||||
|
@ -853,26 +812,21 @@ void Stoneship::batteryGaugeUpdate() {
|
|||
_batteryGauge->setRect(rect);
|
||||
}
|
||||
|
||||
void Stoneship::o_battery_init(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
void Stoneship::o_battery_init(uint16 var, const ArgumentsArray &args) {
|
||||
// Used for Card 2160 (Lighthouse Battery Pack Closeup)
|
||||
debugC(kDebugScript, "Opcode %d: Battery init", op);
|
||||
|
||||
_batteryGauge = getInvokingResource<MystAreaImageSwitch>();
|
||||
|
||||
batteryGaugeUpdate();
|
||||
}
|
||||
|
||||
void Stoneship::o_tunnelEnter_init(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Tunnel enter", op);
|
||||
|
||||
o_tunnel_init(op, var, args);
|
||||
void Stoneship::o_tunnelEnter_init(uint16 var, const ArgumentsArray &args) {
|
||||
o_tunnel_init(var, args);
|
||||
|
||||
_tunnelRunning = true;
|
||||
_tunnelNextTime = _vm->_system->getMillis() + 1500;
|
||||
}
|
||||
|
||||
void Stoneship::o_batteryGauge_init(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Battery gauge init", op);
|
||||
void Stoneship::o_batteryGauge_init(uint16 var, const ArgumentsArray &args) {
|
||||
_batteryLastCharge = batteryRemainingCharge();
|
||||
_batteryGaugeRunning = true;
|
||||
}
|
||||
|
@ -892,9 +846,7 @@ void Stoneship::batteryGauge_run() {
|
|||
}
|
||||
}
|
||||
|
||||
void Stoneship::o_tunnel_init(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Tunnel card init", op);
|
||||
|
||||
void Stoneship::o_tunnel_init(uint16 var, const ArgumentsArray &args) {
|
||||
_tunnelImagesCount = args[0];
|
||||
|
||||
assert(_tunnelImagesCount <= 2 && "Too many images");
|
||||
|
@ -930,21 +882,15 @@ void Stoneship::tunnel_run() {
|
|||
}
|
||||
}
|
||||
|
||||
void Stoneship::o_tunnelLeave_init(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Tunnel leave", op);
|
||||
|
||||
void Stoneship::o_tunnelLeave_init(uint16 var, const ArgumentsArray &args) {
|
||||
_tunnelRunning = false;
|
||||
}
|
||||
|
||||
void Stoneship::o_chest_init(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Chest init", op);
|
||||
|
||||
void Stoneship::o_chest_init(uint16 var, const ArgumentsArray &args) {
|
||||
_state.chestOpenState = 0;
|
||||
}
|
||||
|
||||
void Stoneship::o_telescope_init(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Telescope init", op);
|
||||
|
||||
void Stoneship::o_telescope_init(uint16 var, const ArgumentsArray &args) {
|
||||
// Used in Card 2218 (Telescope view)
|
||||
_telescopePanorama = args[0];
|
||||
_telescopeLighthouseOff = args[1];
|
||||
|
@ -990,9 +936,7 @@ void Stoneship::telescopeLighthouseDraw() {
|
|||
}
|
||||
}
|
||||
|
||||
void Stoneship::o_achenarDrawers_init(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Achenar's Room Drawers Init", op);
|
||||
|
||||
void Stoneship::o_achenarDrawers_init(uint16 var, const ArgumentsArray &args) {
|
||||
// Used for Card 2004 (Achenar's Room Drawers)
|
||||
if (!_chestAchenarBottomDrawerClosed) {
|
||||
uint16 count1 = args[0];
|
||||
|
@ -1008,9 +952,7 @@ void Stoneship::o_achenarDrawers_init(uint16 op, uint16 var, const ArgumentsArra
|
|||
}
|
||||
}
|
||||
|
||||
void Stoneship::o_cloudOrb_init(uint16 op, uint16 var, const ArgumentsArray &args) {
|
||||
debugC(kDebugScript, "Opcode %d: Cloud orb init", op);
|
||||
|
||||
void Stoneship::o_cloudOrb_init(uint16 var, const ArgumentsArray &args) {
|
||||
_cloudOrbMovie = getInvokingResource<MystAreaVideo>();
|
||||
_cloudOrbSound = args[0];
|
||||
_cloudOrbStopSound = args[1];
|
||||
|
|
|
@ -33,7 +33,7 @@ struct MystScriptEntry;
|
|||
|
||||
namespace MystStacks {
|
||||
|
||||
#define DECLARE_OPCODE(x) void x(uint16 op, uint16 var, const ArgumentsArray &args)
|
||||
#define DECLARE_OPCODE(x) void x(uint16 var, const ArgumentsArray &args)
|
||||
|
||||
class Stoneship : public MystScriptParser {
|
||||
public:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue