2
0
mirror of https://github.com/Laupetin/OpenAssetTools.git synced 2026-06-07 17:22:34 +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
@@ -17,11 +17,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 GameAssetPoolT5* funcPools) \
{ \
dumperType dumper; \
dumper.DumpPool(funcContext, *funcPools->poolName); \
}); \
}
const auto* assetPools = dynamic_cast<GameAssetPoolT5*>(context.m_zone.m_pools.get());
size_t totalProgress = 0uz;
std::vector<std::function<void(AssetDumpingContext & context, const GameAssetPoolT5*)>> dumpingFunctions;
// DUMP_ASSET_POOL(AssetDumperPhysPreset, m_phys_preset, ASSET_TYPE_PHYSPRESET)
// DUMP_ASSET_POOL(AssetDumperPhysConstraints, m_phys_constraints, ASSET_TYPE_PHYSCONSTRAINTS)
// DUMP_ASSET_POOL(AssetDumperDestructibleDef, m_destructible_def, ASSET_TYPE_DESTRUCTIBLEDEF)
@@ -55,6 +64,10 @@ bool ObjWriter::DumpZone(AssetDumpingContext& context) const
// DUMP_ASSET_POOL(AssetDumperGlasses, m_glasses, ASSET_TYPE_GLASSES)
// DUMP_ASSET_POOL(AssetDumperEmblemSet, m_emblem_set, ASSET_TYPE_EMBLEMSET)
context.SetTotalProgress(totalProgress);
for (const auto& func : dumpingFunctions)
func(context, assetPools);
return true;
#undef DUMP_ASSET_POOL