diff options
author | Joseph-Eugene Winzer | 2017-07-17 10:34:38 +0200 |
---|---|---|
committer | Thierry Crozat | 2018-01-22 23:54:41 +0000 |
commit | a54c9084c1b4e9a18556066e255bb71e33793547 (patch) | |
tree | 9b97259bd08e9ed78d45eb6ecb9f737d7c866988 /engines/supernova | |
parent | 6d655b19fcf00ab93a39221fe5abdcad4b83c5a0 (diff) | |
download | scummvm-rg350-a54c9084c1b4e9a18556066e255bb71e33793547.tar.gz scummvm-rg350-a54c9084c1b4e9a18556066e255bb71e33793547.tar.bz2 scummvm-rg350-a54c9084c1b4e9a18556066e255bb71e33793547.zip |
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.
Diffstat (limited to 'engines/supernova')
-rw-r--r-- | engines/supernova/graphics.cpp | 52 |
1 files changed, 17 insertions, 35 deletions
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); } } |