feat: complete client integration for all 6 open formats

- Wire WOB buildings into WMO render pipeline (loads→converts→renders)
- Implement JSON DBC loading in DBCFile::loadJSON() with nlohmann/json
- Wire JSON DBC override into AssetManager (custom_zones/output scan)
- Add WMO→WOB conversion with full geometry (fromWMO)
- Replace placeholder WOB export with real WMO→WOB conversion in editor
- Add --convert-wmo CLI flag for batch WMO→WOB conversion
- Store discovered custom zones on Renderer with getCustomZones() accessor
- Add isCustomZone_ member to TerrainManager

All 6 Blizzard format replacements now fully load in the client:
  ADT→WOT/WHM, WDT→zone.json, BLP→PNG, DBC→JSON, M2→WOM, WMO→WOB
This commit is contained in:
Kelsi 2026-05-05 12:41:19 -07:00
parent d8f2388635
commit 4fc0361f7a
11 changed files with 271 additions and 47 deletions

View file

@ -312,23 +312,30 @@ std::shared_ptr<DBCFile> AssetManager::loadDBC(const std::string& name) {
}
// Check for JSON DBC from custom zones (wowee open format)
// JSON DBCs exported by the editor contain the same record data
// but the DBCFile::load() only handles binary — so JSON overrides
// are logged for now and will need a JSON→DBC converter in future.
if (dbcData.empty()) {
std::string baseName = name;
auto dot = baseName.rfind('.');
if (dot != std::string::npos) baseName = baseName.substr(0, dot);
for (const std::string& dir : {"custom_zones", "output"}) {
for (const char* dir : {"custom_zones", "output"}) {
if (!std::filesystem::exists(dir)) continue;
for (auto& entry : std::filesystem::directory_iterator(dir)) {
if (!entry.is_directory()) continue;
std::string jsonPath = entry.path().string() + "/data/" + baseName + ".json";
if (std::filesystem::exists(jsonPath)) {
LOG_DEBUG("JSON DBC available (not yet loaded): ", jsonPath);
std::ifstream jf(jsonPath, std::ios::binary | std::ios::ate);
if (jf) {
auto sz = jf.tellg();
if (sz > 0) {
dbcData.resize(static_cast<size_t>(sz));
jf.seekg(0);
jf.read(reinterpret_cast<char*>(dbcData.data()), sz);
LOG_INFO("Loading JSON DBC override: ", jsonPath);
}
}
break;
}
}
if (!dbcData.empty()) break;
}
}