mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-08 01:53:52 +00:00
feat(extract): incremental --upgrade-extract skips up-to-date sidecars
Compares the source file's mtime against the sidecar's; if the
sidecar is newer, the conversion is skipped and counted into
stats.skipped. Re-running --upgrade-extract on a fully-converted
tree is now nearly free (just an mtime check per file).
asset_extract --upgrade-extract Data/expansions/wotlk
Walking ... (first run)
JSON (DBC→JSON) : 240 ok
asset_extract --upgrade-extract Data/expansions/wotlk
Walking ... (second run, all sidecars up to date)
up-to-date (skip) : 240
JSON (DBC→JSON) : 0 ok
emitOpenFormats() takes a new optional 'incremental' flag (default
false to preserve the asset_extract main-loop's overwrite behavior
since fresh extraction always wants new sidecars).
Verified end-to-end with a hand-built DBC: first run converts,
second run reports 'up-to-date (skip): 1'.
This commit is contained in:
parent
463a8cd751
commit
397034a750
3 changed files with 49 additions and 8 deletions
|
|
@ -22,6 +22,9 @@ struct OpenFormatStats {
|
|||
uint32_t wobOk = 0, wobFail = 0;
|
||||
uint32_t whmOk = 0, whmFail = 0;
|
||||
uint32_t wocOk = 0, wocFail = 0;
|
||||
// Files where the sidecar already existed and was newer than the
|
||||
// proprietary source — skipped (incremental mode).
|
||||
uint32_t skipped = 0;
|
||||
};
|
||||
|
||||
// Convert one BLP file on disk to a PNG side-file.
|
||||
|
|
@ -51,12 +54,15 @@ bool emitTerrainFromAdt(const std::string& adtPath, const std::string& outBase);
|
|||
// Walk an extracted-asset directory and emit open-format side-files for
|
||||
// every requested format. Counts accumulated into stats.
|
||||
// `threadCount` 0 = auto-detect from hardware_concurrency().
|
||||
// If `incremental` is true, files whose sidecar already exists and is
|
||||
// newer than the proprietary source are skipped (counted in stats.skipped).
|
||||
void emitOpenFormats(const std::string& rootDir,
|
||||
bool emitPng, bool emitJsonDbc,
|
||||
bool emitWom, bool emitWob,
|
||||
bool emitTerrain,
|
||||
OpenFormatStats& stats,
|
||||
unsigned int threadCount = 0);
|
||||
unsigned int threadCount = 0,
|
||||
bool incremental = false);
|
||||
|
||||
} // namespace tools
|
||||
} // namespace wowee
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue