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,
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);

View file

@ -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))
{
}

View file

@ -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; }