aboutsummaryrefslogtreecommitdiff
path: root/engines/supernova2
diff options
context:
space:
mode:
authorJaromir Wysoglad2019-05-29 09:49:15 +0200
committerThierry Crozat2019-07-28 15:09:14 +0100
commitf10135bb76203c9c5289333e33b2756b0259d50a (patch)
treee2c915db3a2b67a08b8f507989f7f6ab0edde0a2 /engines/supernova2
parent4b12c8d17b3df2780c255b957f7035ccb1274071 (diff)
downloadscummvm-rg350-f10135bb76203c9c5289333e33b2756b0259d50a.tar.gz
scummvm-rg350-f10135bb76203c9c5289333e33b2756b0259d50a.tar.bz2
scummvm-rg350-f10135bb76203c9c5289333e33b2756b0259d50a.zip
SUPERNOVA2: Remove code for rendering newspapers
Diffstat (limited to 'engines/supernova2')
-rw-r--r--engines/supernova2/graphics.cpp36
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;