aboutsummaryrefslogtreecommitdiff
path: root/scumm/nut_renderer.cpp
diff options
context:
space:
mode:
authorMax Horn2002-12-30 13:52:16 +0000
committerMax Horn2002-12-30 13:52:16 +0000
commit85fe4018bc11b523e0135bcded40ed3ca41c33e7 (patch)
treef8bfadf71a748e47c1abf02468c312dccf679ce9 /scumm/nut_renderer.cpp
parentf5b8b9adcf837874a0109c685a4bb09978677f13 (diff)
downloadscummvm-rg350-85fe4018bc11b523e0135bcded40ed3ca41c33e7.tar.gz
scummvm-rg350-85fe4018bc11b523e0135bcded40ed3ca41c33e7.tar.bz2
scummvm-rg350-85fe4018bc11b523e0135bcded40ed3ca41c33e7.zip
small optimization
svn-id: r6276
Diffstat (limited to 'scumm/nut_renderer.cpp')
-rw-r--r--scumm/nut_renderer.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/scumm/nut_renderer.cpp b/scumm/nut_renderer.cpp
index 8431fcd3ba..a1ca27638d 100644
--- a/scumm/nut_renderer.cpp
+++ b/scumm/nut_renderer.cpp
@@ -212,23 +212,26 @@ void NutRenderer::drawChar(char c, int32 x, int32 y, byte color) {
}
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;
}
}