mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-09-26 13:43:32 -04:00
cache physics framerate at start instead of checking every update
This commit is contained in:
parent
ce666db34f
commit
ba361302a1
@ -43,6 +43,8 @@ namespace MWSound
|
||||
constexpr float sSfxFadeOutDuration = 1.0f;
|
||||
constexpr float sSoundCullDistance = 2000.f;
|
||||
|
||||
float physicsFramerate = 60.f;
|
||||
|
||||
WaterSoundUpdaterSettings makeWaterSoundUpdaterSettings()
|
||||
{
|
||||
WaterSoundUpdaterSettings settings;
|
||||
@ -140,6 +142,13 @@ namespace MWSound
|
||||
return;
|
||||
}
|
||||
|
||||
if (const char* env = getenv("OPENMW_PHYSICS_FPS"))
|
||||
{
|
||||
if (const auto physFramerate = Misc::StringUtils::toNumeric<float>(env);
|
||||
physFramerate.has_value() && *physFramerate > 0)
|
||||
physicsFramerate = *physFramerate;
|
||||
}
|
||||
|
||||
std::vector<std::string> names = mOutput->enumerate();
|
||||
std::stringstream stream;
|
||||
|
||||
@ -961,14 +970,6 @@ namespace MWSound
|
||||
mUnderwaterSound = nullptr;
|
||||
}
|
||||
|
||||
float physicsFramerate = 60.f;
|
||||
if (const char* env = getenv("OPENMW_PHYSICS_FPS"))
|
||||
{
|
||||
if (const auto physFramerate = Misc::StringUtils::toNumeric<float>(env);
|
||||
physFramerate.has_value() && *physFramerate > 0)
|
||||
physicsFramerate = *physFramerate;
|
||||
}
|
||||
|
||||
mOutput->startUpdate();
|
||||
mOutput->updateListener(mListenerPos, mListenerDir, mListenerUp, mListenerVel, env);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user