1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-04-18 14:42:27 +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, World,
Gui, Gui,
Lua, Lua,
LuaSyncUpdate,
Number, Number,
}; };
@ -152,6 +152,10 @@ namespace
template <> template <>
const UserStats UserStatsValue<UserStatsType::Lua>::sValue {"Lua", "lua"}; const UserStats UserStatsValue<UserStatsType::Lua>::sValue {"Lua", "lua"};
template <>
const UserStats UserStatsValue<UserStatsType::LuaSyncUpdate>::sValue{ " -Sync", "luasyncupdate" };
template <UserStatsType type> template <UserStatsType type>
struct ForEachUserStatsValue struct ForEachUserStatsValue
{ {
@ -337,9 +341,12 @@ bool OMW::Engine::frame(float frametime)
// Main menu opened? Then scripts are also paused. // Main menu opened? Then scripts are also paused.
bool paused = mWindowManager->containsMode(MWGui::GM_MainMenu); 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. ScopedProfile<UserStatsType::LuaSyncUpdate> profile(frameStart, frameNumber, *timer, *stats);
mLuaManager->synchronizedUpdate(); // 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 // update game state
{ {