aboutsummaryrefslogtreecommitdiff
path: root/base
diff options
context:
space:
mode:
authorJohannes Schickel2008-09-16 14:56:02 +0000
committerJohannes Schickel2008-09-16 14:56:02 +0000
commit3739662b75dbd04715731071e3b89d1d06a50a8e (patch)
treee956544a64820b95556cd2e58c230f4f7751b986 /base
parent2e9e661d5feaec6d1cb1b61d40cbce4165122edd (diff)
downloadscummvm-rg350-3739662b75dbd04715731071e3b89d1d06a50a8e.tar.gz
scummvm-rg350-3739662b75dbd04715731071e3b89d1d06a50a8e.tar.bz2
scummvm-rg350-3739662b75dbd04715731071e3b89d1d06a50a8e.zip
Added support for SCUMM savestates date/time and playtime info in the launcher load dialog.
svn-id: r34583
Diffstat (limited to 'base')
-rw-r--r--base/game.cpp18
-rw-r--r--base/game.h15
2 files changed, 33 insertions, 0 deletions
diff --git a/base/game.cpp b/base/game.cpp
index 30fd5fc850..7dff13e5f2 100644
--- a/base/game.cpp
+++ b/base/game.cpp
@@ -96,3 +96,21 @@ void SaveStateDescriptor::setDeletableFlag(bool state) {
setVal("is_deletable", state ? "true" : "false");
}
+void SaveStateDescriptor::setSaveDate(int year, int month, int day) {
+ char buffer[32];
+ snprintf(buffer, 32, "%.2d.%.2d.%.4d", day, month, year);
+ setVal("save_date", buffer);
+}
+
+void SaveStateDescriptor::setSaveTime(int hour, int min) {
+ char buffer[32];
+ snprintf(buffer, 32, "%.2d:%.2d", hour, min);
+ setVal("save_time", buffer);
+}
+
+void SaveStateDescriptor::setPlayTime(int hours, int minutes) {
+ char buffer[32];
+ snprintf(buffer, 32, "%.2d:%.2d", hours, minutes);
+ setVal("play_time", buffer);
+}
+
diff --git a/base/game.h b/base/game.h
index 6f9030c56f..8fd1b47422 100644
--- a/base/game.h
+++ b/base/game.h
@@ -187,6 +187,21 @@ public:
const Graphics::Surface *getThumbnail() const { return _thumbnail.get(); }
void setThumbnail(Graphics::Surface *t);
+
+ /**
+ * Sets the 'save_date' key properly, based on the given values
+ */
+ void setSaveDate(int year, int month, int day);
+
+ /**
+ * Sets the 'save_time' key properly, based on the given values
+ */
+ void setSaveTime(int hour, int min);
+
+ /**
+ * Sets the 'play_time' key properly, based on the given values
+ */
+ void setPlayTime(int hours, int minutes);
};
/** List of savestates. */