From 35a354bab7316fad0638533b35b487d35212c68f Mon Sep 17 00:00:00 2001 From: Travis Howell Date: Tue, 24 Aug 2004 15:25:32 +0000 Subject: That should not have been removed svn-id: r14731 --- scumm/intern.h | 2 ++ scumm/script_v72he.cpp | 31 ++++++++++++++++++++++++++++--- 2 files changed, 30 insertions(+), 3 deletions(-) (limited to 'scumm') diff --git a/scumm/intern.h b/scumm/intern.h index 769dd58a7e..9e50aa44b5 100644 --- a/scumm/intern.h +++ b/scumm/intern.h @@ -656,6 +656,8 @@ protected: /* Version 7 script opcodes */ void o72_getString(); void o72_compareStackList(); + void o72_objectX(); + void o72_objectY(); void o72_startScript(); void o72_startObject(); void o72_drawObject(); diff --git a/scumm/script_v72he.cpp b/scumm/script_v72he.cpp index 942ffd866d..b29000f304 100644 --- a/scumm/script_v72he.cpp +++ b/scumm/script_v72he.cpp @@ -151,8 +151,8 @@ void ScummEngine_v72he::setupOpcodes() { OPCODE(o6_invalid), OPCODE(o6_wordArrayInc), /* 54 */ - OPCODE(o6_getObjectX), - OPCODE(o6_getObjectY), + OPCODE(o72_objectX), + OPCODE(o72_objectY), OPCODE(o6_byteVarDec), OPCODE(o6_wordVarDec), /* 58 */ @@ -396,7 +396,7 @@ void ScummEngine_v72he::o72_compareStackList() { int value = pop(); if (num) { - for (i = 1; i < 128; i++) { + for (i = 1; i < num; i++) { if (args[i] == value) { push(1); break; @@ -407,6 +407,31 @@ void ScummEngine_v72he::o72_compareStackList() { } } +void ScummEngine_v72he::o72_objectX() { + int object = pop(); + int objnum = getObjectIndex(object); + + if (objnum == -1) { + push(0); + return; + } + + push(_objs[objnum].x_pos); +} + + +void ScummEngine_v72he::o72_objectY() { + int object = pop(); + int objnum = getObjectIndex(object); + + if (objnum == -1) { + push(0); + return; + } + + push(_objs[objnum].y_pos); +} + void ScummEngine_v72he::o72_startScript() { int args[16]; int script, flags; -- cgit v1.2.3