aboutsummaryrefslogtreecommitdiff
path: root/engines/supernova/supernova.cpp
diff options
context:
space:
mode:
authorThierry Crozat2017-11-05 02:59:22 +0000
committerThierry Crozat2018-01-23 02:15:37 +0000
commit841e7182f28471ffda0ecd0c692649f58fd3aea8 (patch)
tree74ef3b95878b69b82fb1aa90eab3f018c1906c87 /engines/supernova/supernova.cpp
parent73278c3f9f0157e1adf19134eceeb65eec3e37eb (diff)
downloadscummvm-rg350-841e7182f28471ffda0ecd0c692649f58fd3aea8.tar.gz
scummvm-rg350-841e7182f28471ffda0ecd0c692649f58fd3aea8.tar.bz2
scummvm-rg350-841e7182f28471ffda0ecd0c692649f58fd3aea8.zip
SUPERNOVA: Reduce memory usage to store sections and simplify code
Each section was store dusing the full image size. Now it only uses the section size, which should reduce considerably the amout of memory used for each image. Also when a section has one or more next section, they were all drawn on the surface for this section, but then they were drawn again on their own surface. And while this should not cause any issue, this was really unnecessary (and prevented optimizing the surface size for each section). So now this is no longer the case and the surface for a section only contains this section.
Diffstat (limited to 'engines/supernova/supernova.cpp')
-rw-r--r--engines/supernova/supernova.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/engines/supernova/supernova.cpp b/engines/supernova/supernova.cpp
index 6dda5657ff..291e18d964 100644
--- a/engines/supernova/supernova.cpp
+++ b/engines/supernova/supernova.cpp
@@ -425,12 +425,14 @@ void SupernovaEngine::renderImage(MSNImageDecoder &image, int section) {
}
}
- uint offset = image._section[section].y1 * image._pitch + image._section[section].x1;
- if (invert)
+ uint offset = 0;
+ if (invert) {
+ offset = image._section[section].y1 * image._pitch + image._section[section].x1;
section = 0;
+ }
_system->copyRectToScreen(static_cast<const byte *>(image._sectionSurfaces[section]->getPixels()) + offset,
- image._pitch,
+ sectionRect.width(),
sectionRect.left, sectionRect.top,
sectionRect.width(), sectionRect.height());
}