mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-09-27 06:02:25 -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 sSfxFadeOutDuration = 1.0f;
|
||||||
constexpr float sSoundCullDistance = 2000.f;
|
constexpr float sSoundCullDistance = 2000.f;
|
||||||
|
|
||||||
|
float physicsFramerate = 60.f;
|
||||||
|
|
||||||
WaterSoundUpdaterSettings makeWaterSoundUpdaterSettings()
|
WaterSoundUpdaterSettings makeWaterSoundUpdaterSettings()
|
||||||
{
|
{
|
||||||
WaterSoundUpdaterSettings settings;
|
WaterSoundUpdaterSettings settings;
|
||||||
@ -140,6 +142,13 @@ namespace MWSound
|
|||||||
return;
|
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::vector<std::string> names = mOutput->enumerate();
|
||||||
std::stringstream stream;
|
std::stringstream stream;
|
||||||
|
|
||||||
@ -961,14 +970,6 @@ namespace MWSound
|
|||||||
mUnderwaterSound = nullptr;
|
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->startUpdate();
|
||||||
mOutput->updateListener(mListenerPos, mListenerDir, mListenerUp, mListenerVel, env);
|
mOutput->updateListener(mListenerPos, mListenerDir, mListenerUp, mListenerVel, env);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user