summaryrefslogtreecommitdiffstats
path: root/src/core/Clock.cpp
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2021-01-11 20:20:08 +0100
committeraap <aap@papnet.eu>2021-01-11 20:20:08 +0100
commit383142bcbeb39d7407bd88571c8a51823e9c6d71 (patch)
treea6698ded389d2a01cb7d1e1e3db9016ede92b3a7 /src/core/Clock.cpp
parentMerge branch 'lcs-dev' into lcs (diff)
downloadre3-383142bcbeb39d7407bd88571c8a51823e9c6d71.tar
re3-383142bcbeb39d7407bd88571c8a51823e9c6d71.tar.gz
re3-383142bcbeb39d7407bd88571c8a51823e9c6d71.tar.bz2
re3-383142bcbeb39d7407bd88571c8a51823e9c6d71.tar.lz
re3-383142bcbeb39d7407bd88571c8a51823e9c6d71.tar.xz
re3-383142bcbeb39d7407bd88571c8a51823e9c6d71.tar.zst
re3-383142bcbeb39d7407bd88571c8a51823e9c6d71.zip
Diffstat (limited to 'src/core/Clock.cpp')
-rw-r--r--src/core/Clock.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/core/Clock.cpp b/src/core/Clock.cpp
index b391e508..b0f0b34f 100644
--- a/src/core/Clock.cpp
+++ b/src/core/Clock.cpp
@@ -20,6 +20,7 @@ uint16 CClock::ms_Stored_nGameClockSeconds;
uint32 CClock::ms_nMillisecondsPerGameMinute;
uint32 CClock::ms_nLastClockTick;
bool CClock::ms_bClockHasBeenStored;
+float CClock::ms_EnvMapTimeMultiplicator;
#ifndef MASTER
bool gbFreezeTime;
@@ -35,6 +36,7 @@ CClock::Initialise(uint32 scale)
ms_nMillisecondsPerGameMinute = scale;
ms_nLastClockTick = CTimer::GetTimeInMilliseconds();
ms_bClockHasBeenStored = false;
+ ms_EnvMapTimeMultiplicator = 1.0f;
debug("CClock ready\n");
#ifndef MASTER
VarConsole.Add("Time (hour of day)", &ms_nGameClockHours, 1, 0, 23, true);
@@ -136,3 +138,10 @@ CClock::RestoreClock(void)
ms_nGameClockMinutes = ms_Stored_nGameClockMinutes;
ms_nGameClockSeconds = ms_Stored_nGameClockSeconds;
}
+
+void
+CClock::CalcEnvMapTimeMultiplicator(void)
+{
+ float nightness = Abs(ms_nGameClockHours/24.0f - 0.5f);
+ ms_EnvMapTimeMultiplicator = SQR(1.0f - nightness);;
+}