mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Tools/vmap_extractor: Support new 9.2 wmo group splits (child groups should inherit their parent wmo group id)
This commit is contained in:
@@ -227,20 +227,30 @@ bool ExtractSingleWmo(std::string& fname)
|
||||
int Wmo_nVertices = 0;
|
||||
uint32 groupCount = 0;
|
||||
//printf("root has %d groups\n", froot->nGroups);
|
||||
std::vector<WMOGroup> groups;
|
||||
groups.reserve(froot.groupFileDataIDs.size());
|
||||
for (std::size_t i = 0; i < froot.groupFileDataIDs.size(); ++i)
|
||||
{
|
||||
std::string s = Trinity::StringFormat("FILE{:08X}.xxx", froot.groupFileDataIDs[i]);
|
||||
WMOGroup fgroup(s);
|
||||
WMOGroup& fgroup = groups.emplace_back(s);
|
||||
if (!fgroup.open(&froot))
|
||||
{
|
||||
printf("Could not open all Group file for: %s\n", plain_name);
|
||||
file_ok = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
for (WMOGroup& fgroup : groups)
|
||||
{
|
||||
if (fgroup.ShouldSkip(&froot))
|
||||
continue;
|
||||
|
||||
if (fgroup.mogpFlags2 & 0x80
|
||||
&& fgroup.parentOrFirstChildSplitGroupIndex >= 0
|
||||
&& fgroup.parentOrFirstChildSplitGroupIndex < groups.size())
|
||||
fgroup.groupWMOID = groups[fgroup.parentOrFirstChildSplitGroupIndex].groupWMOID;
|
||||
|
||||
Wmo_nVertices += fgroup.ConvertToVMAPGroupWmo(output, preciseVectorData);
|
||||
++groupCount;
|
||||
for (uint16 groupReference : fgroup.DoodadReferences)
|
||||
|
||||
@@ -249,7 +249,10 @@ bool WMOGroup::open(WMORoot* rootWMO)
|
||||
f.read(&nBatchC, 4);
|
||||
f.read(&fogIdx, 4);
|
||||
f.read(&groupLiquid, 4);
|
||||
f.read(&groupWMOID,4);
|
||||
f.read(&groupWMOID, 4);
|
||||
f.read(&mogpFlags2, 4);
|
||||
f.read(&parentOrFirstChildSplitGroupIndex, 2);
|
||||
f.read(&nextSplitChildGroupIndex, 2);
|
||||
|
||||
// according to WoW.Dev Wiki:
|
||||
if (rootWMO->flags & 4)
|
||||
|
||||
@@ -141,6 +141,9 @@ public:
|
||||
uint16 nBatchA;
|
||||
uint16 nBatchB;
|
||||
uint32 nBatchC, fogIdx, groupLiquid, groupWMOID;
|
||||
uint32 mogpFlags2;
|
||||
int16 parentOrFirstChildSplitGroupIndex;
|
||||
int16 nextSplitChildGroupIndex;
|
||||
|
||||
int moba_size;
|
||||
int LiquEx_size;
|
||||
@@ -151,6 +154,8 @@ public:
|
||||
std::vector<uint16> DoodadReferences;
|
||||
|
||||
WMOGroup(std::string const& filename);
|
||||
WMOGroup(WMOGroup&&) = default;
|
||||
WMOGroup& operator=(WMOGroup&&) = default;
|
||||
~WMOGroup();
|
||||
|
||||
bool open(WMORoot* rootWMO);
|
||||
|
||||
Reference in New Issue
Block a user