From 306211a1b4a034d6fb9ae5ca3259f1f7eb7d7b64 Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Wed, 25 Jan 2023 22:14:46 +0100 Subject: [PATCH] Fix naveditor log when invoked using commandline Log must be reset pre-build, and dump post-build in order for logging to work. --- r5dev/naveditor/EditorInterfaces.cpp | 2 +- r5dev/naveditor/Editor_TileMesh.cpp | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/r5dev/naveditor/EditorInterfaces.cpp b/r5dev/naveditor/EditorInterfaces.cpp index da907359..b6cb0136 100644 --- a/r5dev/naveditor/EditorInterfaces.cpp +++ b/r5dev/naveditor/EditorInterfaces.cpp @@ -12,7 +12,6 @@ BuildContext::BuildContext() : m_textPoolSize(0) { memset(m_messages, 0, sizeof(char*) * MAX_MESSAGES); - resetTimers(); } @@ -21,6 +20,7 @@ void BuildContext::doResetLog() { m_messageCount = 0; m_textPoolSize = 0; + memset(m_textPool, '\0', sizeof(m_textPool)); } void BuildContext::doLog(const rcLogCategory category, const char* msg, const int len) diff --git a/r5dev/naveditor/Editor_TileMesh.cpp b/r5dev/naveditor/Editor_TileMesh.cpp index dcc9ab16..bf146ef4 100644 --- a/r5dev/naveditor/Editor_TileMesh.cpp +++ b/r5dev/naveditor/Editor_TileMesh.cpp @@ -415,7 +415,7 @@ void Editor_TileMesh::handleDebugMode() if (unavail) { - imguiValue("Tick 'Keep Itermediate Results'"); + imguiValue("Tick 'Keep Intermediate Results'"); imguiValue("rebuild some tiles to see"); imguiValue("more debug mode options."); } @@ -792,8 +792,12 @@ void Editor_TileMesh::buildAllHulls() m_navmeshName = h.name; m_tileSize = h.tile_size; + m_ctx->resetLog(); + handleSettings(); handleBuild(); + + m_ctx->dumpLog("Build log %s:", h.name); Editor::saveAll(m_modelName.c_str(), m_navMesh); } }