Add version to the recast log prefix

This commit is contained in:
elsid 2025-03-22 02:49:48 +01:00
parent d13f108779
commit 87a2f776b7
No known key found for this signature in database
GPG key ID: B845CB9FEE18AB40
3 changed files with 8 additions and 7 deletions

View file

@ -523,7 +523,7 @@ namespace DetourNavigator
std::unique_ptr<PreparedNavMeshData> prepareNavMeshTileData(const RecastMesh& recastMesh, ESM::RefId worldspace, std::unique_ptr<PreparedNavMeshData> prepareNavMeshTileData(const RecastMesh& recastMesh, ESM::RefId worldspace,
const TilePosition& tilePosition, const AgentBounds& agentBounds, const RecastSettings& settings) 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); const auto [minZ, maxZ] = getBoundsByZ(recastMesh, agentBounds.mHalfExtents.z(), settings);

View file

@ -23,20 +23,20 @@ namespace DetourNavigator
return Debug::Debug; return Debug::Debug;
} }
std::string formatPrefix( std::string formatPrefix(ESM::RefId worldspace, const TilePosition& tilePosition,
ESM::RefId worldspace, const TilePosition& tilePosition, const AgentBounds& agentBounds) const AgentBounds& agentBounds, const Version& version)
{ {
std::ostringstream stream; std::ostringstream stream;
stream << "Worldspace: " << worldspace << "; tile position: " << tilePosition.x() << ", " stream << "Worldspace: " << worldspace << "; tile position: " << tilePosition.x() << ", "
<< tilePosition.y() << "; agent bounds: " << agentBounds << "; "; << tilePosition.y() << "; agent bounds: " << agentBounds << "; version: " << version << "; ";
return stream.str(); return stream.str();
} }
} }
RecastContext::RecastContext(ESM::RefId worldspace, const TilePosition& tilePosition, 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) : mMaxLogLevel(maxLogLevel)
, mPrefix(formatPrefix(worldspace, tilePosition, agentBounds)) , mPrefix(formatPrefix(worldspace, tilePosition, agentBounds, version))
{ {
} }

View file

@ -13,12 +13,13 @@
namespace DetourNavigator namespace DetourNavigator
{ {
struct AgentBounds; struct AgentBounds;
struct Version;
class RecastContext final : public rcContext class RecastContext final : public rcContext
{ {
public: public:
explicit RecastContext(ESM::RefId worldspace, const TilePosition& tilePosition, const AgentBounds& agentBounds, 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; } const std::string& getPrefix() const { return mPrefix; }