diff options
author | Denis Kasak | 2009-07-25 03:37:22 +0000 |
---|---|---|
committer | Denis Kasak | 2009-07-25 03:37:22 +0000 |
commit | ed59a12d53e9dc26c53620333b6a94a11980f3a8 (patch) | |
tree | 8ddda2fabf759562ca9e84da34c85eedf6e9ab7d /engines/draci | |
parent | d28658984dcceb7c090af9f7040d1490239a820b (diff) | |
download | scummvm-rg350-ed59a12d53e9dc26c53620333b6a94a11980f3a8.tar.gz scummvm-rg350-ed59a12d53e9dc26c53620333b6a94a11980f3a8.tar.bz2 scummvm-rg350-ed59a12d53e9dc26c53620333b6a94a11980f3a8.zip |
Implemented ExecUse, ExecLook and ExecInit GPL commands.
svn-id: r42732
Diffstat (limited to 'engines/draci')
-rw-r--r-- | engines/draci/script.cpp | 39 | ||||
-rw-r--r-- | engines/draci/script.h | 3 |
2 files changed, 39 insertions, 3 deletions
diff --git a/engines/draci/script.cpp b/engines/draci/script.cpp index ad601f093d..a7bb8bda09 100644 --- a/engines/draci/script.cpp +++ b/engines/draci/script.cpp @@ -67,9 +67,9 @@ void Script::setupCommandList() { { 13, 1, "FadePalette", 3, { 1, 1, 1 }, NULL }, { 13, 2, "FadePalettePlay", 3, { 1, 1, 1 }, NULL }, { 14, 1, "NewRoom", 2, { 3, 1 }, NULL }, - { 15, 1, "ExecInit", 1, { 3 }, NULL }, - { 15, 2, "ExecLook", 1, { 3 }, NULL }, - { 15, 3, "ExecUse", 1, { 3 }, NULL }, + { 15, 1, "ExecInit", 1, { 3 }, &Script::execInit }, + { 15, 2, "ExecLook", 1, { 3 }, &Script::execLook }, + { 15, 3, "ExecUse", 1, { 3 }, &Script::execUse }, { 16, 1, "RepaintInventory", 0, { 0 }, NULL }, { 16, 2, "ExitInventory", 0, { 0 }, NULL }, { 17, 1, "ExitMap", 0, { 0 }, NULL }, @@ -369,6 +369,39 @@ void Script::objStat(Common::Queue<int> ¶ms) { } } +void Script::execInit(Common::Queue<int> ¶ms) { + if (_vm->_game->getLoopStatus() == kStatusInventory) { + return; + } + + int objID = params.pop() - 1; + + GameObject *obj = _vm->_game->getObject(objID); + run(obj->_program, obj->_init); +} + +void Script::execLook(Common::Queue<int> ¶ms) { + if (_vm->_game->getLoopStatus() == kStatusInventory) { + return; + } + + int objID = params.pop() - 1; + + GameObject *obj = _vm->_game->getObject(objID); + run(obj->_program, obj->_look); +} + +void Script::execUse(Common::Queue<int> ¶ms) { + if (_vm->_game->getLoopStatus() == kStatusInventory) { + return; + } + + int objID = params.pop() - 1; + + GameObject *obj = _vm->_game->getObject(objID); + run(obj->_program, obj->_use); +} + /** * @brief Evaluates mathematical expressions * @param reader Stream reader set to the beginning of the expression diff --git a/engines/draci/script.h b/engines/draci/script.h index 4e1943ed8f..11a1c6f3a8 100644 --- a/engines/draci/script.h +++ b/engines/draci/script.h @@ -108,6 +108,9 @@ private: void release(Common::Queue<int> ¶ms); void objStat(Common::Queue<int> ¶ms); void objStatOn(Common::Queue<int> ¶ms); + void execInit(Common::Queue<int> ¶ms); + void execLook(Common::Queue<int> ¶ms); + void execUse(Common::Queue<int> ¶ms); int operAnd(int op1, int op2); int operOr(int op1, int op2); |