aboutsummaryrefslogtreecommitdiff
path: root/base
diff options
context:
space:
mode:
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. */