mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-12 20:17:49 +00:00
Improved version of patch to fix bug #1722153: "FT: Error on loading a game saved during a dialogue"
svn-id: r26987
This commit is contained in:
parent
45e8fbe8f5
commit
bd67214c96
@ -1311,6 +1311,20 @@ void CharsetRenderer::translateColor() {
|
||||
}
|
||||
}
|
||||
|
||||
void CharsetRenderer::saveLoadWithSerializer(Serializer *ser) {
|
||||
static const SaveLoadEntry charsetRendererEntries[] = {
|
||||
MKLINE(CharsetRenderer, _curId, sleByte, VER(73)),
|
||||
MKLINE(CharsetRenderer, _color, sleByte, VER(73)),
|
||||
MKEND()
|
||||
};
|
||||
|
||||
ser->saveLoadEntries(this, charsetRendererEntries);
|
||||
|
||||
if (ser->isLoading()) {
|
||||
setCurID(_curId);
|
||||
setColor(_color);
|
||||
}
|
||||
}
|
||||
|
||||
void CharsetRendererClassic::printChar(int chr, bool ignoreCharsetMask) {
|
||||
int width, height, origWidth, origHeight;
|
||||
|
@ -25,6 +25,7 @@
|
||||
#include "common/scummsys.h"
|
||||
#include "common/rect.h"
|
||||
#include "scumm/gfx.h"
|
||||
#include "scumm/saveload.h"
|
||||
|
||||
namespace Scumm {
|
||||
|
||||
@ -84,6 +85,8 @@ public:
|
||||
virtual int getCharWidth(byte chr) = 0;
|
||||
|
||||
virtual void setColor(byte color) { _color = color; translateColor(); }
|
||||
|
||||
void saveLoadWithSerializer(Serializer *ser);
|
||||
};
|
||||
|
||||
class CharsetRendererCommon : public CharsetRenderer {
|
||||
|
@ -1156,11 +1156,16 @@ void ScummEngine::saveOrLoad(Serializer *s) {
|
||||
//
|
||||
// Save/load the charset renderer state
|
||||
//
|
||||
if (s->getVersion() >= VER(72)) {
|
||||
if (s->isSaving()) {
|
||||
s->saveByte(_charset->getCurID());
|
||||
} else {
|
||||
if (s->getVersion() >= VER(73)) {
|
||||
_charset->saveLoadWithSerializer(s);
|
||||
} else if (s->isLoading()) {
|
||||
if (s->getVersion() == VER(72)) {
|
||||
_charset->setCurID(s->loadByte());
|
||||
} else {
|
||||
// Before V72, the charset id wasn't saved. This used to cause issues such
|
||||
// as the one described in the bug report #1722153. For these savegames,
|
||||
// we reinitialize the id using a, hopefully, sane value.
|
||||
_charset->setCurID(_string[0]._default.charset);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -47,7 +47,7 @@ namespace Scumm {
|
||||
* only saves/loads those which are valid for the version of the savegame
|
||||
* which is being loaded/saved currently.
|
||||
*/
|
||||
#define CURRENT_VER 72
|
||||
#define CURRENT_VER 73
|
||||
|
||||
/**
|
||||
* An auxillary macro, used to specify savegame versions. We use this instead
|
||||
|
Loading…
Reference in New Issue
Block a user