From f10135bb76203c9c5289333e33b2756b0259d50a Mon Sep 17 00:00:00 2001 From: Jaromir Wysoglad Date: Wed, 29 May 2019 09:49:15 +0200 Subject: SUPERNOVA2: Remove code for rendering newspapers --- engines/supernova2/graphics.cpp | 36 +++++++++--------------------------- 1 file changed, 9 insertions(+), 27 deletions(-) (limited to 'engines/supernova2') diff --git a/engines/supernova2/graphics.cpp b/engines/supernova2/graphics.cpp index 6f6ee00a33..630fa46ddb 100644 --- a/engines/supernova2/graphics.cpp +++ b/engines/supernova2/graphics.cpp @@ -221,39 +221,21 @@ bool MS2Image::loadStream(Common::SeekableReadStream &stream) { } bool MS2Image::loadSections() { - bool isNewspaper = false; - int imageWidth = isNewspaper ? 640 : 320; - int imageHeight = isNewspaper ? 480 : 200; - _pitch = imageWidth; + _pitch = 320; for (int section = 0; section < _numSections; ++section) { Graphics::Surface *surface = new Graphics::Surface; _sectionSurfaces.push_back(surface); - if (isNewspaper) { - surface->create(imageWidth, imageHeight, g_system->getScreenFormat()); - byte *surfacePixels = static_cast(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 { - uint32 offset = (_section[section].addressHigh << 16) + _section[section].addressLow; - if (offset == kInvalidAddress || _section[section].x2 == 0) { - return false; - } - int width = _section[section].x2 - _section[section].x1 + 1; - int height = _section[section].y2 - _section[section].y1 + 1; - surface->create(width, height, g_system->getScreenFormat()); - byte *surfacePixels = static_cast(surface->getPixels()); - Common::copy(_encodedImage + offset, _encodedImage + offset + width * height, surfacePixels); + uint32 offset = (_section[section].addressHigh << 16) + _section[section].addressLow; + if (offset == kInvalidAddress || _section[section].x2 == 0) { + return false; } + int width = _section[section].x2 - _section[section].x1 + 1; + int height = _section[section].y2 - _section[section].y1 + 1; + surface->create(width, height, g_system->getScreenFormat()); + byte *surfacePixels = static_cast(surface->getPixels()); + Common::copy(_encodedImage + offset, _encodedImage + offset + width * height, surfacePixels); } return true; -- cgit v1.2.3