[Scummvm-cvs-logs] SF.net SVN: scummvm: [23467] scummvm/branches/branch-0-9-0/engines/scumm/costume.cpp
eriktorbjorn at users.sourceforge.net
eriktorbjorn at users.sourceforge.net
Thu Jul 20 22:40:14 CEST 2006
Revision: 23467
http://svn.sourceforge.net/scummvm/?rev=23467&view=rev
Author: eriktorbjorn
Date: 2006-07-09 23:30:50 -0700 (Sun, 09 Jul 2006)
Log Message:
-----------
Backported fix for bug #1519667 ("DOTT: Graphic glitches whle kite comes down")
Modified Paths:
--------------
scummvm/branches/branch-0-9-0/engines/scumm/costume.cpp
Modified: scummvm/branches/branch-0-9-0/engines/scumm/costume.cpp
===================================================================
--- scummvm/branches/branch-0-9-0/engines/scumm/costume.cpp 2006-07-10 06:29:10 UTC (rev 23466)
+++ scummvm/branches/branch-0-9-0/engines/scumm/costume.cpp 2006-07-10 06:30:50 UTC (rev 23467)
@@ -131,6 +131,11 @@
v1.scaleXstep = 1;
}
+ // It's possible that the scale indexes will overflow and wrap
+ // around to zero, so it's important that we use the same
+ // method of accessing it both when calculating the size of the
+ // scaled costume, and when drawing it. See bug #1519667.
+
if (_mirror) {
/* Adjust X position */
startScaleIndexX = _scaleIndexX = scaletableSize - xmoveCur;
@@ -418,7 +423,7 @@
byte len, maskbit;
int y;
uint color, height, pcolor;
- const byte *scaleytab;
+ byte scaleIndexY;
bool masked;
y = v1.y;
@@ -428,7 +433,7 @@
color = v1.repcolor;
height = _height;
- scaleytab = &v1.scaletable[_scaleIndexY];
+ scaleIndexY = _scaleIndexY;
maskbit = revBitMask(v1.x & 7);
mask = v1.mask_ptr + v1.x / 8;
@@ -443,7 +448,7 @@
len = *src++;
do {
- if (_scaleY == 255 || *scaleytab++ < _scaleY) {
+ if (_scaleY == 255 || v1.scaletable[scaleIndexY++] < _scaleY) {
masked = (y < 0 || y >= _out.h) || (v1.mask_ptr && (mask[0] & maskbit));
if (color && !masked) {
@@ -466,7 +471,7 @@
height = _height;
y = v1.y;
- scaleytab = &v1.scaletable[_scaleIndexY];
+ scaleIndexY = _scaleIndexY;
if (_scaleX == 255 || v1.scaletable[_scaleIndexX] < _scaleX) {
v1.x += v1.scaleXstep;
More information about the Scummvm-git-logs
mailing list