From 87a2f776b79f842940375d4e371b8d85d699c303 Mon Sep 17 00:00:00 2001 From: elsid Date: Sat, 22 Mar 2025 02:49:48 +0100 Subject: [PATCH] Add version to the recast log prefix --- components/detournavigator/makenavmesh.cpp | 2 +- components/detournavigator/recastcontext.cpp | 10 +++++----- components/detournavigator/recastcontext.hpp | 3 ++- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/components/detournavigator/makenavmesh.cpp b/components/detournavigator/makenavmesh.cpp index 11751e631c..fe63d27a1e 100644 --- a/components/detournavigator/makenavmesh.cpp +++ b/components/detournavigator/makenavmesh.cpp @@ -523,7 +523,7 @@ namespace DetourNavigator std::unique_ptr prepareNavMeshTileData(const RecastMesh& recastMesh, ESM::RefId worldspace, const TilePosition& tilePosition, const AgentBounds& agentBounds, const RecastSettings& settings) { - RecastContext context(worldspace, tilePosition, agentBounds, settings.mMaxLogLevel); + RecastContext context(worldspace, tilePosition, agentBounds, recastMesh.getVersion(), settings.mMaxLogLevel); const auto [minZ, maxZ] = getBoundsByZ(recastMesh, agentBounds.mHalfExtents.z(), settings); diff --git a/components/detournavigator/recastcontext.cpp b/components/detournavigator/recastcontext.cpp index 89bb268b16..732517e423 100644 --- a/components/detournavigator/recastcontext.cpp +++ b/components/detournavigator/recastcontext.cpp @@ -23,20 +23,20 @@ namespace DetourNavigator return Debug::Debug; } - std::string formatPrefix( - ESM::RefId worldspace, const TilePosition& tilePosition, const AgentBounds& agentBounds) + std::string formatPrefix(ESM::RefId worldspace, const TilePosition& tilePosition, + const AgentBounds& agentBounds, const Version& version) { std::ostringstream stream; stream << "Worldspace: " << worldspace << "; tile position: " << tilePosition.x() << ", " - << tilePosition.y() << "; agent bounds: " << agentBounds << "; "; + << tilePosition.y() << "; agent bounds: " << agentBounds << "; version: " << version << "; "; return stream.str(); } } RecastContext::RecastContext(ESM::RefId worldspace, const TilePosition& tilePosition, - const AgentBounds& agentBounds, Debug::Level maxLogLevel) + const AgentBounds& agentBounds, const Version& version, Debug::Level maxLogLevel) : mMaxLogLevel(maxLogLevel) - , mPrefix(formatPrefix(worldspace, tilePosition, agentBounds)) + , mPrefix(formatPrefix(worldspace, tilePosition, agentBounds, version)) { } diff --git a/components/detournavigator/recastcontext.hpp b/components/detournavigator/recastcontext.hpp index 7c9d50951b..b36c4b9842 100644 --- a/components/detournavigator/recastcontext.hpp +++ b/components/detournavigator/recastcontext.hpp @@ -13,12 +13,13 @@ namespace DetourNavigator { struct AgentBounds; + struct Version; class RecastContext final : public rcContext { public: explicit RecastContext(ESM::RefId worldspace, const TilePosition& tilePosition, const AgentBounds& agentBounds, - Debug::Level maxLogLevel); + const Version& version, Debug::Level maxLogLevel); const std::string& getPrefix() const { return mPrefix; }