[Scummvm-cvs-logs] SF.net SVN: scummvm:[40296] scummvm/trunk/engines/agos/vga.cpp
Kirben at users.sourceforge.net
Kirben at users.sourceforge.net
Mon May 4 04:05:28 CEST 2009
Revision: 40296
http://scummvm.svn.sourceforge.net/scummvm/?rev=40296&view=rev
Author: Kirben
Date: 2009-05-04 02:05:28 +0000 (Mon, 04 May 2009)
Log Message:
-----------
Add code different for PN in vc32_saveScreen(), to fix crashes.
Modified Paths:
--------------
scummvm/trunk/engines/agos/vga.cpp
Modified: scummvm/trunk/engines/agos/vga.cpp
===================================================================
--- scummvm/trunk/engines/agos/vga.cpp 2009-05-03 22:47:04 UTC (rev 40295)
+++ scummvm/trunk/engines/agos/vga.cpp 2009-05-04 02:05:28 UTC (rev 40296)
@@ -1180,19 +1180,28 @@
}
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;
+ }
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list