aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTravis Howell2009-05-04 02:05:28 +0000
committerTravis Howell2009-05-04 02:05:28 +0000
commit1ce07f5e88bbde55e90b74e419e57976198805d0 (patch)
tree07e790598ad2849fdf7d75d05706ebba97c5d508
parenta41069d69b7381981dc79ed1bb141865da10e452 (diff)
downloadscummvm-rg350-1ce07f5e88bbde55e90b74e419e57976198805d0.tar.gz
scummvm-rg350-1ce07f5e88bbde55e90b74e419e57976198805d0.tar.bz2
scummvm-rg350-1ce07f5e88bbde55e90b74e419e57976198805d0.zip
Add code different for PN in vc32_saveScreen(), to fix crashes.
svn-id: r40296
-rw-r--r--engines/agos/vga.cpp31
1 files changed, 20 insertions, 11 deletions
diff --git a/engines/agos/vga.cpp b/engines/agos/vga.cpp
index a77555ba02..eea53b9864 100644
--- a/engines/agos/vga.cpp
+++ b/engines/agos/vga.cpp
@@ -1180,19 +1180,28 @@ void AGOSEngine::vc31_setWindow() {
}
void AGOSEngine::vc32_saveScreen() {
- uint xoffs = _videoWindows[4 * 4 + 0] * 16;
- uint yoffs = _videoWindows[4 * 4 + 1];
- uint width = _videoWindows[4 * 4 + 2] * 16;
- uint height = _videoWindows[4 * 4 + 3];
+ if (getGameType() == GType_PN) {
+ Graphics::Surface *screen = _system->lockScreen();
- byte *dst = getBackGround() + xoffs + yoffs * _screenWidth;
- byte *src = _window4BackScn;
- uint srcWidth = _videoWindows[4 * 4 + 2] * 16;
+ byte *dst = getBackGround();
+ byte *src = (byte *)screen->pixels;
+ memcpy(dst, src, 64000);
- for (; height > 0; height--) {
- memcpy(dst, src, width);
- dst += _screenWidth;
- src += srcWidth;
+ _system->unlockScreen();
+ } else {
+ uint16 xoffs = _videoWindows[4 * 4 + 0] * 16;
+ uint16 yoffs = _videoWindows[4 * 4 + 1];
+ uint16 width = _videoWindows[4 * 4 + 2] * 16;
+ uint16 height = _videoWindows[4 * 4 + 3];
+
+ byte *dst = getBackGround() + xoffs + yoffs * _screenWidth;
+ byte *src = _window4BackScn;
+ uint16 srcWidth = _videoWindows[4 * 4 + 2] * 16;
+ for (; height > 0; height--) {
+ memcpy(dst, src, width);
+ dst += _screenWidth;
+ src += srcWidth;
+ }
}
}