summaryrefslogtreecommitdiffstats
path: root/src/Clock.cpp
diff options
context:
space:
mode:
authorFire-Head <Fire-Head@users.noreply.github.com>2019-06-13 02:35:26 +0200
committerFire-Head <Fire-Head@users.noreply.github.com>2019-06-13 02:35:26 +0200
commit75bca8e31eef877cc6df83146c665f86ad6f8583 (patch)
treeeed79ac6f6bdee9d914e283266bf4b7aee56c6a6 /src/Clock.cpp
parentCameraCreate cosmetic fix (diff)
downloadre3-75bca8e31eef877cc6df83146c665f86ad6f8583.tar
re3-75bca8e31eef877cc6df83146c665f86ad6f8583.tar.gz
re3-75bca8e31eef877cc6df83146c665f86ad6f8583.tar.bz2
re3-75bca8e31eef877cc6df83146c665f86ad6f8583.tar.lz
re3-75bca8e31eef877cc6df83146c665f86ad6f8583.tar.xz
re3-75bca8e31eef877cc6df83146c665f86ad6f8583.tar.zst
re3-75bca8e31eef877cc6df83146c665f86ad6f8583.zip
Diffstat (limited to '')
-rw-r--r--src/Clock.cpp29
1 files changed, 22 insertions, 7 deletions
diff --git a/src/Clock.cpp b/src/Clock.cpp
index bd4126f2..dd7b99fe 100644
--- a/src/Clock.cpp
+++ b/src/Clock.cpp
@@ -3,6 +3,10 @@
#include "Timer.h"
#include "Pad.h"
#include "Clock.h"
+#include "Stats.h"
+
+_TODO("gbFastTime");
+Bool &gbFastTime = *(Bool*)0x95CDBB;
uint8 &CClock::ms_nGameClockHours = *(uint8*)0x95CDA6;
uint8 &CClock::ms_nGameClockMinutes = *(uint8*)0x95CDC8;
@@ -30,26 +34,37 @@ CClock::Initialise(uint32 scale)
void
CClock::Update(void)
{
- if(CPad::GetPad(1)->GetRightShoulder1()){
+ if(CPad::GetPad(1)->GetRightShoulder1())
+ {
ms_nGameClockMinutes += 8;
ms_nLastClockTick = CTimer::GetTimeInMilliseconds();
- if(ms_nGameClockMinutes >= 60){
+
+ if(ms_nGameClockMinutes >= 60)
+ {
ms_nGameClockHours++;
ms_nGameClockMinutes = 0;
if(ms_nGameClockHours >= 24)
ms_nGameClockHours = 0;
}
- }else
- if(CTimer::GetTimeInMilliseconds() - ms_nLastClockTick >
- ms_nMillisecondsPerGameMinute){
+
+ }
+ else if(CTimer::GetTimeInMilliseconds() - ms_nLastClockTick > ms_nMillisecondsPerGameMinute || gbFastTime)
+ {
ms_nGameClockMinutes++;
ms_nLastClockTick += ms_nMillisecondsPerGameMinute;
- if(ms_nGameClockMinutes >= 60){
+
+ if ( gbFastTime )
+ ms_nLastClockTick = CTimer::GetTimeInMilliseconds();
+
+ if(ms_nGameClockMinutes >= 60)
+ {
ms_nGameClockHours++;
ms_nGameClockMinutes = 0;
if(ms_nGameClockHours >= 24)
+ {
+ CStats::DaysPassed++;
ms_nGameClockHours = 0;
- // TODO: stats days passed
+ }
}
}
ms_nGameClockSeconds +=