summaryrefslogtreecommitdiffstats
path: root/src/Clock.cpp
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2019-06-13 10:02:52 +0200
committerGitHub <noreply@github.com>2019-06-13 10:02:52 +0200
commit12697a855353a1d537310d8f6dc293a6549e68da (patch)
treef6b758692616132f34da18f549d3bb92fd882110 /src/Clock.cpp
parentsilly mistake (diff)
parentUpdate Pad.cpp (diff)
downloadre3-12697a855353a1d537310d8f6dc293a6549e68da.tar
re3-12697a855353a1d537310d8f6dc293a6549e68da.tar.gz
re3-12697a855353a1d537310d8f6dc293a6549e68da.tar.bz2
re3-12697a855353a1d537310d8f6dc293a6549e68da.tar.lz
re3-12697a855353a1d537310d8f6dc293a6549e68da.tar.xz
re3-12697a855353a1d537310d8f6dc293a6549e68da.tar.zst
re3-12697a855353a1d537310d8f6dc293a6549e68da.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 +=