From 85fe4018bc11b523e0135bcded40ed3ca41c33e7 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Mon, 30 Dec 2002 13:52:16 +0000 Subject: small optimization svn-id: r6276 --- scumm/nut_renderer.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'scumm/nut_renderer.cpp') 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; } } -- cgit v1.2.3