diff options
author | Max Horn | 2002-12-30 13:52:16 +0000 |
---|---|---|
committer | Max Horn | 2002-12-30 13:52:16 +0000 |
commit | 85fe4018bc11b523e0135bcded40ed3ca41c33e7 (patch) | |
tree | f8bfadf71a748e47c1abf02468c312dccf679ce9 | |
parent | f5b8b9adcf837874a0109c685a4bb09978677f13 (diff) | |
download | scummvm-rg350-85fe4018bc11b523e0135bcded40ed3ca41c33e7.tar.gz scummvm-rg350-85fe4018bc11b523e0135bcded40ed3ca41c33e7.tar.bz2 scummvm-rg350-85fe4018bc11b523e0135bcded40ed3ca41c33e7.zip |
small optimization
svn-id: r6276
-rw-r--r-- | scumm/nut_renderer.cpp | 7 |
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; } } |