feat(editor): zone map image export (colored top-down PNG)

- exportZoneMap(): renders terrain as colored top-down image with
  height-based coloring (blue lowlands → green plains → brown hills →
  white peaks), water overlay, hole visualization, doodad markers
- Configurable resolution (128-2048px, default 512)
- Auto-exported as zone_map.png alongside other assets on save
- File > Export Zone Map menu with resolution slider
- Useful for documentation, server admin tools, custom map websites
This commit is contained in:
Kelsi 2026-05-05 16:01:29 -07:00
parent 998d09e119
commit 84a431880e
4 changed files with 121 additions and 0 deletions

View file

@ -8,6 +8,7 @@
#include "quest_editor.hpp"
#include "pipeline/custom_zone_discovery.hpp"
#include "content_pack.hpp"
#include "wowee_terrain.hpp"
#include "pipeline/wowee_terrain_loader.hpp"
#include <filesystem>
#include "asset_browser.hpp"
@ -426,6 +427,22 @@ void EditorUI::renderMenuBar(EditorApp& app) {
}
ImGui::EndMenu();
}
if (ImGui::BeginMenu("Export Zone Map", app.hasTerrainLoaded())) {
static char mapPath[256] = "output/zone_map.png";
static int mapRes = 512;
ImGui::InputText("File##zonemap", mapPath, sizeof(mapPath));
ImGui::SliderInt("Resolution", &mapRes, 128, 2048);
if (ImGui::MenuItem("Export PNG")) {
if (editor::WoweeTerrain::exportZoneMap(
*app.getTerrainEditor().getTerrain(), mapPath, mapRes))
app.showToast("Zone map exported: " + std::string(mapPath));
else
app.showToast("Export failed");
}
ImGui::TextColored(ImVec4(0.5f,0.5f,0.5f,1),
"Top-down colored map with terrain, water, objects");
ImGui::EndMenu();
}
ImGui::Separator();
if (ImGui::MenuItem("Quit", "Alt+F4")) app.requestQuit();
ImGui::EndMenu();