1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-02-22 09:39:42 +00:00

Implementing profiler stats for LuaManager::synchronizedUpdate

This commit is contained in:
Christian Haro 2022-08-05 16:19:57 +00:00 committed by Alexei Kotov
parent a62b16df5d
commit 19a08d19d6

View file

@ -112,7 +112,7 @@ namespace
World,
Gui,
Lua,
LuaSyncUpdate,
Number,
};
@ -152,6 +152,10 @@ namespace
template <>
const UserStats UserStatsValue<UserStatsType::Lua>::sValue {"Lua", "lua"};
template <>
const UserStats UserStatsValue<UserStatsType::LuaSyncUpdate>::sValue{ " -Sync", "luasyncupdate" };
template <UserStatsType type>
struct ForEachUserStatsValue
{
@ -336,10 +340,13 @@ bool OMW::Engine::frame(float frametime)
// Main menu opened? Then scripts are also paused.
bool paused = mWindowManager->containsMode(MWGui::GM_MainMenu);
// Should be called after input manager update and before any change to the game world.
// It applies to the game world queued changes from the previous frame.
mLuaManager->synchronizedUpdate();
{
ScopedProfile<UserStatsType::LuaSyncUpdate> profile(frameStart, frameNumber, *timer, *stats);
// Should be called after input manager update and before any change to the game world.
// It applies to the game world queued changes from the previous frame.
mLuaManager->synchronizedUpdate();
}
// update game state
{