mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-31 07:53:36 +00:00
Got rid of the unused 'filename' attribute in SaveStateDescriptor
svn-id: r34905
This commit is contained in:
parent
79614d28b6
commit
fe2935ad4b
@ -2184,7 +2184,7 @@ SaveStateList AgiMetaEngine::listSaves(const char *target) const {
|
||||
uint32 type = in->readUint32BE();
|
||||
if (type == AGIflag)
|
||||
in->read(saveDesc, 31);
|
||||
saveList.push_back(SaveStateDescriptor(slotNum, Common::String(saveDesc), *file));
|
||||
saveList.push_back(SaveStateDescriptor(slotNum, saveDesc));
|
||||
delete in;
|
||||
}
|
||||
}
|
||||
|
@ -182,7 +182,7 @@ SaveStateList AgosMetaEngine::listSaves(const char *target) const {
|
||||
Common::InSaveFile *in = saveFileMan->openForLoading(file->c_str());
|
||||
if (in) {
|
||||
saveDesc = file->c_str();
|
||||
saveList.push_back(SaveStateDescriptor(slotNum, saveDesc, *file));
|
||||
saveList.push_back(SaveStateDescriptor(slotNum, saveDesc));
|
||||
delete in;
|
||||
}
|
||||
}
|
||||
|
@ -590,7 +590,7 @@ SaveStateList CineMetaEngine::listSaves(const char *target) const {
|
||||
}
|
||||
} while (ch >= 32 && !in->eos());
|
||||
if (saveDesc[0] != 0) {
|
||||
saveList.push_back(SaveStateDescriptor(slotNum, Common::String(saveDesc), *file));
|
||||
saveList.push_back(SaveStateDescriptor(slotNum, saveDesc));
|
||||
file++;
|
||||
}
|
||||
} while (!in->eos());
|
||||
|
@ -102,7 +102,7 @@ public:
|
||||
/**
|
||||
* A hashmap describing details about a given save state.
|
||||
* TODO
|
||||
* Guaranteed to contain save_slot, filename and description values.
|
||||
* Guaranteed to contain save_slot and description values.
|
||||
* Additional ideas: Playtime, creation date, thumbnail, ...
|
||||
*/
|
||||
class SaveStateDescriptor : public Common::StringMap {
|
||||
@ -113,21 +113,18 @@ public:
|
||||
SaveStateDescriptor() : _thumbnail() {
|
||||
setVal("save_slot", "-1"); // FIXME: default to 0 (first slot) or to -1 (invalid slot) ?
|
||||
setVal("description", "");
|
||||
setVal("filename", "");
|
||||
}
|
||||
|
||||
SaveStateDescriptor(int s, const Common::String &d, const Common::String &f) : _thumbnail() {
|
||||
SaveStateDescriptor(int s, const Common::String &d) : _thumbnail() {
|
||||
char buf[16];
|
||||
sprintf(buf, "%d", s);
|
||||
setVal("save_slot", buf);
|
||||
setVal("description", d);
|
||||
setVal("filename", f);
|
||||
}
|
||||
|
||||
SaveStateDescriptor(const Common::String &s, const Common::String &d, const Common::String &f) : _thumbnail() {
|
||||
SaveStateDescriptor(const Common::String &s, const Common::String &d) : _thumbnail() {
|
||||
setVal("save_slot", s);
|
||||
setVal("description", d);
|
||||
setVal("filename", f);
|
||||
}
|
||||
|
||||
/** The saveslot id, as it would be passed to the "-x" command line switch. */
|
||||
@ -142,12 +139,6 @@ public:
|
||||
/** A human readable description of the save state (read-only variant). */
|
||||
const Common::String &description() const { return getVal("description"); }
|
||||
|
||||
/** The filename of the savestate, for use with the SaveFileManager API. */
|
||||
Common::String &filename() { return getVal("filename"); }
|
||||
|
||||
/** The filename of the savestate, for use with the SaveFileManager API (read-only variant). */
|
||||
const Common::String &filename() const { return getVal("filename"); }
|
||||
|
||||
/** Optional entries only included when querying via MetaEngine::querySaveMetaInfo */
|
||||
|
||||
/**
|
||||
|
@ -1151,7 +1151,7 @@ SaveStateList KyraMetaEngine::listSaves(const char *target) const {
|
||||
if (slotNum == 0 && header.gameID == Kyra::GI_KYRA3)
|
||||
header.description = "New Game";
|
||||
|
||||
saveList.push_back(SaveStateDescriptor(slotNum, header.description, *file));
|
||||
saveList.push_back(SaveStateDescriptor(slotNum, header.description));
|
||||
}
|
||||
delete in;
|
||||
}
|
||||
@ -1209,7 +1209,7 @@ SaveStateDescriptor KyraMetaEngine::querySaveMetaInfos(const char *target, int s
|
||||
delete in;
|
||||
|
||||
if (error == Kyra::KyraEngine_v1::kRSHENoError) {
|
||||
SaveStateDescriptor desc(slot, header.description, filename);
|
||||
SaveStateDescriptor desc(slot, header.description);
|
||||
|
||||
desc.setDeletableFlag(slot != 0);
|
||||
desc.setThumbnail(header.thumbnail);
|
||||
|
@ -230,7 +230,7 @@ SaveStateList LureMetaEngine::listSaves(const char *target) const {
|
||||
Common::InSaveFile *in = saveFileMan->openForLoading(file->c_str());
|
||||
if (in) {
|
||||
saveDesc = Lure::getSaveName(in);
|
||||
saveList.push_back(SaveStateDescriptor(slotNum, saveDesc, *file));
|
||||
saveList.push_back(SaveStateDescriptor(slotNum, saveDesc));
|
||||
delete in;
|
||||
}
|
||||
}
|
||||
|
@ -299,7 +299,7 @@ SaveStateList ParallactionMetaEngine::listSaves(const char *target) const {
|
||||
Common::InSaveFile *in = saveFileMan->openForLoading(file->c_str());
|
||||
if (in) {
|
||||
Common::String saveDesc = in->readLine();
|
||||
saveList.push_back(SaveStateDescriptor(slotNum, saveDesc, *file));
|
||||
saveList.push_back(SaveStateDescriptor(slotNum, saveDesc));
|
||||
delete in;
|
||||
}
|
||||
}
|
||||
|
@ -155,7 +155,7 @@ SaveStateList QueenMetaEngine::listSaves(const char *target) const {
|
||||
for (int i = 0; i < 4; i++)
|
||||
in->readUint32BE();
|
||||
in->read(saveDesc, 32);
|
||||
saveList.push_back(SaveStateDescriptor(slotNum, Common::String(saveDesc), *file));
|
||||
saveList.push_back(SaveStateDescriptor(slotNum, saveDesc));
|
||||
delete in;
|
||||
}
|
||||
}
|
||||
|
@ -197,7 +197,7 @@ SaveStateList SagaMetaEngine::listSaves(const char *target) const {
|
||||
for (int i = 0; i < 3; i++)
|
||||
in->readUint32BE();
|
||||
in->read(saveDesc, SAVE_TITLE_SIZE);
|
||||
saveList.push_back(SaveStateDescriptor(slotNum, saveDesc, *file));
|
||||
saveList.push_back(SaveStateDescriptor(slotNum, saveDesc));
|
||||
delete in;
|
||||
}
|
||||
}
|
||||
|
@ -978,7 +978,7 @@ SaveStateList ScummMetaEngine::listSaves(const char *target) const {
|
||||
Common::InSaveFile *in = saveFileMan->openForLoading(file->c_str());
|
||||
if (in) {
|
||||
Scumm::getSavegameName(in, saveDesc, 0); // FIXME: heversion?!?
|
||||
saveList.push_back(SaveStateDescriptor(slotNum, saveDesc, *file));
|
||||
saveList.push_back(SaveStateDescriptor(slotNum, saveDesc));
|
||||
delete in;
|
||||
}
|
||||
}
|
||||
@ -1006,7 +1006,7 @@ SaveStateDescriptor ScummMetaEngine::querySaveMetaInfos(const char *target, int
|
||||
// TODO: Cleanup
|
||||
Graphics::Surface *thumbnail = ScummEngine::loadThumbnailFromSlot(target, slot);
|
||||
|
||||
SaveStateDescriptor desc(slot, saveDesc, filename);
|
||||
SaveStateDescriptor desc(slot, saveDesc);
|
||||
desc.setDeletableFlag(true);
|
||||
desc.setThumbnail(thumbnail);
|
||||
|
||||
|
@ -239,7 +239,7 @@ SaveStateList SkyMetaEngine::listSaves(const char *target) const {
|
||||
// Slot 0 is the autosave, if it exists.
|
||||
// TODO: Check for the existence of the autosave -- but this require us
|
||||
// to know which SKY variant we are looking at.
|
||||
saveList.insert_at(0, SaveStateDescriptor(0, "*AUTOSAVE*", ""));
|
||||
saveList.insert_at(0, SaveStateDescriptor(0, "*AUTOSAVE*"));
|
||||
|
||||
// Prepare the list of savestates by looping over all matching savefiles
|
||||
for (Common::StringList::const_iterator file = filenames.begin(); file != filenames.end(); file++) {
|
||||
@ -250,7 +250,7 @@ SaveStateList SkyMetaEngine::listSaves(const char *target) const {
|
||||
int slotNum = atoi(ext.c_str());
|
||||
Common::InSaveFile *in = saveFileMan->openForLoading(file->c_str());
|
||||
if (in) {
|
||||
saveList.push_back(SaveStateDescriptor(slotNum+1, savenames[slotNum], *file));
|
||||
saveList.push_back(SaveStateDescriptor(slotNum+1, savenames[slotNum]));
|
||||
delete in;
|
||||
}
|
||||
}
|
||||
|
@ -259,7 +259,7 @@ SaveStateList SwordMetaEngine::listSaves(const char *target) const {
|
||||
// FIXME: The in-game dialog shows the first save slot as 1, not 0,
|
||||
// but if we change the numbering here, the launcher won̈́t set
|
||||
// "save_slot" correctly.
|
||||
saveList.push_back(SaveStateDescriptor(slotNum, saveDesc, *file));
|
||||
saveList.push_back(SaveStateDescriptor(slotNum, saveDesc));
|
||||
file++;
|
||||
}
|
||||
}
|
||||
|
@ -192,7 +192,7 @@ SaveStateList Sword2MetaEngine::listSaves(const char *target) const {
|
||||
if (in) {
|
||||
in->readUint32LE();
|
||||
in->read(saveDesc, SAVE_DESCRIPTION_LEN);
|
||||
saveList.push_back(SaveStateDescriptor(slotNum, Common::String(saveDesc), *file));
|
||||
saveList.push_back(SaveStateDescriptor(slotNum, saveDesc));
|
||||
delete in;
|
||||
}
|
||||
}
|
||||
|
@ -359,9 +359,7 @@ SaveStateList TinselMetaEngine::listSaves(const char *target) const {
|
||||
|
||||
SaveStateList saveList;
|
||||
for (int i = 0; i < numStates; i++) {
|
||||
SaveStateDescriptor sd(i,
|
||||
Tinsel::ListEntry(i, Tinsel::LE_DESC),
|
||||
Tinsel::ListEntry(i, Tinsel::LE_NAME));
|
||||
SaveStateDescriptor sd(i, Tinsel::ListEntry(i, Tinsel::LE_DESC));
|
||||
// TODO: Also add savedFiles[i].dateTime to the SaveStateDescriptor
|
||||
saveList.push_back(sd);
|
||||
}
|
||||
|
@ -184,7 +184,7 @@ SaveStateList ToucheMetaEngine::listSaves(const char *target) const {
|
||||
in->readUint16LE();
|
||||
in->readUint16LE();
|
||||
in->read(saveDesc, Touche::kGameStateDescriptionLen);
|
||||
saveList.push_back(SaveStateDescriptor(slotNum, Common::String(saveDesc), *file));
|
||||
saveList.push_back(SaveStateDescriptor(slotNum, saveDesc));
|
||||
delete in;
|
||||
}
|
||||
}
|
||||
@ -205,7 +205,7 @@ SaveStateList ToucheMetaEngine::listSaves(const char *target) const {
|
||||
in->readUint16LE();
|
||||
in->readUint16LE();
|
||||
in->read(saveDesc, Touche::kGameStateDescriptionLen);
|
||||
saveList.push_back(SaveStateDescriptor(slotNum, Common::String(saveDesc), *file));
|
||||
saveList.push_back(SaveStateDescriptor(slotNum, saveDesc));
|
||||
delete in;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user