aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorTravis Howell2006-02-28 00:46:05 +0000
committerTravis Howell2006-02-28 00:46:05 +0000
commitdb925b310eafeb1c401d12eb1a1f6659a44b2e47 (patch)
treec377325de82a57eaf755c04ed7bc4013e837c1c1 /engines
parent2bcd6bb95e26d1f15b560133fff49e2255bfd94d (diff)
downloadscummvm-rg350-db925b310eafeb1c401d12eb1a1f6659a44b2e47.tar.gz
scummvm-rg350-db925b310eafeb1c401d12eb1a1f6659a44b2e47.tar.bz2
scummvm-rg350-db925b310eafeb1c401d12eb1a1f6659a44b2e47.zip
Update code and comment for screen savers issue in Sam & Max.
svn-id: r20965
Diffstat (limited to 'engines')
-rw-r--r--engines/scumm/script_v6.cpp30
1 files changed, 13 insertions, 17 deletions
diff --git a/engines/scumm/script_v6.cpp b/engines/scumm/script_v6.cpp
index 31135e99d2..0b5a6e0850 100644
--- a/engines/scumm/script_v6.cpp
+++ b/engines/scumm/script_v6.cpp
@@ -2700,24 +2700,22 @@ void ScummEngine_v6::o6_kernelGetFunctions() {
int i;
int slot;
Actor *a;
+ VirtScreen *vs = &virtscr[0];
getStackList(args, ARRAYSIZE(args));
switch (args[0]) {
case 113:
- // This is used for the Sam & Max paint-by-numbers mini-game
- // to find out what color to change. I think that what we have
- // the virtual mouse coordinates, because that's what used
- // everywhere else in the script.
-
- {
- VirtScreen *vs = &virtscr[0];
- if (args[1] < 0 || args[1] >= vs->w || args[2] < 0 || args[2] >= vs->h) {
- // FIXME: Until we know what to do in this case...
- debug(0, "o6_kernelGetFunctions:113: asking for pixel (%d, %d) outside of %dx%d screen", args[1], args[2], vs->w, vs->h);
- push(0);
- } else
- push(*((byte *)vs->pixels + args[1] + args[2] * vs->pitch));
+ // WORKAROUND for bug #899249: The scripts used for screen savers
+ // in Sam & Max use hard coded values for the maximum height and width.
+ // This causes problems in rooms (ie. Credits) where their values are
+ // lower, so we set result to zero if out of bounds.
+ // scenes (ie Credits) where values are lower.
+ if (args[1] >= 0 && args[1] <= vs->w && args[2] >= 0 && args[2] <= vs->h) {
+ byte pixel = *vs->getPixels(args[1], args[2]);
+ push(pixel);
+ } else {
+ push(0);
}
break;
case 115:
@@ -3070,8 +3068,6 @@ void ScummEngine_v6::o6_getDateTime() {
}
void ScummEngine_v6::o6_getPixel() {
- // This opcode is used to check fir ground area in the "Asteroid Lander"
- // minigame in "The Dig"
int x, y;
if (_game.heversion == 61) {
@@ -3089,8 +3085,8 @@ void ScummEngine_v6::o6_getPixel() {
return;
}
- byte area = *vs->getPixels(x, y - vs->topline);
- push(area);
+ byte pixel = *vs->getPixels(x, y - vs->topline);
+ push(pixel);
}
void ScummEngine_v6::o6_setBoxSet() {