From bc4047d81552d825ea9f960cdaffe6fdc2ef3a6a Mon Sep 17 00:00:00 2001 From: fredzio Date: Fri, 12 Feb 2021 19:03:02 +0100 Subject: [PATCH 1/2] Update engine stats for all levels above first, not only at the second. --- components/resource/stats.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/resource/stats.cpp b/components/resource/stats.cpp index 690814f91..4d07889d0 100644 --- a/components/resource/stats.cpp +++ b/components/resource/stats.cpp @@ -127,7 +127,7 @@ bool Profiler::handle(const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter if (viewer) { // Add/remove openmw stats to the osd as necessary - viewer->getViewerStats()->collectStats("engine", _statsType == StatsHandler::StatsType::VIEWER_STATS); + viewer->getViewerStats()->collectStats("engine", _statsType >= StatsHandler::StatsType::VIEWER_STATS); if (_offlineCollect) CollectStatistics(viewer); From 9d90e250cf51993d817874209936dd6dd59d3fb1 Mon Sep 17 00:00:00 2001 From: fredzio Date: Fri, 12 Feb 2021 19:33:08 +0100 Subject: [PATCH 2/2] Physics is not running while paused, so zero the stats for the async thread instead of keeping whatever value was before the pause. --- apps/openmw/mwworld/worldimp.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/apps/openmw/mwworld/worldimp.cpp b/apps/openmw/mwworld/worldimp.cpp index d21c17a51..1f3a2428c 100644 --- a/apps/openmw/mwworld/worldimp.cpp +++ b/apps/openmw/mwworld/worldimp.cpp @@ -1861,6 +1861,13 @@ namespace MWWorld { doPhysics (duration, frameStart, frameNumber, stats); } + else + { + // zero the async stats if we are paused + stats.setAttribute(frameNumber, "physicsworker_time_begin", 0); + stats.setAttribute(frameNumber, "physicsworker_time_taken", 0); + stats.setAttribute(frameNumber, "physicsworker_time_end", 0); + } } void World::updatePlayer()