diff options
author | David Corrales | 2007-08-05 19:34:20 +0000 |
---|---|---|
committer | David Corrales | 2007-08-05 19:34:20 +0000 |
commit | 6856535010bd2fa4449bcfde1c88dc06cd46e26f (patch) | |
tree | b81a2234c2beff0312c93e039d6cafda4babeca6 /engines/gob/saveload_v3.cpp | |
parent | 1400d28bfb37fc94f3c44dec0a4d0cef65fb8fb7 (diff) | |
parent | ec1803f838d5efc7decf75c05a1fb4a9633751e5 (diff) | |
download | scummvm-rg350-6856535010bd2fa4449bcfde1c88dc06cd46e26f.tar.gz scummvm-rg350-6856535010bd2fa4449bcfde1c88dc06cd46e26f.tar.bz2 scummvm-rg350-6856535010bd2fa4449bcfde1c88dc06cd46e26f.zip |
Merged fsnode with trunk: r27971:28460
svn-id: r28462
Diffstat (limited to 'engines/gob/saveload_v3.cpp')
-rw-r--r-- | engines/gob/saveload_v3.cpp | 39 |
1 files changed, 21 insertions, 18 deletions
diff --git a/engines/gob/saveload_v3.cpp b/engines/gob/saveload_v3.cpp index b376a8a75c..d0f791d8df 100644 --- a/engines/gob/saveload_v3.cpp +++ b/engines/gob/saveload_v3.cpp @@ -34,9 +34,14 @@ namespace Gob { -SaveLoad_v3::SaveLoad_v3(GobEngine *vm, const char *targetName) : +SaveLoad_v3::SaveLoad_v3(GobEngine *vm, const char *targetName, + uint32 screenshotSize, int32 indexOffset, int32 screenshotOffset) : SaveLoad_v2(vm, targetName) { + _screenshotSize = screenshotSize; + _indexOffset = indexOffset; + _screenshotOffset = screenshotOffset; + _saveSlot = -1; _stagesCount = 3; @@ -58,12 +63,18 @@ SaveLoad_v3::SaveLoad_v3(GobEngine *vm, const char *targetName) : } SaveType SaveLoad_v3::getSaveType(const char *fileName) { + const char *backSlash; + if ((backSlash = strrchr(fileName, '\\'))) + fileName = backSlash + 1; + if (!scumm_stricmp(fileName, "cat.inf")) return kSaveGame; if (!scumm_stricmp(fileName, "ima.inf")) return kSaveScreenshot; if (!scumm_stricmp(fileName, "intro.$$$")) return kSaveTempSprite; + if (!scumm_stricmp(fileName, "bloc.inf")) + return kSaveNotes; if (!scumm_stricmp(fileName, "prot")) return kSaveIgnore; if (!scumm_stricmp(fileName, "config")) @@ -77,15 +88,11 @@ uint32 SaveLoad_v3::getSaveGameSize() { size = 1040 + (READ_LE_UINT32(_vm->_game->_totFileData + 0x2C) * 4) * 2; if (_useScreenshots) - size += 19968; + size += _screenshotSize; return size; } -int32 SaveLoad_v3::getSizeNotes() { - return -1; -} - int32 SaveLoad_v3::getSizeGame() { if (_firstSizeGame) { _firstSizeGame = false; @@ -122,7 +129,7 @@ int32 SaveLoad_v3::getSizeScreenshot() { in = saveMan->openForLoading(setCurSlot(i)); if (in) { delete in; - size = (i + 1) * 19968 + 80; + size = (i + 1) * _screenshotSize + _screenshotOffset; break; } } @@ -206,19 +213,15 @@ bool SaveLoad_v3::loadGame(int16 dataVar, int32 size, int32 offset) { return false; } -bool SaveLoad_v3::loadNotes(int16 dataVar, int32 size, int32 offset) { - return false; -} - bool SaveLoad_v3::loadScreenshot(int16 dataVar, int32 size, int32 offset) { Common::SaveFileManager *saveMan = g_system->getSavefileManager(); Common::InSaveFile *in; - int slot = (offset - 80) / 19968; - int slotR = (offset - 80) % 19968; + int slot = (offset - _screenshotOffset) / _screenshotSize; + int slotR = (offset - _screenshotOffset) % _screenshotSize; _useScreenshots = true; - if ((size == 40) && (offset == 40)) { + if ((size == 40) && (offset == _indexOffset)) { char buf[40]; memset(buf, 0, 40); @@ -327,16 +330,16 @@ bool SaveLoad_v3::saveGame(int16 dataVar, int32 size, int32 offset) { } bool SaveLoad_v3::saveNotes(int16 dataVar, int32 size, int32 offset) { - return false; + return SaveLoad_v2::saveNotes(dataVar, size - 160, offset); } bool SaveLoad_v3::saveScreenshot(int16 dataVar, int32 size, int32 offset) { - int slot = (offset - 80) / 19968; - int slotR = (offset - 80) % 19968; + int slot = (offset - _screenshotOffset) / _screenshotSize; + int slotR = (offset - _screenshotOffset) % _screenshotSize; _useScreenshots = true; - if ((offset < 80) && (size > 0)) { + if ((offset < _screenshotOffset) && (size > 0)) { return true; |