DM: Fix incorrect thumbnails

This commit is contained in:
Bendegúz Nagy 2016-08-22 19:27:10 +02:00
parent 22a79ac965
commit 2199f879bd
3 changed files with 9 additions and 8 deletions

View file

@ -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'

View file

@ -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);

View file

@ -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