From d4f4d82c4d7d4b1e5a117a48680c1cc67f5bc87d Mon Sep 17 00:00:00 2001 From: Graham Pentheny Date: Tue, 5 Aug 2025 13:45:31 -0400 Subject: [PATCH] Clean up some UI rendering in solo mesh sample build controls --- RecastDemo/Source/Sample_SoloMesh.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/RecastDemo/Source/Sample_SoloMesh.cpp b/RecastDemo/Source/Sample_SoloMesh.cpp index 54890d0a..3756f305 100644 --- a/RecastDemo/Source/Sample_SoloMesh.cpp +++ b/RecastDemo/Source/Sample_SoloMesh.cpp @@ -92,27 +92,25 @@ void Sample_SoloMesh::cleanup() void Sample_SoloMesh::handleSettings() { + static const char* fileName = "solo_navmesh.bin"; + handleCommonSettings(); - ImGui::Separator(); - + ImGui::PushItemWidth(ImGui::GetContentRegionAvail().x); if (ImGui::Button("Save")) { - saveAll("solo_navmesh.bin", navMesh); + saveAll(fileName, navMesh); } - ImGui::SameLine(); - if (ImGui::Button("Load")) { dtFreeNavMesh(navMesh); - navMesh = loadAll("solo_navmesh.bin"); + navMesh = loadAll(fileName); navQuery->init(navMesh, 2048); } + ImGui::PopItemWidth(); ImGui::Text("Build Time: %.1fms", totalBuildTimeMs); - - ImGui::Separator(); } void Sample_SoloMesh::handleTools()