aboutsummaryrefslogtreecommitdiff
path: root/scumm/script_v2.cpp
diff options
context:
space:
mode:
authorMax Horn2003-05-11 00:03:03 +0000
committerMax Horn2003-05-11 00:03:03 +0000
commit79d3863db4f358432279a8ee74114f78225f9502 (patch)
treef21213bf46db28870b0aa24fc1c8af78da5f86be /scumm/script_v2.cpp
parentbf270d92432e44648d93598b8153b094e16ece3e (diff)
downloadscummvm-rg350-79d3863db4f358432279a8ee74114f78225f9502.tar.gz
scummvm-rg350-79d3863db4f358432279a8ee74114f78225f9502.tar.bz2
scummvm-rg350-79d3863db4f358432279a8ee74114f78225f9502.zip
more V2 'char coord' fixes
svn-id: r7427
Diffstat (limited to 'scumm/script_v2.cpp')
-rw-r--r--scumm/script_v2.cpp24
1 files changed, 16 insertions, 8 deletions
diff --git a/scumm/script_v2.cpp b/scumm/script_v2.cpp
index 77312ef504..842d854a5a 100644
--- a/scumm/script_v2.cpp
+++ b/scumm/script_v2.cpp
@@ -99,7 +99,7 @@ void Scumm_v2::setupOpcodes() {
OPCODE(o2_roomOps),
/* 34 */
OPCODE(o5_getDist),
- OPCODE(o5_findObject),
+ OPCODE(o2_findObject),
OPCODE(o2_walkActorToObject),
OPCODE(o2_setState01),
/* 38 */
@@ -179,7 +179,7 @@ void Scumm_v2::setupOpcodes() {
OPCODE(o2_roomOps),
/* 74 */
OPCODE(o5_getDist),
- OPCODE(o5_findObject),
+ OPCODE(o2_findObject),
OPCODE(o2_walkActorToObject),
OPCODE(o2_clearState01),
/* 78 */
@@ -259,7 +259,7 @@ void Scumm_v2::setupOpcodes() {
OPCODE(o2_roomOps),
/* B4 */
OPCODE(o5_getDist),
- OPCODE(o5_findObject),
+ OPCODE(o2_findObject),
OPCODE(o2_walkActorToObject),
OPCODE(o2_setState02),
/* B8 */
@@ -339,7 +339,7 @@ void Scumm_v2::setupOpcodes() {
OPCODE(o2_roomOps),
/* F4 */
OPCODE(o5_getDist),
- OPCODE(o5_findObject),
+ OPCODE(o2_findObject),
OPCODE(o2_walkActorToObject),
OPCODE(o2_clearState01),
/* F8 */
@@ -851,6 +851,8 @@ void Scumm_v2::o2_walkActorTo() {
a = derefActorSafe(getVarOrDirectByte(0x80), "o2_walkActorTo");
x = getVarOrDirectByte(0x40) * 8;
y = getVarOrDirectByte(0x20) * 2;
+
+ assert(a);
a->ignoreBoxes = true; // FIXME: Disabling walkboxes
a->startWalkActor(x, y, -1); // for now, just to debug the intro
}
@@ -863,8 +865,7 @@ void Scumm_v2::o2_putActor() {
x = getVarOrDirectByte(0x40) * 8;
y = getVarOrDirectByte(0x20) * 2;
- if (!a)
- return;
+ assert(a);
a->putActor(x, y, a->room);
}
@@ -931,11 +932,18 @@ void Scumm_v2::o2_animateActor() {
void Scumm_v2::o2_actorFromPos() {
int x, y;
getResultPos();
- x = getVarOrDirectByte(0x80);
- y = getVarOrDirectByte(0x40);
+ x = getVarOrDirectByte(0x80) * 8;
+ y = getVarOrDirectByte(0x40) * 2;
setResult(getActorFromPos(x, y));
}
+void Scumm_v2::o2_findObject() {
+ getResultPos();
+ int x = getVarOrDirectByte(0x80) * 8;
+ int y = getVarOrDirectByte(0x40) * 2;
+ setResult(findObject(x, y));
+}
+
void Scumm_v2::o2_saveLoadGame() {
getResultPos();
byte a = getVarOrDirectByte(0x80);