aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2004-08-14 15:14:01 +0000
committerMax Horn2004-08-14 15:14:01 +0000
commit239aa2b0629f4499279f79d52a2c955a9c17877f (patch)
treee524bbbcb5ee4f7a207d43857bf1cf7f2cafe131
parentbc7b72f13dc075c3b221941c4f182a98d689715e (diff)
downloadscummvm-rg350-239aa2b0629f4499279f79d52a2c955a9c17877f.tar.gz
scummvm-rg350-239aa2b0629f4499279f79d52a2c955a9c17877f.tar.bz2
scummvm-rg350-239aa2b0629f4499279f79d52a2c955a9c17877f.zip
Renamed o6_unknownE1 to o6_getPixel; use vs->xstart instead of _screenLeft
svn-id: r14607
-rw-r--r--scumm/intern.h2
-rw-r--r--scumm/script_v6.cpp22
-rw-r--r--scumm/script_v6he.cpp2
-rw-r--r--scumm/script_v7he.cpp2
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 */