[Scummvm-cvs-logs] SF.net SVN: scummvm: [31461] scummvm/trunk/engines/kyra/screen.cpp
athrxx at users.sourceforge.net
athrxx at users.sourceforge.net
Thu Apr 10 01:38:12 CEST 2008
Revision: 31461
http://scummvm.svn.sourceforge.net/scummvm/?rev=31461&view=rev
Author: athrxx
Date: 2008-04-09 16:38:11 -0700 (Wed, 09 Apr 2008)
Log Message:
-----------
fix drawShape glitch (Brandon's feet got mutilated and one vertical line was not drawn when leaving the screen to the left or to the right )
Modified Paths:
--------------
scummvm/trunk/engines/kyra/screen.cpp
Modified: scummvm/trunk/engines/kyra/screen.cpp
===================================================================
--- scummvm/trunk/engines/kyra/screen.cpp 2008-04-09 15:16:50 UTC (rev 31460)
+++ scummvm/trunk/engines/kyra/screen.cpp 2008-04-09 23:38:11 UTC (rev 31461)
@@ -1406,7 +1406,7 @@
_dsOffscreenRight = 0;
_dsOffscreenScaleVal2 = _dsOffscreenLeft;
_dsOffscreenLeft <<= 8;
- _dsOffscreenScaleVal1 = _dsOffscreenLeft % _dsScaleW;
+ _dsOffscreenScaleVal1 = (_dsOffscreenLeft % _dsScaleW) * -1;
_dsOffscreenLeft /= _dsScaleW;
}
@@ -1482,14 +1482,14 @@
if (src == dst || !cnt)
return _dsOffscreenScaleVal1;
- while (cnt-- > 0) {
+ do {
if (*src++)
continue;
found = true;
cnt = cnt + 1 - (*src++);
- }
+ } while (--cnt > 0);
- if (!found)
+ if (!found || !cnt)
return _dsOffscreenScaleVal1;
_dsTmpWidth += cnt;
@@ -1511,14 +1511,14 @@
if (src == dst || !cnt)
return _dsOffscreenScaleVal1;
- while (cnt-- > 0) {
+ do {
if (*src++)
continue;
found = true;
cnt = cnt + 1 - (*src++);
- }
+ } while (--cnt > 0);
- if (!found)
+ if (!found || !cnt)
return _dsOffscreenScaleVal1;
_dsTmpWidth += cnt;
@@ -1539,11 +1539,11 @@
if (cnt <= 0)
return 0;
- while (cnt-- > 0) {
+ do {
if (*src++)
continue;
cnt = cnt + 1 - (*src++);
- }
+ } while (--cnt > 0);
return 0;
}
@@ -1552,15 +1552,15 @@
cnt = _dsTmpWidth;
bool found = false;
- if (cnt <= 0)
+ if (cnt == 0)
return 0;
- while (cnt-- > 0) {
+ do {
if (*src++)
continue;
found = true;
cnt = cnt + 1 - (*src++);
- }
+ } while (--cnt > 0);
return found ? 0 : _dsOffscreenScaleVal1;
}
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