2
0
mirror of https://github.com/Laupetin/OpenAssetTools.git synced 2026-06-06 16:52:35 +00:00

feat: report on unlinking progress

This commit is contained in:
Jan Laupetin
2025-10-14 23:20:56 +01:00
parent 9fa41ca0d3
commit c6e9cbedda
159 changed files with 686 additions and 802 deletions
+14 -1
View File
@@ -34,11 +34,20 @@ bool ObjWriter::DumpZone(AssetDumpingContext& context) const
if (assetPools->poolName && ObjWriting::ShouldHandleAssetType(assetType)) \
{ \
dumperType dumper; \
dumper.DumpPool(context, assetPools->poolName.get()); \
totalProgress += dumper.GetProgressTotalCount(*assetPools->poolName); \
dumpingFunctions.emplace_back( \
[](AssetDumpingContext& funcContext, const GameAssetPoolIW4* funcPools) \
{ \
dumperType dumper; \
dumper.DumpPool(funcContext, *funcPools->poolName); \
}); \
}
const auto* assetPools = dynamic_cast<GameAssetPoolIW4*>(context.m_zone.m_pools.get());
size_t totalProgress = 0uz;
std::vector<std::function<void(AssetDumpingContext & context, const GameAssetPoolIW4*)>> dumpingFunctions;
DUMP_ASSET_POOL(phys_preset::InfoStringDumperIW4, m_phys_preset, ASSET_TYPE_PHYSPRESET)
DUMP_ASSET_POOL(phys_collmap::DumperIW4, m_phys_collmap, ASSET_TYPE_PHYSCOLLMAP)
// DUMP_ASSET_POOL(AssetDumperXAnimParts, m_xanim_parts, ASSET_TYPE_XANIMPARTS)
@@ -78,6 +87,10 @@ bool ObjWriter::DumpZone(AssetDumpingContext& context) const
DUMP_ASSET_POOL(vehicle::DumperIW4, m_vehicle, ASSET_TYPE_VEHICLE)
DUMP_ASSET_POOL(addon_map_ents::DumperIW4, m_addon_map_ents, ASSET_TYPE_ADDON_MAP_ENTS)
context.SetTotalProgress(totalProgress);
for (const auto& func : dumpingFunctions)
func(context, assetPools);
return true;
#undef DUMP_ASSET_POOL