diff options
author | Paul Gilbert | 2015-01-22 07:53:33 -0500 |
---|---|---|
committer | Paul Gilbert | 2015-01-22 07:53:33 -0500 |
commit | 4c0c40c25df79d9cbed6f401b83165d90ae3b4cd (patch) | |
tree | f0a3320805bc33b691a16167993227780bf40510 /engines/xeen/scripts.cpp | |
parent | 16a5a99c3aa615f5b69a8c4c1df987c906973990 (diff) | |
download | scummvm-rg350-4c0c40c25df79d9cbed6f401b83165d90ae3b4cd.tar.gz scummvm-rg350-4c0c40c25df79d9cbed6f401b83165d90ae3b4cd.tar.bz2 scummvm-rg350-4c0c40c25df79d9cbed6f401b83165d90ae3b4cd.zip |
XEEN: Shifted more logic for 3d view drawing from Interface to InterfaceMap
Diffstat (limited to 'engines/xeen/scripts.cpp')
-rw-r--r-- | engines/xeen/scripts.cpp | 58 |
1 files changed, 49 insertions, 9 deletions
diff --git a/engines/xeen/scripts.cpp b/engines/xeen/scripts.cpp index 3bf7a3104c..73c0445011 100644 --- a/engines/xeen/scripts.cpp +++ b/engines/xeen/scripts.cpp @@ -129,7 +129,7 @@ void Scripts::checkEvents() { _vm->_mode = MODE_9; _paramText = event._parameters.size() == 0 ? "" : map._events._text[event._parameters[0]]; - doOpcode(event._opcode, event._parameters); + doOpcode(event); break; } else { var50 = true; @@ -154,7 +154,10 @@ void Scripts::openGrate(int v1, int v2) { typedef void(Scripts::*ScriptMethodPtr)(Common::Array<byte> &); -void Scripts::doOpcode(Opcode opcode, Common::Array<byte> ¶ms) { +/** + * Handles executing a given script command + */ +void Scripts::doOpcode(MazeEvent &event) { static const ScriptMethodPtr COMMAND_LIST[] = { nullptr, &Scripts::cmdDisplay1, &Scripts::cmdDoorTextSml, &Scripts::cmdDoorTextLrg, &Scripts::cmdSignText, @@ -180,7 +183,8 @@ void Scripts::doOpcode(Opcode opcode, Common::Array<byte> ¶ms) { &Scripts::cmdCutsceneEdWorld, &Scripts::cmdFlipWorld, &Scripts::cmdPlayCD }; - (this->*COMMAND_LIST[opcode])(params); + _event = &event; + (this->*COMMAND_LIST[event._opcode])(event._parameters); } /** @@ -209,8 +213,8 @@ void Scripts::cmdDoorTextSml(Common::Array<byte> ¶ms) { _paramText.c_str()); intf._upDoorText = true; intf.draw3d(true); - _var4F = true; + _var4F = true; cmdNoAction(params); } @@ -223,16 +227,52 @@ void Scripts::cmdDoorTextLrg(Common::Array<byte> ¶ms) { _paramText.c_str()); intf._upDoorText = true; intf.draw3d(true); + _var4F = true; + cmdNoAction(params); +} +void Scripts::cmdSignText(Common::Array<byte> ¶ms) { + Interface &intf = *_vm->_interface; + intf._screenText = Common::String::format("\f08\x03""c\t120\v088%s\x03""l\fd", + _paramText.c_str()); + intf._upDoorText = true; + intf.draw3d(true); + + _var4F = true; cmdNoAction(params); } -void Scripts::cmdSignText(Common::Array<byte> ¶ms) {} -void Scripts::cmdNPC(Common::Array<byte> ¶ms) {} -void Scripts::cmdPlayFX(Common::Array<byte> ¶ms) {} -void Scripts::cmdTeleport(Common::Array<byte> ¶ms) {} -void Scripts::cmdIf(Common::Array<byte> ¶ms) {} +void Scripts::cmdNPC(Common::Array<byte> ¶ms) { + warning("TODO: cmdNPC"); +} + +void Scripts::cmdPlayFX(Common::Array<byte> ¶ms) { + _vm->_sound->playFX(params[0]); + + _var4F = true; + cmdNoAction(params); +} + +void Scripts::cmdTeleport(Common::Array<byte> ¶ms) { +} + +void Scripts::cmdIf(Common::Array<byte> ¶ms) { + switch (params[0]) { + case 16: + case 34: + case 100: + break; + case 25: + case 35: + case 101: + case 106: + break; + default: + break; + } +} + void Scripts::cmdMoveObj(Common::Array<byte> ¶ms) {} void Scripts::cmdTakeOrGive(Common::Array<byte> ¶ms) {} |