aboutsummaryrefslogtreecommitdiff
path: root/engines/pegasus/graphics.cpp
diff options
context:
space:
mode:
authorMatthew Hoops2011-10-19 14:55:48 -0400
committerMatthew Hoops2011-10-19 14:55:48 -0400
commit422ff6c4c11bf09cfaa557c146b2f2d869c2cc3e (patch)
tree7dbf6ebc92da8c5cc8daec3f43da57e5c54c87ea /engines/pegasus/graphics.cpp
parent4af1fe25af35ccd484e3ff4650cad74cf903e30b (diff)
downloadscummvm-rg350-422ff6c4c11bf09cfaa557c146b2f2d869c2cc3e.tar.gz
scummvm-rg350-422ff6c4c11bf09cfaa557c146b2f2d869c2cc3e.tar.bz2
scummvm-rg350-422ff6c4c11bf09cfaa557c146b2f2d869c2cc3e.zip
PEGASUS: Don't use the work area for screen shaking
It may have stuff purposely not drawn on it
Diffstat (limited to 'engines/pegasus/graphics.cpp')
-rw-r--r--engines/pegasus/graphics.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/engines/pegasus/graphics.cpp b/engines/pegasus/graphics.cpp
index 74e2aed9c4..cc6dcf04a8 100644
--- a/engines/pegasus/graphics.cpp
+++ b/engines/pegasus/graphics.cpp
@@ -258,6 +258,12 @@ void GraphicsManager::shakeTheWorld(TimeValue duration, TimeScale scale) {
Common::Point lastOffset(0, 0);
+ // Store the current screen for later use
+ Graphics::Surface oldScreen;
+ Graphics::Surface *curScreen = g_system->lockScreen();
+ oldScreen.copyFrom(*curScreen);
+ g_system->unlockScreen();
+
// Convert to millis
duration = duration * 1000 / scale;
@@ -297,7 +303,7 @@ void GraphicsManager::shakeTheWorld(TimeValue duration, TimeScale scale) {
}
// Now copy to the screen
- g_system->copyRectToScreen((byte *)_workArea.getBasePtr(srcOffsetX, srcOffsetY), _workArea.pitch,
+ g_system->copyRectToScreen((byte *)oldScreen.getBasePtr(srcOffsetX, srcOffsetY), oldScreen.pitch,
dstOffsetX, dstOffsetY, width, height);
g_system->updateScreen();
@@ -308,9 +314,11 @@ void GraphicsManager::shakeTheWorld(TimeValue duration, TimeScale scale) {
}
if (lastOffset.x != 0 || lastOffset.y != 0) {
- g_system->copyRectToScreen((byte *)_workArea.pixels, _workArea.pitch, 0, 0, 640, 480);
+ g_system->copyRectToScreen((byte *)oldScreen.pixels, oldScreen.pitch, 0, 0, 640, 480);
g_system->updateScreen();
}
+
+ oldScreen.free();
}
} // End of namespace Pegasus