From de0b5f76749add219a6b667d5d2d69fb8a86d959 Mon Sep 17 00:00:00 2001 From: Tobias Gunkel Date: Sun, 8 Jan 2012 23:51:13 +0100 Subject: 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 --- engines/scumm/script_v2.cpp | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) (limited to 'engines/scumm/script_v2.cpp') 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); } } -- cgit v1.2.3