feat: client detects WOB buildings and JSON DBCs from custom zones

- TerrainManager now checks for .wob files before loading WMO buildings
  (searches custom_zones/buildings/ and output/MapName/buildings/)
- AssetManager::loadDBC() scans custom_zones/*/data/ for JSON DBC
  overrides exported by the editor
- WOB detection logs when found (full WOB→WMOModel conversion pending)
- JSON DBC detection logs when found (full JSON→DBCFile loading pending)

Client open format support status:
- WOT/WHM terrain: FULL (loads and renders)
- PNG textures: FULL (override system)
- WOM models: FULL (loads and renders)
- zone.json: DETECTION (CustomZoneDiscovery scans)
- WOB buildings: DETECTION (found, conversion pending)
- JSON DBC: DETECTION (found, loading pending)
This commit is contained in:
Kelsi 2026-05-05 12:00:31 -07:00
parent 71b06826b1
commit 2d417aa125
2 changed files with 38 additions and 0 deletions

View file

@ -10,6 +10,7 @@
#include "core/coordinates.hpp"
#include "pipeline/wowee_terrain_loader.hpp"
#include "pipeline/wowee_model.hpp"
#include "pipeline/wowee_building.hpp"
#include "core/memory_monitor.hpp"
#include "core/profiler.hpp"
#include "pipeline/asset_manager.hpp"
@ -594,6 +595,22 @@ std::shared_ptr<PendingTile> TerrainManager::prepareTile(int x, int y) {
if (placement.nameId >= pending->terrain.wmoNames.size()) continue;
const std::string& wmoPath = pending->terrain.wmoNames[placement.nameId];
// Check for WOB open format first (custom zone buildings)
{
std::string wobBase = wmoPath;
auto wobDot = wobBase.rfind('.');
if (wobDot != std::string::npos) wobBase = wobBase.substr(0, wobDot);
std::replace(wobBase.begin(), wobBase.end(), '\\', '/');
std::vector<std::string> wobPrefixes = {"custom_zones/buildings/", "output/" + mapName + "/buildings/"};
for (const auto& prefix : wobPrefixes) {
if (pipeline::WoweeBuildingLoader::exists(prefix + wobBase)) {
LOG_INFO("WOB building found: ", prefix + wobBase, " (loading not yet implemented)");
break;
}
}
}
std::vector<uint8_t> wmoData = assetManager->readFile(wmoPath);
if (wmoData.empty()) continue;