ENGINES: Fix defaults for engines using new extended format

This fixes two issues. First of all, when I was fleshing
out the Quux example engine with save support, I realised
that the default savegame pattern for engines is target.***,
whereas for the meta engine it was target.s**. This was
causing newly created saves not to appear in the savegame list.
The second is a minor convenience nicety.. if an engine is
supporting the new extended format, it means they do have saves,
so it's better to default to 100 slots by default without
requiring the engine to explicity declare it.
This commit is contained in:
Paul Gilbert 2020-09-16 21:48:45 -07:00
parent fc075e29da
commit 5136ff228e
2 changed files with 4 additions and 2 deletions

View File

@ -47,8 +47,9 @@ const char *MetaEngine::getSavegameFile(int saveGameIdx, const char *target) con
const char *MetaEngine::getSavegamePattern(const char *target) const {
static char buffer[200];
const char *pattern = hasFeature(kSavesUseExtendedFormat) ? "%s.###" : "%s.s##";
snprintf(buffer, sizeof(buffer), "%s.s##", target == nullptr ? getEngineId() : target);
snprintf(buffer, sizeof(buffer), pattern, target == nullptr ? getEngineId() : target);
return buffer;
}

View File

@ -244,7 +244,8 @@ public:
* @return maximum save slot number supported
*/
virtual int getMaximumSaveSlot() const {
return 0;
// For games using the new save format, assume 99 slots by default
return hasFeature(kSavesUseExtendedFormat) ? 99 : 0;
}
/**