[Scummvm-cvs-logs] SF.net SVN: scummvm:[40593] scummvm/trunk/engines/cruise/backgroundIncrust. cpp
dreammaster at users.sourceforge.net
dreammaster at users.sourceforge.net
Fri May 15 08:36:44 CEST 2009
Revision: 40593
http://scummvm.svn.sourceforge.net/scummvm/?rev=40593&view=rev
Author: dreammaster
Date: 2009-05-15 06:36:44 +0000 (Fri, 15 May 2009)
Log Message:
-----------
Bugfix to prevent off-screen areas from being restored by restoreBackground
Modified Paths:
--------------
scummvm/trunk/engines/cruise/backgroundIncrust.cpp
Modified: scummvm/trunk/engines/cruise/backgroundIncrust.cpp
===================================================================
--- scummvm/trunk/engines/cruise/backgroundIncrust.cpp 2009-05-15 06:29:08 UTC (rev 40592)
+++ scummvm/trunk/engines/cruise/backgroundIncrust.cpp 2009-05-15 06:36:44 UTC (rev 40593)
@@ -78,7 +78,11 @@
for (int i = 0; i < height; i++) {
for (int j = 0; j < width; j++) {
- pBackground[(i+Y)* 320 + j + X] = pIncrust->ptr[i * width + j];
+ int xp = j + X;
+ int yp = i + Y;
+
+ if ((xp >= 0) && (yp >= 0) && (xp < 320) && (yp < 200))
+ pBackground[yp * 320 + xp] = pIncrust->ptr[i * width + j];
}
}
}
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