Fix for bug #1031390 (FOA: Graphical corruption and possible crash in Atlantis Map)

svn-id: r15207
This commit is contained in:
Max Horn
2004-09-20 19:58:07 +00:00
parent f61a0f83ff
commit 3b9bcb7745
2 changed files with 18 additions and 20 deletions
+18 -1
View File
@@ -2743,10 +2743,27 @@ void ScummEngine::fadeOut(int effect) {
if (!(_features & GF_NEW_CAMERA))
camera._last.x = camera._cur.x;
if (_switchRoomEffect >= 130 && _switchRoomEffect <= 133) {
// We're going to use scrollEffect(), so we'll need a copy of
// the current VirtScreen zero.
free(_scrollBuffer);
_scrollBuffer = (byte *) malloc(vs->h * vs->w);
byte *src = vs->getPixels(0, 0);
byte *dst = _scrollBuffer;
for (int y = 0; y < vs->h; y++) {
memcpy(dst, src, vs->w);
src += vs->pitch;
dst += vs->w;
}
}
if (_screenEffectFlag && effect != 0) {
// Fill screen 0 with black
memset(vs->getPixels(0, 0), 0, vs->pitch * vs->h);
// Fade to black with the specified effect, if any.
-19
View File
@@ -2328,25 +2328,6 @@ void ScummEngine::startScene(int room, Actor *a, int objectNr) {
runExitScript();
if (_switchRoomEffect >= 130 && _switchRoomEffect <= 133) {
// We're going to use scrollEffect(), so we'll need a copy of
// the current VirtScreen zero.
VirtScreen *vs = &virtscr[0];
free(_scrollBuffer);
_scrollBuffer = (byte *) malloc(vs->h * vs->w);
byte *src = vs->getPixels(0, 0);
byte *dst = _scrollBuffer;
for (int y = 0; y < vs->h; y++) {
memcpy(dst, src, vs->w);
src += vs->pitch;
dst += vs->w;
}
}
killScriptsAndResources();
clearEnqueue();
if (_version >= 4 && _heversion <= 60)