[Scummvm-git-logs] scummvm master -> 30a1bfb57d1b659d5e71521fa094523b50af9b75
yuv422
noreply at scummvm.org
Sat Oct 4 04:57:40 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:
30a1bfb57d DARKSEED: Fix bug when printing time.
Commit: 30a1bfb57d1b659d5e71521fa094523b50af9b75
https://github.com/scummvm/scummvm/commit/30a1bfb57d1b659d5e71521fa094523b50af9b75
Author: Eric Fry (yuv422 at reversedgames.com)
Date: 2025-10-04T14:56:51+10:00
Commit Message:
DARKSEED: Fix bug when printing time.
Changed paths:
engines/darkseed/darkseed.cpp
engines/darkseed/debugconsole.cpp
diff --git a/engines/darkseed/darkseed.cpp b/engines/darkseed/darkseed.cpp
index abca3ac0541..1920a73e2d0 100644
--- a/engines/darkseed/darkseed.cpp
+++ b/engines/darkseed/darkseed.cpp
@@ -1955,13 +1955,16 @@ void DarkseedEngine::lookCode(int objNum) {
void DarkseedEngine::printTime() {
_console->printTosText(958);
- int hour = g_engine->_currentTimeInSeconds / 60 / 60 + 1;
-
+ int hour = g_engine->_currentTimeInSeconds / 3600;
+ bool isAm = hour < 12;
+ if (hour > 12) {
+ hour -= 12;
+ }
if (g_engine->getLanguage() == Common::ZH_ANY) {
- _console->addToCurrentLineU32(convertToU32String(hour < 12 ? "\xa4\x57\xa4\xc8" : "\xa4\x55\xa4\xc8", Common::ZH_ANY));
- _console->addToCurrentLine(Common::String::format("%d:%02d", hour % 12, (g_engine->_currentTimeInSeconds / 60) % 60));
+ _console->addToCurrentLineU32(convertToU32String(isAm ? "\xa4\x57\xa4\xc8" : "\xa4\x55\xa4\xc8", Common::ZH_ANY));
+ _console->addToCurrentLine(Common::String::format("%d:%02d", hour, (g_engine->_currentTimeInSeconds / 60) % 60));
} else {
- _console->addToCurrentLine(Common::String::format("%d: %02d %s", hour % 12, (g_engine->_currentTimeInSeconds / 60) % 60, hour < 12 ? "a.m." : "p.m."));
+ _console->addToCurrentLine(Common::String::format("%d: %02d %s", hour, (g_engine->_currentTimeInSeconds / 60) % 60, isAm ? "a.m." : "p.m."));
}
}
diff --git a/engines/darkseed/debugconsole.cpp b/engines/darkseed/debugconsole.cpp
index 67ca29bf4ae..efea8718fdc 100644
--- a/engines/darkseed/debugconsole.cpp
+++ b/engines/darkseed/debugconsole.cpp
@@ -280,10 +280,10 @@ bool DebugConsole::Cmd_playSpeech(int argc, const char **argv) {
}
void DebugConsole::printDayAndTime() {
- int hour = g_engine->_currentTimeInSeconds / 60 / 60 + 1;
+ int hour = g_engine->_currentTimeInSeconds / 3600;
debugPrintf("Day %d at %d:%02d%s (%d seconds)\n",
g_engine->_currentDay,
- hour % 12,
+ hour > 12 ? hour - 12 : hour,
(g_engine->_currentTimeInSeconds / 60) % 60,
hour < 12 ? "AM" : "PM", g_engine->_currentTimeInSeconds);
}
More information about the Scummvm-git-logs
mailing list