[Scummvm-cvs-logs] SF.net SVN: scummvm:[53453] scummvm/trunk/engines/toon/anim.cpp
sylvaintv at users.sourceforge.net
sylvaintv at users.sourceforge.net
Thu Oct 14 02:03:54 CEST 2010
Revision: 53453
http://scummvm.svn.sourceforge.net/scummvm/?rev=53453&view=rev
Author: sylvaintv
Date: 2010-10-14 00:03:53 +0000 (Thu, 14 Oct 2010)
Log Message:
-----------
TOON: Fixed Bug #3084725 with cursor disappearing at screen borders
Bug #3084725: "TOON: Glitch in cursor anim"
Modified Paths:
--------------
scummvm/trunk/engines/toon/anim.cpp
Modified: scummvm/trunk/engines/toon/anim.cpp
===================================================================
--- scummvm/trunk/engines/toon/anim.cpp 2010-10-13 22:23:09 UTC (rev 53452)
+++ scummvm/trunk/engines/toon/anim.cpp 2010-10-14 00:03:53 UTC (rev 53453)
@@ -140,10 +140,27 @@
int32 rectX = _frames[frame]._x2 - _frames[frame]._x1;
int32 rectY = _frames[frame]._y2 - _frames[frame]._y1;
+ int32 offsX = 0;
+ int32 offsY = 0;
- if ((xx + _x1 + _frames[frame]._x1 < 0) || (yy + _y1 + _frames[frame]._y1 < 0))
+ if (xx + _x1 + _frames[frame]._x1 < 0) {
+ offsX = -(xx + _x1 + _frames[frame]._x1);
+ }
+
+ if (offsX >= rectX)
return;
+ else
+ rectX -= offsX;
+ if (yy + _y1 + _frames[frame]._y1 < 0) {
+ offsY = -(yy + _y1 + _frames[frame]._y1);
+ }
+
+ if (offsY >= rectY)
+ return;
+ else
+ rectY -= offsY;
+
if (rectX + xx + _x1 + _frames[frame]._x1 >= surface.w)
rectX = surface.w - xx - _x1 - _frames[frame]._x1;
@@ -157,8 +174,8 @@
return;
int32 destPitch = surface.pitch;
- uint8 *srcRow = _frames[frame]._data;
- uint8 *curRow = (uint8 *)surface.pixels + (yy + _frames[frame]._y1 + _y1) * destPitch + (xx + _x1 + _frames[frame]._x1);
+ uint8 *srcRow = _frames[frame]._data + offsX + (_frames[frame]._x2 - _frames[frame]._x1) * offsY;
+ uint8 *curRow = (uint8 *)surface.pixels + (yy + _frames[frame]._y1 + _y1 + offsY) * destPitch + (xx + _x1 + _frames[frame]._x1 + offsX);
for (int32 y = 0; y < rectY; y++) {
uint8 *cur = curRow;
uint8 *c = srcRow + y * (_frames[frame]._x2 - _frames[frame]._x1);
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