aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTorbjörn Andersson2006-08-28 04:53:21 +0000
committerTorbjörn Andersson2006-08-28 04:53:21 +0000
commit49d1056c300c6afb1591492f350a42563e3647be (patch)
tree4a5ab3f0a65af50aa9203e96e6097310dfd2e9ff
parentd11e72a168f68d33fce1c3f4ed0b10845c90b285 (diff)
downloadscummvm-rg350-49d1056c300c6afb1591492f350a42563e3647be.tar.gz
scummvm-rg350-49d1056c300c6afb1591492f350a42563e3647be.tar.bz2
scummvm-rg350-49d1056c300c6afb1591492f350a42563e3647be.zip
Only clear the part of the screen usually controlled by the Screen class. The
buffer might not be large enough to cover the menu areas, and they will probably be clear already. Only terminate the loop, not the entire function, when pressing Esc during a cutscene. Otherwise, there may be palette glitches. svn-id: r23790
-rw-r--r--engines/sword1/animation.cpp5
-rw-r--r--engines/sword1/screen.cpp4
2 files changed, 6 insertions, 3 deletions
diff --git a/engines/sword1/animation.cpp b/engines/sword1/animation.cpp
index 43de05b155..9d196d39be 100644
--- a/engines/sword1/animation.cpp
+++ b/engines/sword1/animation.cpp
@@ -191,7 +191,8 @@ void MoviePlayer::play(void) {
_snd->playInputStream(Audio::Mixer::kSFXSoundType, &_bgSoundHandle, _bgSoundStream);
}
_currentFrame = 0;
- while (decodeFrame()) {
+ bool terminated = false;
+ while (!terminated && decodeFrame()) {
processFrame();
syncFrame();
updateScreen();
@@ -205,7 +206,7 @@ void MoviePlayer::play(void) {
case OSystem::EVENT_KEYDOWN:
if (event.kbd.keycode == 27) {
_snd->stopHandle(_bgSoundHandle);
- return;
+ terminated = true;
}
break;
case OSystem::EVENT_QUIT:
diff --git a/engines/sword1/screen.cpp b/engines/sword1/screen.cpp
index 57a9b6137c..ba04d03d84 100644
--- a/engines/sword1/screen.cpp
+++ b/engines/sword1/screen.cpp
@@ -68,7 +68,9 @@ void Screen::clearScreen(void) {
if (_screenBuf) {
_fullRefresh = true;
memset(_screenBuf, 0, _scrnSizeX * _scrnSizeY);
- _system->copyRectToScreen(_screenBuf, 640, 0, 0, 640, 480);
+ // The buffer isn't necessarily big enough to clear the entire
+ // screen, so the menu areas are unaffected. For now.
+ _system->copyRectToScreen(_screenBuf, SCREEN_WIDTH, 0, 40, SCREEN_WIDTH, SCREEN_DEPTH);
}
}