feat(editor): tile availability checker, NPC marker diagnostics

- Load dialog shows green "Tile found" / red "Tile not found" indicator
  by checking the manifest before you attempt to load
- NPC marker build/render diagnostic logging to trace rendering issues
- Map browser and tile checker work together for easy existing zone loading
This commit is contained in:
Kelsi 2026-05-05 06:05:33 -07:00
parent a6b8cd75f6
commit 124ff5a54a
2 changed files with 17 additions and 2 deletions

View file

@ -331,8 +331,20 @@ void EditorUI::renderLoadDialog(EditorApp& app) {
loadTileX_ = std::max(0, std::min(63, loadTileX_));
loadTileY_ = std::max(0, std::min(63, loadTileY_));
ImGui::TextColored(ImVec4(0.6f, 0.6f, 0.6f, 1),
"Azeroth: 28-50 range. Kalimdor: 20-50 range.");
// Check if the selected tile exists
{
std::string testPath = std::string("world\\maps\\") + loadMapNameBuf_ + "\\" +
loadMapNameBuf_ + "_" + std::to_string(loadTileX_) + "_" +
std::to_string(loadTileY_) + ".adt";
std::string lower = testPath;
std::transform(lower.begin(), lower.end(), lower.begin(),
[](unsigned char c) { return std::tolower(c); });
bool exists = app.getAssetManager()->getManifest().hasEntry(lower);
if (exists)
ImGui::TextColored(ImVec4(0.3f, 0.9f, 0.3f, 1), "Tile found in manifest");
else
ImGui::TextColored(ImVec4(0.9f, 0.4f, 0.3f, 1), "Tile not found — try different coords");
}
ImGui::Spacing();
if (ImGui::Button("Load", ImVec2(120, 0))) { loadRequested_ = true; showLoadDialog_ = false; }

View file

@ -279,6 +279,7 @@ void EditorViewport::rebuildObjects(const std::vector<PlacedObject>& objects,
v.pos[0]=x; v.pos[1]=y; v.pos[2]=z+h; verts.push_back(v);
}
npcMarkerVertCount_ = static_cast<uint32_t>(verts.size());
LOG_INFO("NPC markers: ", npcs.size(), " npcs -> ", npcMarkerVertCount_, " verts");
VkBufferCreateInfo bi{VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO};
bi.size = verts.size() * sizeof(MV);
bi.usage = VK_BUFFER_USAGE_VERTEX_BUFFER_BIT;
@ -429,6 +430,8 @@ void EditorViewport::render(VkCommandBuffer cmd) {
if (npcMarkerVB_ && npcMarkerVertCount_ > 0) {
auto* wp = waterRenderer_.getPipeline();
auto* wl = waterRenderer_.getPipelineLayout();
static bool loggedOnce = false;
if (!loggedOnce) { loggedOnce = true; LOG_INFO("NPC render: vb=", (wp?"ok":"null"), " layout=", (wl?"ok":"null"), " verts=", npcMarkerVertCount_); }
if (wp && wl) {
vkCmdBindPipeline(cmd, VK_PIPELINE_BIND_POINT_GRAPHICS, wp);
vkCmdBindDescriptorSets(cmd, VK_PIPELINE_BIND_POINT_GRAPHICS, wl,