mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-08 10:03:51 +00:00
fix(wob): emit default doodadSet so WMO renderer draws WoB doodads
WMORenderer uses doodadSets[0] to select which slice of the doodads array to render. Without a set entry the renderer skipped every doodad even when toWMOModel populated them. Now emits a default set named 'Set_$DefaultGlobal' covering all doodads — matches Blizzard's default set name and convention.
This commit is contained in:
parent
f2bbc8d60f
commit
318f255918
1 changed files with 13 additions and 0 deletions
|
|
@ -276,6 +276,7 @@ bool WoweeBuildingLoader::toWMOModel(const WoweeBuilding& building, WMOModel& ou
|
|||
// assign sequential offsets here since none of our paths share suffixes.
|
||||
outModel.doodads.clear();
|
||||
outModel.doodadNames.clear();
|
||||
outModel.doodadSets.clear();
|
||||
uint32_t doodadOffset = 0;
|
||||
for (const auto& dp : building.doodads) {
|
||||
// Convert WOM extension back to M2 for the runtime that may not have a
|
||||
|
|
@ -303,6 +304,18 @@ bool WoweeBuildingLoader::toWMOModel(const WoweeBuilding& building, WMOModel& ou
|
|||
doodadOffset += static_cast<uint32_t>(mp.size() + 1);
|
||||
}
|
||||
|
||||
// Renderer uses doodadSets[0] to know which slice of doodads to render.
|
||||
// Without it, even with doodads populated, nothing draws. Emit a default
|
||||
// "Set_$DefaultGlobal" set covering every doodad.
|
||||
if (!outModel.doodads.empty()) {
|
||||
WMODoodadSet ds{};
|
||||
std::strncpy(ds.name, "Set_$DefaultGlobal", sizeof(ds.name) - 1);
|
||||
ds.startIndex = 0;
|
||||
ds.count = static_cast<uint32_t>(outModel.doodads.size());
|
||||
ds.padding = 0;
|
||||
outModel.doodadSets.push_back(ds);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue