From 239aa2b0629f4499279f79d52a2c955a9c17877f Mon Sep 17 00:00:00 2001 From: Max Horn Date: Sat, 14 Aug 2004 15:14:01 +0000 Subject: Renamed o6_unknownE1 to o6_getPixel; use vs->xstart instead of _screenLeft svn-id: r14607 --- scumm/intern.h | 2 +- scumm/script_v6.cpp | 22 ++++------------------ scumm/script_v6he.cpp | 2 +- scumm/script_v7he.cpp | 2 +- 4 files changed, 7 insertions(+), 21 deletions(-) diff --git a/scumm/intern.h b/scumm/intern.h index 63399b1303..2dbaafda18 100644 --- a/scumm/intern.h +++ b/scumm/intern.h @@ -511,7 +511,7 @@ protected: void o6_findAllObjects(); void o6_pickVarRandom(); void o6_getDateTime(); - void o6_unknownE1(); + void o6_getPixel(); void o6_setBoxSet(); void o6_shuffle(); diff --git a/scumm/script_v6.cpp b/scumm/script_v6.cpp index ce7a7b4256..d20ef2a95d 100644 --- a/scumm/script_v6.cpp +++ b/scumm/script_v6.cpp @@ -331,7 +331,7 @@ void ScummEngine_v6::setupOpcodes() { OPCODE(o6_invalid), /* E0 */ OPCODE(o6_invalid), - OPCODE(o6_unknownE1), + OPCODE(o6_getPixel), OPCODE(o6_invalid), OPCODE(o6_pickVarRandom), /* E4 */ @@ -3104,7 +3104,7 @@ void ScummEngine_v6::o6_getDateTime() { VAR(VAR_TIMEDATE_SECOND) = t->tm_sec; } -void ScummEngine_v6::o6_unknownE1() { +void ScummEngine_v6::o6_getPixel() { // this opcode check ground area in minigame "Asteroid Lander" in the dig int x, y; @@ -3116,28 +3116,14 @@ void ScummEngine_v6::o6_unknownE1() { x = pop(); } - if (x > _screenWidth - 1) { - push(-1); - return; - } - if (x < 0) { - push(-1); - return; - } - - if (y < 0) { - push(-1); - return; - } - VirtScreen *vs = findVirtScreen(y); - if (vs == NULL) { + if (vs == NULL || x > _screenWidth - 1 || x < 0) { push(-1); return; } - int offset = (y - vs->topline) * vs->width + x + _screenLeft; + int offset = (y - vs->topline) * vs->width + x + vs->xstart; byte area = *(vs->screenPtr + offset); push(area); diff --git a/scumm/script_v6he.cpp b/scumm/script_v6he.cpp index 1bbd189ec8..634fe1ea73 100644 --- a/scumm/script_v6he.cpp +++ b/scumm/script_v6he.cpp @@ -333,7 +333,7 @@ void ScummEngine_v6he::setupOpcodes() { OPCODE(o6_rename), /* E0 */ OPCODE(o6_soundOps), - OPCODE(o6_unknownE1), + OPCODE(o6_getPixel), OPCODE(o6_localizeArray), OPCODE(o6_pickVarRandom), /* E4 */ diff --git a/scumm/script_v7he.cpp b/scumm/script_v7he.cpp index ff62eea9e9..a365010f8c 100644 --- a/scumm/script_v7he.cpp +++ b/scumm/script_v7he.cpp @@ -333,7 +333,7 @@ void ScummEngine_v7he::setupOpcodes() { OPCODE(o6_rename), /* E0 */ OPCODE(o6_soundOps), - OPCODE(o6_unknownE1), + OPCODE(o6_getPixel), OPCODE(o6_localizeArray), OPCODE(o6_pickVarRandom), /* E4 */ -- cgit v1.2.3