mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2026-01-12 11:41:50 +00:00
feat: report on unlinking progress
This commit is contained in:
@@ -19,11 +19,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 GameAssetPoolIW3* funcPools) \
|
||||
{ \
|
||||
dumperType dumper; \
|
||||
dumper.DumpPool(funcContext, *funcPools->poolName); \
|
||||
}); \
|
||||
}
|
||||
|
||||
const auto* assetPools = dynamic_cast<GameAssetPoolIW3*>(context.m_zone.m_pools.get());
|
||||
|
||||
size_t totalProgress = 0uz;
|
||||
std::vector<std::function<void(AssetDumpingContext & context, const GameAssetPoolIW3*)>> dumpingFunctions;
|
||||
|
||||
// DUMP_ASSET_POOL(AssetDumperPhysPreset, m_phys_preset, ASSET_TYPE_PHYSPRESET)
|
||||
// DUMP_ASSET_POOL(AssetDumperXAnimParts, m_xanim_parts, ASSET_TYPE_XANIMPARTS)
|
||||
DUMP_ASSET_POOL(xmodel::DumperIW3, m_xmodel, ASSET_TYPE_XMODEL)
|
||||
@@ -51,6 +60,10 @@ bool ObjWriter::DumpZone(AssetDumpingContext& context) const
|
||||
DUMP_ASSET_POOL(raw_file::DumperIW3, m_raw_file, ASSET_TYPE_RAWFILE)
|
||||
DUMP_ASSET_POOL(string_table::DumperIW3, m_string_table, ASSET_TYPE_STRINGTABLE)
|
||||
|
||||
context.SetTotalProgress(totalProgress);
|
||||
for (const auto& func : dumpingFunctions)
|
||||
func(context, assetPools);
|
||||
|
||||
return true;
|
||||
|
||||
#undef DUMP_ASSET_POOL
|
||||
|
||||
Reference in New Issue
Block a user