Add AssetDumperContext to bundle context fields for dumping

(cherry picked from commit ed8331280392ef3a2b4657c5dbd0880463d85f2c)
This commit is contained in:
Jan
2021-03-05 18:11:56 +01:00
parent 88c48e8107
commit abb268a819
56 changed files with 191 additions and 156 deletions

View File

@ -20,21 +20,21 @@
using namespace T6;
bool ZoneDumper::CanHandleZone(Zone* zone) const
bool ZoneDumper::CanHandleZone(AssetDumpingContext& context) const
{
return zone->m_game == &g_GameT6;
return context.m_zone->m_game == &g_GameT6;
}
bool ZoneDumper::DumpZone(Zone* zone, const std::string& basePath) const
bool ZoneDumper::DumpZone(AssetDumpingContext& context) const
{
#define DUMP_ASSET_POOL(dumperType, poolName) \
if(assetPools->poolName) \
{ \
dumperType dumper; \
dumper.DumpPool(zone, assetPools->poolName, basePath); \
dumper.DumpPool(context, assetPools->poolName); \
}
const auto* assetPools = dynamic_cast<GameAssetPoolT6*>(zone->m_pools.get());
const auto* assetPools = dynamic_cast<GameAssetPoolT6*>(context.m_zone->m_pools.get());
DUMP_ASSET_POOL(AssetDumperPhysPreset, m_phys_preset);
DUMP_ASSET_POOL(AssetDumperPhysConstraints, m_phys_constraints);