diff options
-rw-r--r-- | engines/supernova2/graphics.cpp | 36 |
1 files changed, 9 insertions, 27 deletions
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<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 { - 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<byte *>(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<byte *>(surface->getPixels()); + Common::copy(_encodedImage + offset, _encodedImage + offset + width * height, surfacePixels); } return true; |