[Scummvm-git-logs] scummvm master -> 45137f34df748be01bbe9e935d1cdb0d26a5d808
sev-
sev at scummvm.org
Sat Jul 21 13:15:18 CEST 2018
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
9d88afe6bf GRAPHICS: Add playtime in milliseconds to SaveStateDescriptor
45137f34df PINK: Set engine playtime to playtime in saved game
Commit: 9d88afe6bf077006945e2494f397a593ae70e9eb
https://github.com/scummvm/scummvm/commit/9d88afe6bf077006945e2494f397a593ae70e9eb
Author: David Fioramonti (dafioram at gmail.com)
Date: 2018-07-21T13:15:14+02:00
Commit Message:
GRAPHICS: Add playtime in milliseconds to SaveStateDescriptor
This will make setting the playtime for the engine easier since
the current savestate stores it as a string.
This value gets set at the same time that the string playtime gets set.
Changed paths:
engines/savestate.cpp
engines/savestate.h
diff --git a/engines/savestate.cpp b/engines/savestate.cpp
index 92c1eaf..90ab4d0 100644
--- a/engines/savestate.cpp
+++ b/engines/savestate.cpp
@@ -27,12 +27,12 @@
SaveStateDescriptor::SaveStateDescriptor()
// FIXME: default to 0 (first slot) or to -1 (invalid slot) ?
: _slot(-1), _description(), _isDeletable(true), _isWriteProtected(false),
- _isLocked(false), _saveDate(), _saveTime(), _playTime(), _thumbnail() {
+ _isLocked(false), _saveDate(), _saveTime(), _playTime(), _playTimeMSecs(0), _thumbnail() {
}
SaveStateDescriptor::SaveStateDescriptor(int s, const Common::String &d)
: _slot(s), _description(d), _isDeletable(true), _isWriteProtected(false),
- _isLocked(false), _saveDate(), _saveTime(), _playTime(), _thumbnail() {
+ _isLocked(false), _saveDate(), _saveTime(), _playTime(), _playTimeMSecs(0), _thumbnail() {
}
void SaveStateDescriptor::setThumbnail(Graphics::Surface *t) {
@@ -51,10 +51,12 @@ void SaveStateDescriptor::setSaveTime(int hour, int min) {
}
void SaveStateDescriptor::setPlayTime(int hours, int minutes) {
+ _playTimeMSecs = ((hours * 60 + minutes) * 60) * 1000;
_playTime = Common::String::format("%.2d:%.2d", hours, minutes);
}
void SaveStateDescriptor::setPlayTime(uint32 msecs) {
+ _playTimeMSecs = msecs;
uint minutes = msecs / 60000;
setPlayTime(minutes / 60, minutes % 60);
}
diff --git a/engines/savestate.h b/engines/savestate.h
index 567750c..e91cc9c 100644
--- a/engines/savestate.h
+++ b/engines/savestate.h
@@ -177,6 +177,14 @@ public:
*/
const Common::String &getPlayTime() const { return _playTime; }
+ /**
+ * Returns the time the game was played before the save state was created
+ * in milliseconds.
+ *
+ * It defaults to 0.
+ */
+ uint32 getPlayTimeMSecs() const { return _playTimeMSecs; }
+
private:
/**
* The saveslot id, as it would be passed to the "-x" command line switch.
@@ -220,6 +228,12 @@ private:
Common::String _playTime;
/**
+ * The time the game was played before the save state was created
+ * in milliseconds.
+ */
+ uint32 _playTimeMSecs;
+
+ /**
* The thumbnail of the save state.
*/
Common::SharedPtr<Graphics::Surface> _thumbnail;
Commit: 45137f34df748be01bbe9e935d1cdb0d26a5d808
https://github.com/scummvm/scummvm/commit/45137f34df748be01bbe9e935d1cdb0d26a5d808
Author: David Fioramonti (dafioram at gmail.com)
Date: 2018-07-21T13:15:14+02:00
Commit Message:
PINK: Set engine playtime to playtime in saved game
Before the playtime was starting over when ScummVM was closed and
reopened instead of starting off with the playtime in the saved game.
Changed paths:
engines/pink/saveload.cpp
diff --git a/engines/pink/saveload.cpp b/engines/pink/saveload.cpp
index 27e8d95..02bda4f 100644
--- a/engines/pink/saveload.cpp
+++ b/engines/pink/saveload.cpp
@@ -41,6 +41,7 @@ Common::Error PinkEngine::loadGameState(int slot) {
_nextModule = archive.readString();
_nextPage = archive.readString();
initModule(archive.readString(), "", &archive);
+ setTotalPlayTime(desc.getPlayTimeMSecs());
delete in;
return Common::kNoError;
More information about the Scummvm-git-logs
mailing list