aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorBendegúz Nagy2016-08-22 19:27:10 +0200
committerBendegúz Nagy2016-08-26 23:02:22 +0200
commit2199f879bdcd27806e304782423e2b3e838d6bbc (patch)
tree26baf467d2261921eb2e74a8934485af59f6e1d4 /engines
parent22a79ac9652a42b0ff08791ebd69b047db170cb5 (diff)
downloadscummvm-rg350-2199f879bdcd27806e304782423e2b3e838d6bbc.tar.gz
scummvm-rg350-2199f879bdcd27806e304782423e2b3e838d6bbc.tar.bz2
scummvm-rg350-2199f879bdcd27806e304782423e2b3e838d6bbc.zip
DM: Fix incorrect thumbnails
Diffstat (limited to 'engines')
-rw-r--r--engines/dm/TODOs/todo.txt1
-rw-r--r--engines/dm/eventman.cpp9
-rw-r--r--engines/dm/inventory.cpp7
3 files changed, 9 insertions, 8 deletions
diff --git a/engines/dm/TODOs/todo.txt b/engines/dm/TODOs/todo.txt
index 4bd2d8a970..4d4fef17c9 100644
--- a/engines/dm/TODOs/todo.txt
+++ b/engines/dm/TODOs/todo.txt
@@ -16,6 +16,5 @@ Todo:
Code stuff todo:
Complete stub methods(blitShrink, blitmask, scroller)
Add proper save header, add error handling to it
- Fix incorrect thumbnail
Add translations to f433_processCommand140_saveGame 'LOAD'
\ No newline at end of file
diff --git a/engines/dm/eventman.cpp b/engines/dm/eventman.cpp
index a3677b082c..8ad7971fe2 100644
--- a/engines/dm/eventman.cpp
+++ b/engines/dm/eventman.cpp
@@ -40,6 +40,7 @@
#include "group.h"
#include "dialog.h"
#include "sounds.h"
+#include <mortevielle/saveload.h>
namespace DM {
@@ -769,6 +770,14 @@ void EventManager::f380_processCommandQueue() {
}
if ((cmdType >= k7_CommandToggleInventoryChampion_0) && (cmdType <= k11_CommandCloseInventory)) {
+ if (cmdType == k11_CommandCloseInventory) {
+ delete _vm->_saveThumbnail;
+ _vm->_saveThumbnail = nullptr;
+ } else if (!_vm->_saveThumbnail) {
+ _vm->_saveThumbnail = new Common::MemoryWriteStreamDynamic();
+ Graphics::saveThumbnail(*_vm->_saveThumbnail);
+ }
+
int16 championIndex = cmdType - k7_CommandToggleInventoryChampion_0;
if (((championIndex == k4_ChampionCloseInventory) || (championIndex < _vm->_championMan->_g305_partyChampionCount)) && !_vm->_championMan->_g299_candidateChampionOrdinal)
_vm->_inventoryMan->f355_toggleInventory((ChampionIndex)championIndex);
diff --git a/engines/dm/inventory.cpp b/engines/dm/inventory.cpp
index ed1a014c82..5e2ccaa513 100644
--- a/engines/dm/inventory.cpp
+++ b/engines/dm/inventory.cpp
@@ -86,13 +86,6 @@ InventoryMan::InventoryMan(DMEngine *vm) : _vm(vm) {
void InventoryMan::f355_toggleInventory(ChampionIndex championIndex) {
static Box g41_BoxFloppyZzzCross(174, 218, 2, 12); // @ G0041_s_Graphic562_Box_ViewportFloppyZzzCross
- if (championIndex == kM1_ChampionNone) {
- delete _vm->_saveThumbnail;
- _vm->_saveThumbnail = nullptr;
- } else if (!_vm->_saveThumbnail) {
- _vm->_saveThumbnail = new Common::MemoryWriteStreamDynamic();
- Graphics::saveThumbnail(*_vm->_saveThumbnail);
- }
uint16 L1102_ui_Multiple;
#define AL1102_ui_InventoryChampionOrdinal L1102_ui_Multiple