From a54c9084c1b4e9a18556066e255bb71e33793547 Mon Sep 17 00:00:00 2001 From: Joseph-Eugene Winzer Date: Mon, 17 Jul 2017 10:34:38 +0200 Subject: SUPERNOVA: Removes 'inverse section' case This code section was converted from the original source, where the sections are directly drawn to the screen instead of buffered. If a section > 128 is set as parameter, the function takes the dimensions of section - 128 and draws this region of section 0 to the screen, thus restoring it. It would not make sense loading part of section 0 in seperate Surfaces especially since kMaxSection is smaller than 128 the else branch is never entered so removing it doesn't change the programs behavior. --- engines/supernova/graphics.cpp | 52 ++++++++++++++---------------------------- 1 file changed, 17 insertions(+), 35 deletions(-) (limited to 'engines') diff --git a/engines/supernova/graphics.cpp b/engines/supernova/graphics.cpp index ba2f06e39e..1940dd7ef6 100644 --- a/engines/supernova/graphics.cpp +++ b/engines/supernova/graphics.cpp @@ -164,41 +164,23 @@ bool MSNImageDecoder::loadSections() { } } else { uint image = section; - if (image < 128) { - do { - uint32 offset = (_section[image].addressHigh << 16) + _section[image].addressLow; - if (offset == kInvalidAddress || _section[image].x2 == 0) { - return false; - } - int width = _section[image].x2 - _section[image].x1 + 1; - int height = _section[image].y2 - _section[image].y1 + 1; - uint32 destAddress = imageWidth * _section[image].y1 + _section[image].x1; - while (height) { - Common::copy(_encodedImage + offset, _encodedImage + offset + width, surfacePixels + destAddress); - offset += width; - destAddress += imageWidth; - --height; - } - - image = _section[image].next; - } while (image != 0); - } else { - image -= 128; - do { - int width = _section[image].x2 - _section[image].x1 + 1; - int height = _section[image].y2 - _section[image].y1 + 1; - uint32 destAddress = imageWidth * _section[image].y1 + _section[image].x1; - uint32 offset = (_section[image].addressHigh << 16) + _section[image].addressLow + destAddress; - while (height) { - Common::copy(_encodedImage + offset, _encodedImage + offset + width, surfacePixels + destAddress); - offset += imageWidth; - destAddress += imageWidth; - --height; - } - - image = _section[image].next; - } while (image != 0); - } + do { + uint32 offset = (_section[image].addressHigh << 16) + _section[image].addressLow; + if (offset == kInvalidAddress || _section[image].x2 == 0) { + return false; + } + int width = _section[image].x2 - _section[image].x1 + 1; + int height = _section[image].y2 - _section[image].y1 + 1; + uint32 destAddress = imageWidth * _section[image].y1 + _section[image].x1; + while (height) { + Common::copy(_encodedImage + offset, _encodedImage + offset + width, surfacePixels + destAddress); + offset += width; + destAddress += imageWidth; + --height; + } + + image = _section[image].next; + } while (image != 0); } } -- cgit v1.2.3