Ticket #3194: 1722153-2.diff
File 1722153-2.diff, 2.5 KB (added by , 17 years ago) |
---|
-
scumm/charset.h
25 25 #include "common/scummsys.h" 26 26 #include "common/rect.h" 27 27 #include "scumm/gfx.h" 28 #include "scumm/saveload.h" 28 29 29 30 namespace Scumm { 30 31 … … 84 85 virtual int getCharWidth(byte chr) = 0; 85 86 86 87 virtual void setColor(byte color) { _color = color; translateColor(); } 88 89 void saveLoadWithSerializer(Serializer *ser); 87 90 }; 88 91 89 92 class CharsetRendererCommon : public CharsetRenderer { -
scumm/charset.cpp
1311 1311 } 1312 1312 } 1313 1313 1314 void CharsetRenderer::saveLoadWithSerializer(Serializer *ser) { 1315 static const SaveLoadEntry charsetRendererEntries[] = { 1316 MKLINE(CharsetRenderer, _curId, sleByte, VER(73)), 1317 MKLINE(CharsetRenderer, _color, sleByte, VER(73)), 1318 MKEND() 1319 }; 1314 1320 1321 ser->saveLoadEntries(this, charsetRendererEntries); 1322 1323 if (ser->isLoading()) { 1324 setCurID(_curId); 1325 setColor(_color); 1326 } 1327 } 1328 1315 1329 void CharsetRendererClassic::printChar(int chr, bool ignoreCharsetMask) { 1316 1330 int width, height, origWidth, origHeight; 1317 1331 int offsX, offsY; -
scumm/saveload.cpp
1156 1156 // 1157 1157 // Save/load the charset renderer state 1158 1158 // 1159 if (s->getVersion() >= VER(72)) { 1160 if (s->isSaving()) { 1161 s->saveByte(_charset->getCurID()); 1159 if (s->getVersion() >= VER(73)) { 1160 _charset->saveLoadWithSerializer(s); 1161 } else if (s->isLoading()) { 1162 if (s->getVersion() == VER(72)) { 1163 _charset->setCurID(s->loadByte()); 1162 1164 } else { 1163 _charset->setCurID(s->loadByte()); 1165 // Before V72, the charset id wasn't saved. This used to cause issues such 1166 // as the one described in the bug report #1722153. For these savegames, 1167 // we reinitialize the id using a, hopefully, sane value. 1168 _charset->setCurID(_string[0]._default.charset); 1164 1169 } 1165 1170 } 1166 1171 } -
scumm/saveload.h
47 47 * only saves/loads those which are valid for the version of the savegame 48 48 * which is being loaded/saved currently. 49 49 */ 50 #define CURRENT_VER 7 250 #define CURRENT_VER 73 51 51 52 52 /** 53 53 * An auxillary macro, used to specify savegame versions. We use this instead