From 3fa3a7197a031f82079ff48aa2df3d1433c5d3d1 Mon Sep 17 00:00:00 2001 From: Torbjörn Andersson Date: Sun, 27 Sep 2015 17:05:16 +0200 Subject: SHERLOCK: Remove unnecessary indentation level --- engines/sherlock/image_file.cpp | 94 ++++++++++++++++++++--------------------- 1 file changed, 46 insertions(+), 48 deletions(-) (limited to 'engines') diff --git a/engines/sherlock/image_file.cpp b/engines/sherlock/image_file.cpp index 3d881eb655..1a1f295c5c 100644 --- a/engines/sherlock/image_file.cpp +++ b/engines/sherlock/image_file.cpp @@ -961,59 +961,57 @@ void ImageFile3DO::loadFont(Common::SeekableReadStream &stream) { for (curChar = 33; curChar < header_charCount; curChar++) { // create frame - { - ImageFrame imageFrame; - - imageFrame._width = widthTablePtr[curChar]; - imageFrame._height = header_fontHeight; - imageFrame._paletteBase = 0; - imageFrame._offset.x = 0; - imageFrame._offset.y = 0; - imageFrame._rleEncoded = false; - imageFrame._size = 0; - - // Extract pixels - imageFrame._frame.create(imageFrame._width, imageFrame._height, Graphics::PixelFormat(2, 5, 6, 5, 0, 11, 5, 0, 0)); - uint16 *dest = (uint16 *)imageFrame._frame.getPixels(); - Common::fill(dest, dest + imageFrame._width * imageFrame._height, 0); - - curCharHeightLeft = header_fontHeight; - while (curCharHeightLeft) { - curCharWidthLeft = widthTablePtr[curChar]; - curBitsPtr = curBitsLinePtr; - curBitsLeft = 8; - curPosX = 0; - - while (curCharWidthLeft) { - if (!(curPosX & 1)) { - curBits = *curBitsPtr >> 4; - } else { - curBits = *curBitsPtr & 0x0F; - curBitsPtr++; - } - // doing this properly is complicated - // the 3DO has built-in anti-aliasing - // this here at least results in somewhat readable text - // TODO: make it better - if (curBits) { - curBitsReversed = (curBits >> 3) | ((curBits & 0x04) >> 1) | ((curBits & 0x02) << 1) | ((curBits & 0x01) << 3); - curBits = 20 - curBits; - } - - byte curIntensity = curBits; - *dest = (curIntensity << 11) | (curIntensity << 6) | curIntensity; - dest++; - - curCharWidthLeft--; - curPosX++; + ImageFrame imageFrame; + + imageFrame._width = widthTablePtr[curChar]; + imageFrame._height = header_fontHeight; + imageFrame._paletteBase = 0; + imageFrame._offset.x = 0; + imageFrame._offset.y = 0; + imageFrame._rleEncoded = false; + imageFrame._size = 0; + + // Extract pixels + imageFrame._frame.create(imageFrame._width, imageFrame._height, Graphics::PixelFormat(2, 5, 6, 5, 0, 11, 5, 0, 0)); + uint16 *dest = (uint16 *)imageFrame._frame.getPixels(); + Common::fill(dest, dest + imageFrame._width * imageFrame._height, 0); + + curCharHeightLeft = header_fontHeight; + while (curCharHeightLeft) { + curCharWidthLeft = widthTablePtr[curChar]; + curBitsPtr = curBitsLinePtr; + curBitsLeft = 8; + curPosX = 0; + + while (curCharWidthLeft) { + if (!(curPosX & 1)) { + curBits = *curBitsPtr >> 4; + } else { + curBits = *curBitsPtr & 0x0F; + curBitsPtr++; } + // doing this properly is complicated + // the 3DO has built-in anti-aliasing + // this here at least results in somewhat readable text + // TODO: make it better + if (curBits) { + curBitsReversed = (curBits >> 3) | ((curBits & 0x04) >> 1) | ((curBits & 0x02) << 1) | ((curBits & 0x01) << 3); + curBits = 20 - curBits; + } + + byte curIntensity = curBits; + *dest = (curIntensity << 11) | (curIntensity << 6) | curIntensity; + dest++; - curCharHeightLeft--; - curBitsLinePtr += header_bytesPerLine; + curCharWidthLeft--; + curPosX++; } - push_back(imageFrame); + curCharHeightLeft--; + curBitsLinePtr += header_bytesPerLine; } + + push_back(imageFrame); } // Warning below being used to silence unused variable warnings for now -- cgit v1.2.3