aboutsummaryrefslogtreecommitdiff
path: root/engines/lab/detection.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/lab/detection.cpp')
-rw-r--r--engines/lab/detection.cpp37
1 files changed, 10 insertions, 27 deletions
diff --git a/engines/lab/detection.cpp b/engines/lab/detection.cpp
index d01dff2843..bf6d4563b5 100644
--- a/engines/lab/detection.cpp
+++ b/engines/lab/detection.cpp
@@ -48,7 +48,7 @@ static const ADGameDescription labDescriptions[] = {
},
Common::EN_ANY,
Common::kPlatformDOS,
- ADGF_TESTING,
+ ADGF_NO_FLAGS,
GUIO0()
},
{
@@ -61,7 +61,7 @@ static const ADGameDescription labDescriptions[] = {
},
Common::EN_ANY,
Common::kPlatformDOS,
- Lab::GF_LOWRES | ADGF_TESTING,
+ Lab::GF_LOWRES | ADGF_NO_FLAGS,
GUIO0()
},
{
@@ -75,7 +75,7 @@ static const ADGameDescription labDescriptions[] = {
},
Common::EN_ANY,
Common::kPlatformWindows,
- ADGF_TESTING,
+ ADGF_NO_FLAGS,
GUIO0()
},
{
@@ -115,7 +115,7 @@ uint32 LabEngine::getFeatures() const {
class LabMetaEngine : public AdvancedMetaEngine {
public:
LabMetaEngine() : AdvancedMetaEngine(labDescriptions, sizeof(ADGameDescription), lab_setting) {
- _singleid = "lab";
+ _singleId = "lab";
_maxScanDepth = 4;
_directoryGlobs = directoryGlobs;
@@ -127,7 +127,7 @@ public:
}
virtual const char *getOriginalCopyright() const {
- return "Labyrinth of Time (c) 2004 The Wyrmkeep Entertainment Co. and Terra Nova Development";
+ return "Labyrinth of Time (C) 2004 The Wyrmkeep Entertainment Co. and Terra Nova Development";
}
virtual bool createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const {
@@ -151,7 +151,8 @@ bool LabMetaEngine::hasFeature(MetaEngineFeature f) const {
(f == kSavesSupportMetaInfo) ||
(f == kSavesSupportThumbnail) ||
(f == kSavesSupportCreationDate) ||
- (f == kSavesSupportPlayTime);
+ (f == kSavesSupportPlayTime) ||
+ (f == kSimpleSavesNames);
}
bool Lab::LabEngine::hasFeature(EngineFeature f) const {
@@ -169,7 +170,6 @@ SaveStateList LabMetaEngine::listSaves(const char *target) const {
Common::StringArray filenames;
filenames = saveFileMan->listSavefiles(pattern.c_str());
- Common::sort(filenames.begin(), filenames.end()); // Sort (hopefully ensuring we are sorted numerically..)*/
SaveStateList saveList;
@@ -187,6 +187,8 @@ SaveStateList LabMetaEngine::listSaves(const char *target) const {
}
}
+ // Sort saves based on slot number.
+ Common::sort(saveList.begin(), saveList.end(), SaveStateDescriptorSlotComparator());
return saveList;
}
@@ -196,26 +198,7 @@ int LabMetaEngine::getMaximumSaveSlot() const {
void LabMetaEngine::removeSaveState(const char *target, int slot) const {
Common::SaveFileManager *saveFileMan = g_system->getSavefileManager();
- Common::String filename = Common::String::format("%s.%03u", target, slot);
-
- saveFileMan->removeSavefile(filename.c_str());
-
- Common::StringArray filenames;
- Common::String pattern = target;
- pattern += ".###";
- filenames = saveFileMan->listSavefiles(pattern.c_str());
- Common::sort(filenames.begin(), filenames.end()); // Sort (hopefully ensuring we are sorted numerically..)
-
- for (Common::StringArray::const_iterator file = filenames.begin(); file != filenames.end(); ++file) {
- // Obtain the last 3 digits of the filename, since they correspond to the save slot
- int slotNum = atoi(file->c_str() + file->size() - 3);
-
- // Rename every slot greater than the deleted slot,
- if (slotNum > slot) {
- saveFileMan->renameSavefile(file->c_str(), filename.c_str());
- filename = Common::String::format("%s.%03u", target, ++slot);
- }
- }
+ saveFileMan->removeSavefile(Common::String::format("%s.%03u", target, slot));
}
SaveStateDescriptor LabMetaEngine::querySaveMetaInfos(const char *target, int slot) const {