aboutsummaryrefslogtreecommitdiff
path: root/engines/draci
diff options
context:
space:
mode:
authorDenis Kasak2009-07-04 18:36:45 +0000
committerDenis Kasak2009-07-04 18:36:45 +0000
commitfdf9eb84d6f9c59527a06a2571ee80b467dffdd3 (patch)
treec21df14f60945fe49f29790f23fcdc53219f4a91 /engines/draci
parentb96b4344468f1ba4214574bc1854e47f62501e76 (diff)
downloadscummvm-rg350-fdf9eb84d6f9c59527a06a2571ee80b467dffdd3.tar.gz
scummvm-rg350-fdf9eb84d6f9c59527a06a2571ee80b467dffdd3.tar.bz2
scummvm-rg350-fdf9eb84d6f9c59527a06a2571ee80b467dffdd3.zip
Implemented handler for the Load instruction. Removed Script::dummy().
svn-id: r42102
Diffstat (limited to 'engines/draci')
-rw-r--r--engines/draci/script.cpp13
-rw-r--r--engines/draci/script.h3
2 files changed, 8 insertions, 8 deletions
diff --git a/engines/draci/script.cpp b/engines/draci/script.cpp
index f4041157d8..00d68676e4 100644
--- a/engines/draci/script.cpp
+++ b/engines/draci/script.cpp
@@ -45,7 +45,7 @@ void Script::setupCommandList() {
{ 2, 1, "Let", 2, { 3, 4 }, NULL },
{ 3, 1, "if", 2, { 4, 3 }, NULL },
{ 4, 1, "Start", 2, { 3, 2 }, NULL },
- { 5, 1, "Load", 2, { 3, 2 }, &Script::dummy },
+ { 5, 1, "Load", 2, { 3, 2 }, &Script::load },
{ 5, 2, "StartPlay", 2, { 3, 2 }, NULL },
{ 5, 3, "JustTalk", 0, { 0 }, NULL },
{ 5, 4, "JustStay", 0, { 0 }, NULL },
@@ -146,13 +146,14 @@ enum mathExpressionObject {
kMathVariable
};
-void Script::dummy(Common::Queue<int> &params) {
+void Script::load(Common::Queue<int> &params) {
+ int objID = params.pop() - 1;
+ int animID = params.pop() - 1;
- debug(1, "- %d", params.pop());
- debug(1, "- %d", params.pop());
-}
+ GameObject *obj = _vm->_game->getObject(objID);
-// FIXME: The evaluator is now complete but I still need to implement callbacks
+ obj->_seqTab[animID - obj->_idxSeq] = _vm->_game->loadAnimation(animID);
+}
/**
* @brief Evaluates mathematical expressions
diff --git a/engines/draci/script.h b/engines/draci/script.h
index c4d9e75100..5d8340858c 100644
--- a/engines/draci/script.h
+++ b/engines/draci/script.h
@@ -83,14 +83,13 @@ private:
/** List of all GPL commands. Initialised in the constructor. */
const GPL2Command *_commandList;
- void dummy(Common::Queue<int> &params);
+ void load(Common::Queue<int> &params);
void setupCommandList();
const GPL2Command *findCommand(byte num, byte subnum);
int handleMathExpression(Common::MemoryReadStream &reader);
DraciEngine *_vm;
-
};
}