From 09501be85bee9f686a7815fc0f47a1e16008f38d Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sat, 2 Jul 2011 20:25:32 +0200 Subject: ENGINES: Clean up SaveStateDescriptor. Now SaveStateDescriptor no longer subclasses HashMap. Instead all possible saved meta data is included directly into SaveStateDescriptor. This is slightly less flexible, but we never needed that flexibility so far. On the other hand it should reduce the memory usage. At least on my system (Linux/amd64) the old SaveStateDescriptor had a size of 928 and the new SaveStateDescriptor has a size of 200. --- engines/groovie/saveload.cpp | 4 ++-- engines/groovie/script.cpp | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'engines/groovie') diff --git a/engines/groovie/saveload.cpp b/engines/groovie/saveload.cpp index a0463db0be..14e7a09cb2 100644 --- a/engines/groovie/saveload.cpp +++ b/engines/groovie/saveload.cpp @@ -102,7 +102,7 @@ Common::InSaveFile *SaveLoad::openForLoading(const Common::String &target, int s // Fill the SaveStateDescriptor if it was provided if (descriptor) { // Initialize the SaveStateDescriptor - descriptor->setVal("save_slot", Common::String('0' + slot)); + descriptor->setSaveSlot(slot); descriptor->setDeletableFlag(true); descriptor->setWriteProtectedFlag(false); @@ -132,7 +132,7 @@ Common::InSaveFile *SaveLoad::openForLoading(const Common::String &target, int s description += c; } } - descriptor->setVal("description", description); + descriptor->setDescription(description); } // Return a substream, skipping the metadata diff --git a/engines/groovie/script.cpp b/engines/groovie/script.cpp index f87e6bb91b..5a24559e8b 100644 --- a/engines/groovie/script.cpp +++ b/engines/groovie/script.cpp @@ -1350,15 +1350,15 @@ void Script::o_checkvalidsaves() { uint count = 0; SaveStateList::iterator it = list.begin(); while (it != list.end()) { - int8 slot = it->getVal("save_slot").lastChar() - '0'; + int8 slot = it->getSaveSlot(); if (SaveLoad::isSlotValid(slot)) { - debugScript(2, true, " Found valid savegame: %s", it->getVal("description").c_str()); + debugScript(2, true, " Found valid savegame: %s", it->getDescription().c_str()); // Mark this slot as used setVariable(slot, 1); // Cache this slot's description - _saveNames[slot] = it->getVal("description"); + _saveNames[slot] = it->getDescription(); count++; } it++; -- cgit v1.2.3