diff options
author | Jaromir Wysoglad | 2019-06-24 10:54:22 +0200 |
---|---|---|
committer | Thierry Crozat | 2019-07-28 15:09:14 +0100 |
commit | 714a4f909ba014f3f65ac278cead70d846ff7dc9 (patch) | |
tree | 1f42d69a830fb2eaa6f37514d1813c24764d58e3 /engines | |
parent | ab4af5c61483c90d4ee9479a2e2ed4130a2cd90e (diff) | |
download | scummvm-rg350-714a4f909ba014f3f65ac278cead70d846ff7dc9.tar.gz scummvm-rg350-714a4f909ba014f3f65ac278cead70d846ff7dc9.tar.bz2 scummvm-rg350-714a4f909ba014f3f65ac278cead70d846ff7dc9.zip |
SUPERNOVA: Refactor graphics
Diffstat (limited to 'engines')
-rw-r--r-- | engines/supernova/graphics.cpp | 32 |
1 files changed, 10 insertions, 22 deletions
diff --git a/engines/supernova/graphics.cpp b/engines/supernova/graphics.cpp index a317672183..af3a1b30ad 100644 --- a/engines/supernova/graphics.cpp +++ b/engines/supernova/graphics.cpp @@ -258,31 +258,19 @@ bool MSNImage::loadSections() { Graphics::Surface *surface = new Graphics::Surface; _sectionSurfaces.push_back(surface); - if (isNewspaper) { + if (isNewspaper || isCypheredText) { + Color color1 = isNewspaper ? kColorWhite63 : kColorWhite44; surface->create(imageWidth, imageHeight, g_system->getScreenFormat()); byte *surfacePixels = static_cast<byte *>(surface->getPixels()); for (int i = 0; i < imageWidth * imageHeight / 8; ++i) { - *surfacePixels++ = (_encodedImage[i] & 0x80) ? kColorWhite63 : kColorBlack; - *surfacePixels++ = (_encodedImage[i] & 0x40) ? kColorWhite63 : kColorBlack; - *surfacePixels++ = (_encodedImage[i] & 0x20) ? kColorWhite63 : kColorBlack; - *surfacePixels++ = (_encodedImage[i] & 0x10) ? kColorWhite63 : kColorBlack; - *surfacePixels++ = (_encodedImage[i] & 0x08) ? kColorWhite63 : kColorBlack; - *surfacePixels++ = (_encodedImage[i] & 0x04) ? kColorWhite63 : kColorBlack; - *surfacePixels++ = (_encodedImage[i] & 0x02) ? kColorWhite63 : kColorBlack; - *surfacePixels++ = (_encodedImage[i] & 0x01) ? kColorWhite63 : kColorBlack; - } - } else if (isCypheredText) { - surface->create(imageWidth, imageHeight, g_system->getScreenFormat()); - byte *surfacePixels = static_cast<byte *>(surface->getPixels()); - for (int i = 0; i < imageWidth * imageHeight / 8; ++i) { - *surfacePixels++ = (_encodedImage[i] & 0x80) ? kColorWhite44 : kColorBlack; - *surfacePixels++ = (_encodedImage[i] & 0x40) ? kColorWhite44 : kColorBlack; - *surfacePixels++ = (_encodedImage[i] & 0x20) ? kColorWhite44 : kColorBlack; - *surfacePixels++ = (_encodedImage[i] & 0x10) ? kColorWhite44 : kColorBlack; - *surfacePixels++ = (_encodedImage[i] & 0x08) ? kColorWhite44 : kColorBlack; - *surfacePixels++ = (_encodedImage[i] & 0x04) ? kColorWhite44 : kColorBlack; - *surfacePixels++ = (_encodedImage[i] & 0x02) ? kColorWhite44 : kColorBlack; - *surfacePixels++ = (_encodedImage[i] & 0x01) ? kColorWhite44 : kColorBlack; + *surfacePixels++ = (_encodedImage[i] & 0x80) ? color1 : kColorBlack; + *surfacePixels++ = (_encodedImage[i] & 0x40) ? color1 : kColorBlack; + *surfacePixels++ = (_encodedImage[i] & 0x20) ? color1 : kColorBlack; + *surfacePixels++ = (_encodedImage[i] & 0x10) ? color1 : kColorBlack; + *surfacePixels++ = (_encodedImage[i] & 0x08) ? color1 : kColorBlack; + *surfacePixels++ = (_encodedImage[i] & 0x04) ? color1 : kColorBlack; + *surfacePixels++ = (_encodedImage[i] & 0x02) ? color1 : kColorBlack; + *surfacePixels++ = (_encodedImage[i] & 0x01) ? color1 : kColorBlack; } } else { uint32 offset = (_section[section].addressHigh << 16) + _section[section].addressLow; |