diff options
| author | Torbjörn Andersson | 2004-03-05 11:08:29 +0000 |
|---|---|---|
| committer | Torbjörn Andersson | 2004-03-05 11:08:29 +0000 |
| commit | bec9e69e42b64e31b69dbdaf9b5021775528831e (patch) | |
| tree | 293bed4c6bc35dea4063e3c9d8b9b8791f067317 | |
| parent | 07d918ace29043a051ecfa91419277030e8c7c42 (diff) | |
| download | scummvm-rg350-bec9e69e42b64e31b69dbdaf9b5021775528831e.tar.gz scummvm-rg350-bec9e69e42b64e31b69dbdaf9b5021775528831e.tar.bz2 scummvm-rg350-bec9e69e42b64e31b69dbdaf9b5021775528831e.zip | |
We already know the Sam & Max screensavers trigger these assertions so
until someone figures out exactly what to do, let's do something less
drastic. Now if someone requests a pixel outside the known screen, assume
that pixel has colour 0.
svn-id: r13200
| -rw-r--r-- | scumm/script_v6.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/scumm/script_v6.cpp b/scumm/script_v6.cpp index 336db49cea..b036184701 100644 --- a/scumm/script_v6.cpp +++ b/scumm/script_v6.cpp @@ -2681,13 +2681,15 @@ void ScummEngine_v6::o6_kernelGetFunctions() { // the virtual mouse coordinates, because that's what used // everywhere else in the script. - if (args[1] != -1 && args[2] != -1) { + { VirtScreen *vs = &virtscr[0]; - assert(0 <= args[1] && args[1] < vs->width); - assert(0 <= args[2] && args[2] < vs->height); - push(vs->screenPtr[args[1] + args[2] * vs->width]); - } else - push(0); + if (args[1] < 0 || args[1] >= vs->width || args[2] < 0 || args[2] >= vs->height) { + // FIXME: Until we know what to do in this case... + warning("o6_kernelGetFunctions:113: asking for pixel (%d, %d) outside of %dx%d screen", args[1], args[2], vs->width, vs->height); + push(0); + } else + push(vs->screenPtr[args[1] + args[2] * vs->width]); + } break; case 115: push(getSpecialBox(args[1], args[2])); |
