[Scummvm-cvs-logs] CVS: scummvm/scumm nut_renderer.cpp,1.7,1.8
Max Horn
fingolfin at users.sourceforge.net
Mon Dec 30 05:53:04 CET 2002
Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1:/tmp/cvs-serv3994
Modified Files:
nut_renderer.cpp
Log Message:
small optimization
Index: nut_renderer.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/nut_renderer.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- nut_renderer.cpp 27 Dec 2002 03:56:34 -0000 1.7
+++ nut_renderer.cpp 30 Dec 2002 13:52:16 -0000 1.8
@@ -212,23 +212,26 @@
}
byte * src = (byte*)(_dataSrc + _offsets[c] + 14);
+ byte * dst = _dstPtr + y * _dstPitch + x;
uint32 length = READ_BE_UINT32(_dataSrc + _offsets[c] - 4) - 14;
decodeCodec44(_tmpCodecBuffer, src, length);
+ src = _tmpCodecBuffer;
int32 width = READ_LE_UINT16(_dataSrc + _offsets[c] + 6);
int32 height = READ_LE_UINT16(_dataSrc + _offsets[c] + 8);
for (int32 ty = 0; ty < height; ty++) {
for (int32 tx = 0; tx < width; tx++) {
- byte pixel = *(_tmpCodecBuffer + ty * width + tx);
+ byte pixel = *src++;
if (pixel != 0) {
if (pixel == 0x01)
pixel = (color == 0) ? 0xf : color;
if (pixel == 0xff)
pixel = 0x0;
- *(_dstPtr + ((ty + y) * _dstPitch + x + tx)) = pixel;
+ dst[tx] = pixel;
}
}
+ dst += _dstPitch;
}
}
More information about the Scummvm-git-logs
mailing list