mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-11 21:55:27 +00:00
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.
This commit is contained in:
parent
6d655b19fc
commit
a54c9084c1
@ -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;
|
||||
}
|
||||
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);
|
||||
}
|
||||
image = _section[image].next;
|
||||
} while (image != 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user