From d2c78ee88cc89b41206c7703fed64eef3cdb2bbc Mon Sep 17 00:00:00 2001 From: Kuyondo Date: Sat, 12 Jul 2025 22:14:47 +0800 Subject: [PATCH] move member var to implementation --- apps/openmw/mwgui/timeadvancer.cpp | 12 +++++++++--- apps/openmw/mwgui/timeadvancer.hpp | 1 - 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/apps/openmw/mwgui/timeadvancer.cpp b/apps/openmw/mwgui/timeadvancer.cpp index abe0a668d4..c4bdc030c2 100644 --- a/apps/openmw/mwgui/timeadvancer.cpp +++ b/apps/openmw/mwgui/timeadvancer.cpp @@ -1,5 +1,11 @@ #include "timeadvancer.hpp" +namespace +{ + // Time per hour tick + constexpr float kProgressStepDelay = 1.0f / 60.0f; +} + namespace MWGui { TimeAdvancer::TimeAdvancer() @@ -7,7 +13,7 @@ namespace MWGui , mCurHour(0) , mHours(1) , mInterruptAt(-1) - , mRemainingTime(mDelay) + , mRemainingTime(kProgressStepDelay) { } @@ -16,7 +22,7 @@ namespace MWGui mHours = hours; mCurHour = 0; mInterruptAt = interruptAt; - mRemainingTime = mDelay; + mRemainingTime = kProgressStepDelay; mRunning = true; } @@ -42,7 +48,7 @@ namespace MWGui while (mRemainingTime <= 0) { - mRemainingTime += mDelay; + mRemainingTime += kProgressStepDelay; ++mCurHour; if (mCurHour <= mHours) diff --git a/apps/openmw/mwgui/timeadvancer.hpp b/apps/openmw/mwgui/timeadvancer.hpp index be19619d25..e69153aed4 100644 --- a/apps/openmw/mwgui/timeadvancer.hpp +++ b/apps/openmw/mwgui/timeadvancer.hpp @@ -32,7 +32,6 @@ namespace MWGui int mHours; int mInterruptAt; - static constexpr float mDelay = 1.0f / 60.0f; float mRemainingTime; }; }