Fix screen scrolling glitch when looking at the top of closet in parents room of DOS version of fbear

svn-id: r23174
This commit is contained in:
Travis Howell 2006-06-19 04:09:39 +00:00
parent 15c26ed5eb
commit bc6306192d
5 changed files with 16 additions and 10 deletions

View file

@ -3003,16 +3003,6 @@ void ScummEngine::fadeOut(int effect) {
if (!(_game.features & GF_NEW_CAMERA)) if (!(_game.features & GF_NEW_CAMERA))
camera._last.x = camera._cur.x; 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) { if (_screenEffectFlag && effect != 0) {
// Fill screen 0 with black // Fill screen 0 with black
@ -3054,6 +3044,18 @@ void ScummEngine::fadeOut(int effect) {
_screenEffectFlag = false; _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: * Perform a transition effect. There are four different effects possible:
* 0: Iris effect * 0: Iris effect

View file

@ -519,6 +519,7 @@ void ScummEngine_v60he::o60_roomOps() {
} else if (a) { } else if (a) {
_switchRoomEffect = (byte)(a & 0xFF); _switchRoomEffect = (byte)(a & 0xFF);
_switchRoomEffect2 = (byte)(a >> 8); _switchRoomEffect2 = (byte)(a >> 8);
setScrollBuffer();
} else { } else {
fadeIn(_newEffect); fadeIn(_newEffect);
} }

View file

@ -1926,6 +1926,7 @@ void ScummEngine_v5::o5_roomOps() {
} }
_switchRoomEffect = (byte)(a & 0xFF); _switchRoomEffect = (byte)(a & 0xFF);
_switchRoomEffect2 = (byte)(a >> 8); _switchRoomEffect2 = (byte)(a >> 8);
setScrollBuffer();
} else { } else {
fadeIn(_newEffect); fadeIn(_newEffect);
} }

View file

@ -1707,6 +1707,7 @@ void ScummEngine_v6::o6_roomOps() {
if (a) { if (a) {
_switchRoomEffect = (byte)(a & 0xFF); _switchRoomEffect = (byte)(a & 0xFF);
_switchRoomEffect2 = (byte)(a >> 8); _switchRoomEffect2 = (byte)(a >> 8);
setScrollBuffer();
} else { } else {
fadeIn(_newEffect); fadeIn(_newEffect);
} }

View file

@ -1078,6 +1078,7 @@ public:
protected: protected:
void fadeIn(int effect); void fadeIn(int effect);
void fadeOut(int effect); void fadeOut(int effect);
void setScrollBuffer();
void unkScreenEffect6(); void unkScreenEffect6();
void transitionEffect(int a); void transitionEffect(int a);