From ea7f3059605526e61e8cea2364c70bef3c35806a Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Sun, 9 Nov 2008 20:07:46 +0000 Subject: Added a new SaveStateDescriptor flag, is_write_protected, which can be used to stop the user from overwriting certain saves (e.g. the auto save, the restart save in the Kyrandia games, the quicksaves etc) svn-id: r34970 --- engines/game.cpp | 4 ++++ engines/game.h | 8 +++++++- 2 files changed, 11 insertions(+), 1 deletion(-) (limited to 'engines') diff --git a/engines/game.cpp b/engines/game.cpp index 5011685412..3e6cdc2e79 100644 --- a/engines/game.cpp +++ b/engines/game.cpp @@ -115,6 +115,10 @@ void SaveStateDescriptor::setDeletableFlag(bool state) { setVal("is_deletable", state ? "true" : "false"); } +void SaveStateDescriptor::setWriteProtectedFlag(bool state) { + setVal("is_write_protected", state ? "true" : "false"); +} + void SaveStateDescriptor::setSaveDate(int year, int month, int day) { char buffer[32]; snprintf(buffer, 32, "%.2d.%.2d.%.4d", day, month, year); diff --git a/engines/game.h b/engines/game.h index 9a8c25e35b..21bfbce0f5 100644 --- a/engines/game.h +++ b/engines/game.h @@ -151,11 +151,17 @@ public: bool getBool(const Common::String &key) const; /** - * Sets the 'is_deletable' key, which indicates, if the + * Sets the 'is_deletable' key, which indicates if the * given savestate is safe for deletion. */ void setDeletableFlag(bool state); + /** + * Sets the 'is_write_protected' key, which indicates if the + * given savestate can be overwritten or not + */ + void setWriteProtectedFlag(bool state); + /** * Return a thumbnail graphics surface representing the savestate visually. * This is usually a scaled down version of the game graphics. The size -- cgit v1.2.3