summaryrefslogtreecommitdiff
path: root/src/KingSystem/World
diff options
context:
space:
mode:
authorBriggs Baltzell <b3apollo13@gmail.com>2023-07-01 15:29:40 -0500
committerGitHub <noreply@github.com>2023-07-01 21:29:40 +0100
commitfd527f92164b8efdb746cffcf23c4f033fbffa76 (patch)
tree492976adfdf031252c85de91a185bfd625738a0c /src/KingSystem/World
parentbdd6e57d63bde1714fb42197ac4080833ac6b572 (diff)
Added VFR::getDeltaFrame (#122)
* Added getDeltaFrame and changed getDeltaTime * Replaced getDeltaTime usages with getDeltaFrame * Moved getDeltaTime above getDeltaFrame
Diffstat (limited to 'src/KingSystem/World')
-rw-r--r--src/KingSystem/World/worldEnvMgr.cpp10
-rw-r--r--src/KingSystem/World/worldTimeMgr.cpp4
2 files changed, 7 insertions, 7 deletions
diff --git a/src/KingSystem/World/worldEnvMgr.cpp b/src/KingSystem/World/worldEnvMgr.cpp
index 9341b8f1..f2a473a0 100644
--- a/src/KingSystem/World/worldEnvMgr.cpp
+++ b/src/KingSystem/World/worldEnvMgr.cpp
@@ -345,14 +345,14 @@ void EnvMgr::updateForcedBloodMoon() {
case 1:
// Update the forced blood moon timer
if (evt::Manager::instance()->hasActiveEvent() || mBloodMoonProhibited) {
- mForcedBloodMoonTimer -= VFR::instance()->getDeltaTime();
+ mForcedBloodMoonTimer -= VFR::instance()->getDeltaFrame();
if (mForcedBloodMoonTimer <= 0.0f) {
mForcedBloodMoonTimer = 0.0f;
mForcedBloodMoonStatus = 0;
mForcedBloodMoonReady = false;
}
} else {
- mForcedBloodMoonTimer += VFR::instance()->getDeltaTime();
+ mForcedBloodMoonTimer += VFR::instance()->getDeltaFrame();
if (mForcedBloodMoonTimer >= BloodMoonTimerDuration) {
mForcedBloodMoonTimer = BloodMoonTimerDuration;
mForcedBloodMoonReady = true;
@@ -376,7 +376,7 @@ void EnvMgr::updateForcedBloodMoon() {
case 3:
// Slowly fade out the blood moon state
- mForcedBloodMoonTimer -= VFR::instance()->getDeltaTime();
+ mForcedBloodMoonTimer -= VFR::instance()->getDeltaFrame();
if (mForcedBloodMoonTimer <= 0.0f) {
mForcedBloodMoonTimer = 0.0f;
mForcedBloodMoonStatus = 0;
@@ -389,14 +389,14 @@ void EnvMgr::updateForcedBloodMoon() {
case 4:
// [Alternative state 2] Wait for blood moons to be allowed again
if (mBloodMoonProhibited && !mDeactivateForcedBloodMoon) {
- mForcedBloodMoonTimer -= VFR::instance()->getDeltaTime();
+ mForcedBloodMoonTimer -= VFR::instance()->getDeltaFrame();
if (mForcedBloodMoonTimer <= 0.0f) {
mForcedBloodMoonTimer = 0.0f;
mForcedBloodMoonStatus = 0;
return;
}
} else {
- mForcedBloodMoonTimer += VFR::instance()->getDeltaTime();
+ mForcedBloodMoonTimer += VFR::instance()->getDeltaFrame();
if (mForcedBloodMoonTimer >= BloodMoonTimerDuration) {
mForcedBloodMoonTimer = BloodMoonTimerDuration;
mForcedBloodMoonReady = true;
diff --git a/src/KingSystem/World/worldTimeMgr.cpp b/src/KingSystem/World/worldTimeMgr.cpp
index 1c2b5a40..39e213bc 100644
--- a/src/KingSystem/World/worldTimeMgr.cpp
+++ b/src/KingSystem/World/worldTimeMgr.cpp
@@ -317,7 +317,7 @@ void TimeMgr::calc_() {
if (!mPlayedDemo103Or997 || evt::Manager::instance()->hasActiveEvent())
break;
- const auto delta = mTimeStep * VFR::instance()->getDeltaTime();
+ const auto delta = mTimeStep * VFR::instance()->getDeltaFrame();
mIsTimeFlowingNormally = true;
mTime += delta;
if (mTime >= 24_h) {
@@ -431,7 +431,7 @@ void TimeMgr::calc_() {
break;
case TimeUpdateMode::OnlyUpdateTimeOfDay:
- mTime += mTimeStep * VFR::instance()->getDeltaTime();
+ mTime += mTimeStep * VFR::instance()->getDeltaFrame();
if (mTime >= 24_h)
mTime -= 24_h;
break;