[Scummvm-git-logs] scummvm master -> 113e8c26fc17e66bf3922777dd101bb5ada3deb1
grisenti
noreply at scummvm.org
Mon Jul 21 07:26:37 UTC 2025
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .
Summary:
113e8c26fc HPL1: fix save date format
Commit: 113e8c26fc17e66bf3922777dd101bb5ada3deb1
https://github.com/scummvm/scummvm/commit/113e8c26fc17e66bf3922777dd101bb5ada3deb1
Author: grisenti (emanuele at grisenti.net)
Date: 2025-07-21T09:26:03+02:00
Commit Message:
HPL1: fix save date format
Changed paths:
engines/hpl1/penumbra-overture/SaveHandler.cpp
diff --git a/engines/hpl1/penumbra-overture/SaveHandler.cpp b/engines/hpl1/penumbra-overture/SaveHandler.cpp
index 8357bcf44bc..bdd883e3a96 100644
--- a/engines/hpl1/penumbra-overture/SaveHandler.cpp
+++ b/engines/hpl1/penumbra-overture/SaveHandler.cpp
@@ -564,15 +564,16 @@ void cSaveHandler::AutoSave(const tWString &asDir, int alMaxSaves) {
sMapName = cString::ReplaceCharToW(sMapName, _W("\n"), _W(" "));
sMapName = cString::ReplaceCharToW(sMapName, _W(":"), _W(" "));
cDate date = mpInit->mpGame->GetSystem()->GetLowLevel()->getDate();
- tWString sFile = Common::U32String::format("%S: %S %d-%d-%d %d:%d:%d",
- asDir.c_str(),
- sMapName.c_str(),
- date.year,
- date.month + 1,
- date.month_day,
- date.hours,
- date.minutes,
- date.seconds);
+ Common::String dateString = Common::String::format("%02d-%02d-%02d %02d:%02d:%02d", date.year,
+ date.month + 1,
+ date.month_day,
+ date.hours,
+ date.minutes,
+ date.seconds);
+ tWString sFile = Common::U32String::format("%S: %S %s",
+ asDir.c_str(),
+ sMapName.c_str(),
+ dateString.c_str());
SaveGameToFile(sFile);
mpInit->mpGame->ResetLogicTimer();
@@ -625,8 +626,7 @@ void cSaveHandler::OnExit() {
cDate cSaveHandler::parseDate(const Common::String &saveFile) {
cDate date;
- auto firstDigit = Common::find_if(saveFile.begin(), saveFile.end(), Common::isDigit);
- Common::String strDate = saveFile.substr(Common::distance(saveFile.begin(), firstDigit));
+ Common::String strDate = saveFile.substr(saveFile.size() - 17);
sscanf(strDate.c_str(), "%d-%d-%d %d:%d:%d", &date.year, &date.month, &date.month_day, &date.hours, &date.minutes, &date.seconds);
return date;
}
More information about the Scummvm-git-logs
mailing list