aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTravis Howell2006-06-19 04:09:39 +0000
committerTravis Howell2006-06-19 04:09:39 +0000
commitbc6306192d3f31ff3ab7b72585ec7b58687dc59c (patch)
treee6b9d676abfc998f8e5fa2e0031177fa12adc24b
parent15c26ed5eba1134e67caa14d3359f06409b86441 (diff)
downloadscummvm-rg350-bc6306192d3f31ff3ab7b72585ec7b58687dc59c.tar.gz
scummvm-rg350-bc6306192d3f31ff3ab7b72585ec7b58687dc59c.tar.bz2
scummvm-rg350-bc6306192d3f31ff3ab7b72585ec7b58687dc59c.zip
Fix screen scrolling glitch when looking at the top of closet in parents room of DOS version of fbear
svn-id: r23174
-rw-r--r--engines/scumm/gfx.cpp22
-rw-r--r--engines/scumm/he/script_v60he.cpp1
-rw-r--r--engines/scumm/script_v5.cpp1
-rw-r--r--engines/scumm/script_v6.cpp1
-rw-r--r--engines/scumm/scumm.h1
5 files changed, 16 insertions, 10 deletions
diff --git a/engines/scumm/gfx.cpp b/engines/scumm/gfx.cpp
index a0ff7a8a37..a66f39700c 100644
--- a/engines/scumm/gfx.cpp
+++ b/engines/scumm/gfx.cpp
@@ -3003,16 +3003,6 @@ void ScummEngine::fadeOut(int effect) {
if (!(_game.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->pitch);
- memcpy(_scrollBuffer, vs->getPixels(0, 0), vs->h * vs->pitch);
- }
-
-
if (_screenEffectFlag && effect != 0) {
// Fill screen 0 with black
@@ -3054,6 +3044,18 @@ void ScummEngine::fadeOut(int effect) {
_screenEffectFlag = false;
}
+void ScummEngine::setScrollBuffer() {
+ 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->pitch);
+ memcpy(_scrollBuffer, vs->getPixels(0, 0), vs->h * vs->pitch);
+ }
+}
+
/**
* Perform a transition effect. There are four different effects possible:
* 0: Iris effect
diff --git a/engines/scumm/he/script_v60he.cpp b/engines/scumm/he/script_v60he.cpp
index 24efa9eabc..d6de73d123 100644
--- a/engines/scumm/he/script_v60he.cpp
+++ b/engines/scumm/he/script_v60he.cpp
@@ -519,6 +519,7 @@ void ScummEngine_v60he::o60_roomOps() {
} else if (a) {
_switchRoomEffect = (byte)(a & 0xFF);
_switchRoomEffect2 = (byte)(a >> 8);
+ setScrollBuffer();
} else {
fadeIn(_newEffect);
}
diff --git a/engines/scumm/script_v5.cpp b/engines/scumm/script_v5.cpp
index e567cbc5cf..bdc34ea0f0 100644
--- a/engines/scumm/script_v5.cpp
+++ b/engines/scumm/script_v5.cpp
@@ -1926,6 +1926,7 @@ void ScummEngine_v5::o5_roomOps() {
}
_switchRoomEffect = (byte)(a & 0xFF);
_switchRoomEffect2 = (byte)(a >> 8);
+ setScrollBuffer();
} else {
fadeIn(_newEffect);
}
diff --git a/engines/scumm/script_v6.cpp b/engines/scumm/script_v6.cpp
index 64b43c4ec5..5379bdb1fa 100644
--- a/engines/scumm/script_v6.cpp
+++ b/engines/scumm/script_v6.cpp
@@ -1707,6 +1707,7 @@ void ScummEngine_v6::o6_roomOps() {
if (a) {
_switchRoomEffect = (byte)(a & 0xFF);
_switchRoomEffect2 = (byte)(a >> 8);
+ setScrollBuffer();
} else {
fadeIn(_newEffect);
}
diff --git a/engines/scumm/scumm.h b/engines/scumm/scumm.h
index e77418f28e..0c2f46171b 100644
--- a/engines/scumm/scumm.h
+++ b/engines/scumm/scumm.h
@@ -1078,6 +1078,7 @@ public:
protected:
void fadeIn(int effect);
void fadeOut(int effect);
+ void setScrollBuffer();
void unkScreenEffect6();
void transitionEffect(int a);