aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm/script_v2.cpp
diff options
context:
space:
mode:
authorTobias Gunkel2012-01-08 23:51:13 +0100
committerTobias Gunkel2012-02-11 08:28:22 +0100
commitde0b5f76749add219a6b667d5d2d69fb8a86d959 (patch)
tree1ad135eecc6a2d91ccec411a7b60acd53499c0a2 /engines/scumm/script_v2.cpp
parentd8b435917d5cc00ad2b4817c5eabc828439e36f3 (diff)
downloadscummvm-rg350-de0b5f76749add219a6b667d5d2d69fb8a86d959.tar.gz
scummvm-rg350-de0b5f76749add219a6b667d5d2d69fb8a86d959.tar.bz2
scummvm-rg350-de0b5f76749add219a6b667d5d2d69fb8a86d959.zip
SCUMM: use command stack and SentenceTab in mm c64
- MM C64 uses command stack (SentenceTab, doSentence()) now - _cmdObject... added for current SentenceTab. The _active... variables are only used to build a sentence in the inventory but never by a script. -> many routines are not needed anymore and are removed
Diffstat (limited to 'engines/scumm/script_v2.cpp')
-rw-r--r--engines/scumm/script_v2.cpp27
1 files changed, 15 insertions, 12 deletions
diff --git a/engines/scumm/script_v2.cpp b/engines/scumm/script_v2.cpp
index 1ea3257c17..6f6138d411 100644
--- a/engines/scumm/script_v2.cpp
+++ b/engines/scumm/script_v2.cpp
@@ -1219,20 +1219,23 @@ void ScummEngine_v2::o2_panCameraTo() {
panCameraTo(getVarOrDirectByte(PARAM_1) * V12_X_MULTIPLIER, 0);
}
-void ScummEngine_v2::o2_walkActorToObject() {
- int obj;
- Actor *a;
+void ScummEngine_v2::walkActorToObject(int actor, int obj) {
+ int x, y, dir;
+ getObjectXYPos(obj, x, y, dir);
- a = derefActor(getVarOrDirectByte(PARAM_1), "o2_walkActorToObject");
- obj = getVarOrDirectWord(PARAM_2);
- if (whereIsObject(obj) != WIO_NOT_FOUND) {
- int x, y, dir;
- getObjectXYPos(obj, x, y, dir);
- AdjustBoxResult r = a->adjustXYToBeInBox(x, y);
- x = r.x;
- y = r.y;
+ Actor *a = derefActor(actor, "walkActorToObject");
+ AdjustBoxResult r = a->adjustXYToBeInBox(x, y);
+ x = r.x;
+ y = r.y;
+
+ a->startWalkActor(x, y, dir);
+}
- a->startWalkActor(x, y, dir);
+void ScummEngine_v2::o2_walkActorToObject() {
+ int actor = getVarOrDirectByte(PARAM_1);
+ int obj = getVarOrDirectWord(PARAM_2);
+ if (whereIsObject(obj) != WIO_NOT_FOUND) {
+ walkActorToObject(actor, obj);
}
}