aboutsummaryrefslogtreecommitdiff
path: root/engines/cryomni3d/versailles/documentation.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/cryomni3d/versailles/documentation.cpp')
-rw-r--r--engines/cryomni3d/versailles/documentation.cpp34
1 files changed, 22 insertions, 12 deletions
diff --git a/engines/cryomni3d/versailles/documentation.cpp b/engines/cryomni3d/versailles/documentation.cpp
index c0acbc874f..a33e992962 100644
--- a/engines/cryomni3d/versailles/documentation.cpp
+++ b/engines/cryomni3d/versailles/documentation.cpp
@@ -280,6 +280,12 @@ Common::String Versailles_Documentation::docAreaHandleSummary() {
Image::BitmapDecoder bmpDecoder;
Common::File file;
+ Image::ImageDecoder *imageDecoder = _engine->loadHLZ("SOM1.HLZ");
+ if (!imageDecoder) {
+ return "";
+ }
+ const Graphics::Surface *bgFrame = imageDecoder->getSurface();
+
for (uint i = 0; i < ARRAYSIZE(categories); i++) {
if (!categories[i].bmp) {
// No BMP to load
@@ -296,12 +302,6 @@ Common::String Versailles_Documentation::docAreaHandleSummary() {
file.close();
}
- Image::ImageDecoder *imageDecoder = _engine->loadHLZ("SOM1.HLZ");
- if (!imageDecoder) {
- return "";
- }
- const Graphics::Surface *bgFrame = imageDecoder->getSurface();
-
Graphics::ManagedSurface docSurface;
docSurface.create(bgFrame->w, bgFrame->h, bgFrame->format);
docSurface.blitFrom(*bgFrame);
@@ -411,6 +411,10 @@ Common::String Versailles_Documentation::docAreaHandleSummary() {
_engine->showMouse(false);
+ for (uint i = 0; i < ARRAYSIZE(categories); i++) {
+ categories[i].highlightedImg.free();
+ }
+
delete imageDecoder;
if (selectedBox == 7) {
@@ -906,6 +910,12 @@ Common::String Versailles_Documentation::docAreaHandleGeneralMap() {
Image::BitmapDecoder bmpDecoder;
Common::File file;
+ Image::ImageDecoder *imageDecoder = _engine->loadHLZ("PLANGR.HLZ");
+ if (!imageDecoder) {
+ return "";
+ }
+ const Graphics::Surface *bgFrame = imageDecoder->getSurface();
+
for (uint i = 0; i < ARRAYSIZE(areas); i++) {
if (areas[i].bmp) {
if (!file.open(areas[i].bmp)) {
@@ -938,12 +948,6 @@ Common::String Versailles_Documentation::docAreaHandleGeneralMap() {
boxes.setupBox(ARRAYSIZE(areas), 639 - _sprites->getCursor(105).getWidth(),
479 - _sprites->getCursor(105).getHeight(), 640, 480);
- Image::ImageDecoder *imageDecoder = _engine->loadHLZ("PLANGR.HLZ");
- if (!imageDecoder) {
- return "";
- }
- const Graphics::Surface *bgFrame = imageDecoder->getSurface();
-
Graphics::ManagedSurface mapSurface;
mapSurface.create(bgFrame->w, bgFrame->h, bgFrame->format);
mapSurface.blitFrom(*bgFrame);
@@ -1052,6 +1056,10 @@ Common::String Versailles_Documentation::docAreaHandleGeneralMap() {
_engine->showMouse(false);
+ for (uint i = 0; i < ARRAYSIZE(areas); i++) {
+ areas[i].highlightedImg.free();
+ }
+
delete imageDecoder;
if (selectedBox == ARRAYSIZE(areas)) {
@@ -1538,6 +1546,8 @@ void Versailles_Documentation::drawRecordData(Graphics::ManagedSurface &surface,
_fontManager->setupBlock(blockCaption);
_fontManager->displayBlockText(caption);
+
+ delete imageDecoder;
}
void Versailles_Documentation::setupRecordBoxes(bool inDocArea, MouseBoxes &boxes) {