refactor(Core/Collision): Store collision data on map context (#25049)

This commit is contained in:
Takenbacon
2026-03-22 18:33:04 -07:00
committed by GitHub
parent 80b6984274
commit 27b0ecc6dc
32 changed files with 527 additions and 992 deletions

View File

@@ -676,24 +676,20 @@ namespace MMAP
/**************************************************************************/
bool TerrainBuilder::loadVMap(uint32 mapID, uint32 tileX, uint32 tileY, MeshData& meshData)
{
IVMapMgr* vmapMgr = new VMapMgr2();
int result = vmapMgr->loadMap(m_vmapsPath.c_str(), mapID, tileX, tileY);
std::string const mapFileName = VMapMgr2::getMapFileName(mapID);
std::unique_ptr<StaticMapTree> staticTree = std::make_unique<StaticMapTree>(mapID, m_vmapsPath);
if (!staticTree->InitMap(mapFileName))
return false;
staticTree->LoadMapTile(tileX, tileY);
bool retval = false;
do
{
if (result == VMAP_LOAD_RESULT_ERROR)
break;
InstanceTreeMap instanceTrees;
((VMapMgr2*)vmapMgr)->GetInstanceMapTree(instanceTrees);
if (!instanceTrees[mapID])
break;
ModelInstance* models = nullptr;
uint32 count = 0;
instanceTrees[mapID]->GetModelInstances(models, count);
staticTree->GetModelInstances(models, count);
if (!models)
break;
@@ -829,9 +825,6 @@ namespace MMAP
}
} while (false);
vmapMgr->unloadMap(mapID, tileX, tileY);
delete vmapMgr;
return retval;
}