[Scummvm-git-logs] scummvm master -> 5136ff228e56d28569d976e560e82d4b5af1ce7b

dreammaster paulfgilbert at gmail.com
Thu Sep 17 04:53:35 UTC 2020


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
5136ff228e ENGINES: Fix defaults for engines using new extended format


Commit: 5136ff228e56d28569d976e560e82d4b5af1ce7b
    https://github.com/scummvm/scummvm/commit/5136ff228e56d28569d976e560e82d4b5af1ce7b
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2020-09-16T21:52:38-07:00

Commit Message:
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.

Changed paths:
    engines/metaengine.cpp
    engines/metaengine.h


diff --git a/engines/metaengine.cpp b/engines/metaengine.cpp
index 4884c8be32..c4bda267fa 100644
--- a/engines/metaengine.cpp
+++ b/engines/metaengine.cpp
@@ -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;
 }
diff --git a/engines/metaengine.h b/engines/metaengine.h
index dabc3ce289..0412e99cc1 100644
--- a/engines/metaengine.h
+++ b/engines/metaengine.h
@@ -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;
 	}
 
 	/**




More information about the Scummvm-git-logs mailing list