From 19a08d19d683e6fc3eef3dc20c5f2583708bad7b Mon Sep 17 00:00:00 2001 From: Christian Haro <8536818-c-haro@users.noreply.gitlab.com> Date: Fri, 5 Aug 2022 16:19:57 +0000 Subject: [PATCH] Implementing profiler stats for LuaManager::synchronizedUpdate --- apps/openmw/engine.cpp | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/apps/openmw/engine.cpp b/apps/openmw/engine.cpp index 9e6643a577..b7b0b2d5d2 100644 --- a/apps/openmw/engine.cpp +++ b/apps/openmw/engine.cpp @@ -112,7 +112,7 @@ namespace World, Gui, Lua, - + LuaSyncUpdate, Number, }; @@ -152,6 +152,10 @@ namespace template <> const UserStats UserStatsValue::sValue {"Lua", "lua"}; + template <> + const UserStats UserStatsValue::sValue{ " -Sync", "luasyncupdate" }; + + template 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 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 {