diff options
author | Sven Hesse | 2011-01-21 13:29:51 +0000 |
---|---|---|
committer | Sven Hesse | 2011-01-21 13:29:51 +0000 |
commit | 100b25a29ec0cd3e2b3ed353289b19ef3ffb70d3 (patch) | |
tree | f15aa3766345fb3b1304b85b64f4ff85df3ae4cf /engines/gob | |
parent | e95254ffa5d1de2b640a5357fe7067deee19f311 (diff) | |
download | scummvm-rg350-100b25a29ec0cd3e2b3ed353289b19ef3ffb70d3.tar.gz scummvm-rg350-100b25a29ec0cd3e2b3ed353289b19ef3ffb70d3.tar.bz2 scummvm-rg350-100b25a29ec0cd3e2b3ed353289b19ef3ffb70d3.zip |
GOB: Remove the now useless SaveConverter_v6
Since I just invalided the old Urban Runner saves anyway...
svn-id: r55376
Diffstat (limited to 'engines/gob')
-rw-r--r-- | engines/gob/module.mk | 1 | ||||
-rw-r--r-- | engines/gob/save/saveconverter.h | 19 | ||||
-rw-r--r-- | engines/gob/save/saveconverter_v6.cpp | 135 |
3 files changed, 0 insertions, 155 deletions
diff --git a/engines/gob/module.mk b/engines/gob/module.mk index d1cbe3c8af..80db80843d 100644 --- a/engines/gob/module.mk +++ b/engines/gob/module.mk @@ -76,7 +76,6 @@ MODULE_OBJS := \ save/saveconverter_v2.o \ save/saveconverter_v3.o \ save/saveconverter_v4.o \ - save/saveconverter_v6.o \ sound/sound.o \ sound/sounddesc.o \ sound/pcspeaker.o \ diff --git a/engines/gob/save/saveconverter.h b/engines/gob/save/saveconverter.h index dd5f43875e..8154377b64 100644 --- a/engines/gob/save/saveconverter.h +++ b/engines/gob/save/saveconverter.h @@ -182,25 +182,6 @@ private: SavePartMem *props, Common::InSaveFile *save); }; -/** A wrapper for old v6-style saves (Urban Runner). */ -class SaveConverter_v6 : public SaveConverter { -public: - SaveConverter_v6(GobEngine *vm, const Common::String &fileName = ""); - ~SaveConverter_v6(); - - int isOldSave(Common::InSaveFile **save = 0) const; - char *getDescription(Common::SeekableReadStream &save) const; - - bool load(); - -private: - static const uint32 kSlotCount = 15; - static const uint32 kSlotNameLength = 40; - - bool loadFail(SavePartInfo *info, SavePartVars *vars, - Common::InSaveFile *save); -}; - } // End of namespace Gob #endif // GOB_SAVE_SAVECONVERTER_H diff --git a/engines/gob/save/saveconverter_v6.cpp b/engines/gob/save/saveconverter_v6.cpp deleted file mode 100644 index a768ac5c67..0000000000 --- a/engines/gob/save/saveconverter_v6.cpp +++ /dev/null @@ -1,135 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ - * - */ - -#include "common/endian.h" -#include "common/savefile.h" - -#include "gob/gob.h" -#include "gob/save/saveconverter.h" -#include "gob/save/savefile.h" -#include "gob/save/savehandler.h" - -namespace Gob { - -SaveConverter_v6::SaveConverter_v6(GobEngine *vm, const Common::String &fileName) : - SaveConverter(vm, fileName) { -} - -SaveConverter_v6::~SaveConverter_v6() { -} - -int SaveConverter_v6::isOldSave(Common::InSaveFile **save) const { - uint32 varSize = SaveHandler::getVarSize(_vm); - if (varSize == 0) - return 0; - - uint32 saveSize = getActualSize(save); - if (saveSize == 0) - return 0; - - // The size of the old save always follows that rule - if (saveSize == (varSize * 2 + kSlotNameLength * 2)) - return 1; - - // Not an old save, clean up - if (save) { - delete *save; - *save = 0; - } - - return 0; -} - -char *SaveConverter_v6::getDescription(Common::SeekableReadStream &save) const { - char *desc = new char[kSlotNameLength]; - - // Read the description - if (save.read(desc, kSlotNameLength) != kSlotNameLength) { - delete[] desc; - return 0; - } - - return desc; -} - -bool SaveConverter_v6::loadFail(SavePartInfo *info, SavePartVars *vars, - Common::InSaveFile *save) { - - delete info; - delete vars; - delete save; - - clear(); - - return false; -} - -// Loads the old save by constructing a new save containing the old save's data -bool SaveConverter_v6::load() { - clear(); - - uint32 varSize = SaveHandler::getVarSize(_vm); - if (varSize == 0) - return false; - - Common::InSaveFile *save; - - // Test if it's an old savd - if (!isOldSave(&save) || !save) - return false; - - displayWarning(); - - SaveWriter writer(2, 0); - - SavePartInfo *info = readInfo(*save, kSlotNameLength); - if (!info) - return loadFail(0, 0, save); - - SavePartVars *vars = readVars(*save, varSize, true); - if (!vars) - return loadFail(info, 0, save); - - // We don't need the save anymore - delete save; - - // Write all parts - if (!writer.writePart(0, info)) - return loadFail(info, vars, 0); - if (!writer.writePart(1, vars)) - return loadFail(info, vars, 0); - - // We don't need those anymore - delete info; - delete vars; - - // Create the final read stream - if (!createStream(writer)) - return loadFail(0, 0, 0); - - return true; -} - -} // End of namespace Gob |