mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-31 16:03:24 +00:00
Cleanup.
svn-id: r34545
This commit is contained in:
parent
5719225367
commit
a4830d813e
@ -1164,12 +1164,7 @@ void KyraMetaEngine::removeSaveState(const char *target, int slot) const {
|
||||
return;
|
||||
|
||||
Common::SaveFileManager *saveFileMan = g_system->getSavefileManager();
|
||||
|
||||
char extension[6];
|
||||
snprintf(extension, sizeof(extension), ".%03d", slot);
|
||||
|
||||
Common::String filename = target;
|
||||
filename += extension;
|
||||
Common::String filename = Kyra::KyraEngine_v1::getSavegameFilename(target, slot);
|
||||
|
||||
saveFileMan->removeSavefile(filename.c_str());
|
||||
|
||||
@ -1193,22 +1188,14 @@ void KyraMetaEngine::removeSaveState(const char *target, int slot) const {
|
||||
// is missing.
|
||||
saveFileMan->renameSavefile(file->c_str(), filename.c_str());
|
||||
|
||||
++slot;
|
||||
snprintf(extension, sizeof(extension), ".%03d", slot);
|
||||
|
||||
filename = target;
|
||||
filename += extension;
|
||||
filename = Kyra::KyraEngine_v1::getSavegameFilename(target, ++slot);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Graphics::Surface *KyraMetaEngine::loadThumbnailFromSlot(const char *target, int slot) const {
|
||||
char extension[6];
|
||||
snprintf(extension, sizeof(extension), ".%03d", slot);
|
||||
|
||||
Common::String filename = target;
|
||||
filename += extension;
|
||||
Common::String filename = Kyra::KyraEngine_v1::getSavegameFilename(target, slot);
|
||||
|
||||
Common::InSaveFile *in = g_system->getSavefileManager()->openForLoading(filename.c_str());
|
||||
Kyra::KyraEngine_v1::SaveHeader header;
|
||||
|
@ -275,6 +275,7 @@ protected:
|
||||
void checkAutosave();
|
||||
|
||||
const char *getSavegameFilename(int num);
|
||||
static Common::String getSavegameFilename(const Common::String &target, int num);
|
||||
bool saveFileLoadable(int slot);
|
||||
|
||||
struct SaveHeader {
|
||||
|
@ -216,15 +216,17 @@ Common::WriteStream *KyraEngine_v1::openSaveForWriting(const char *filename, con
|
||||
|
||||
const char *KyraEngine_v1::getSavegameFilename(int num) {
|
||||
static Common::String filename;
|
||||
filename = getSavegameFilename(_targetName, num);
|
||||
return filename.c_str();
|
||||
}
|
||||
|
||||
Common::String KyraEngine_v1::getSavegameFilename(const Common::String &target, int num) {
|
||||
assert(num >= 0 && num <= 999);
|
||||
|
||||
char extension[5];
|
||||
sprintf(extension, "%03d", num);
|
||||
|
||||
filename = _targetName + "." + extension;
|
||||
|
||||
return filename.c_str();
|
||||
return target + "." + extension;
|
||||
}
|
||||
|
||||
bool KyraEngine_v1::saveFileLoadable(int slot) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user