diff --git a/apps/openmw/engine.cpp b/apps/openmw/engine.cpp index ee2ce7ae3e..7393562cfb 100644 --- a/apps/openmw/engine.cpp +++ b/apps/openmw/engine.cpp @@ -105,7 +105,7 @@ namespace }); // the forEachUserStatsValue loop is "run" at compile time, hence the settings manager is not available. // Unconditionnally add the async physics stats, and then remove it at runtime if necessary - if (Settings::Manager::getInt("async num threads", "Physics") == 0) + if (Settings::physics().mAsyncNumThreads == 0) profiler.removeUserStatsLine(" -Async"); } diff --git a/apps/openmw/mwphysics/mtphysics.cpp b/apps/openmw/mwphysics/mtphysics.cpp index 653380decf..52b96d9d13 100644 --- a/apps/openmw/mwphysics/mtphysics.cpp +++ b/apps/openmw/mwphysics/mtphysics.cpp @@ -16,8 +16,8 @@ #include "components/debug/debuglog.hpp" #include "components/misc/convert.hpp" -#include "components/settings/settings.hpp" #include +#include #include "../mwmechanics/actorutil.hpp" #include "../mwmechanics/creaturestats.hpp" @@ -314,7 +314,7 @@ namespace MWPhysics LockingPolicy detectLockingPolicy() { - if (Settings::Manager::getInt("async num threads", "Physics") < 1) + if (Settings::physics().mAsyncNumThreads < 1) return LockingPolicy::NoLocks; if (getMaxBulletSupportedThreads() > 1) return LockingPolicy::AllowSharedLocks; @@ -331,8 +331,8 @@ namespace MWPhysics case LockingPolicy::ExclusiveLocksOnly: return 1; case LockingPolicy::AllowSharedLocks: - return std::clamp( - Settings::Manager::getInt("async num threads", "Physics"), 0, getMaxBulletSupportedThreads()); + return static_cast(std::clamp( + Settings::physics().mAsyncNumThreads, 0, static_cast(getMaxBulletSupportedThreads()))); } throw std::runtime_error("Unsupported LockingPolicy: " @@ -407,7 +407,7 @@ namespace MWPhysics , mNumThreads(getNumThreads(mLockingPolicy)) , mNumJobs(0) , mRemainingSteps(0) - , mLOSCacheExpiry(Settings::Manager::getInt("lineofsight keep inactive cache", "Physics")) + , mLOSCacheExpiry(Settings::physics().mLineofsightKeepInactiveCache) , mAdvanceSimulation(false) , mNextJob(0) , mNextLOS(0)