mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-10 02:53:51 +00:00
refactor(editor): extract batch convert handlers into cli_convert.cpp
Moves the four bulk format-conversion handlers out of main.cpp: --convert-m2-batch (M2 → WOM) --convert-wmo-batch (WMO → WOB) --convert-blp-batch (BLP → PNG) --convert-dbc-batch (DBC → JSON) These all share the same pattern: walk srcDir recursively for files of the input extension and fan out to the single-file --convert-* counterpart via subprocess (preserving the existing per-file logic as the source of truth, no duplication). Single-file converters (--convert-m2, --convert-wmo, etc.) and the --migrate-* meta-commands still live in main.cpp; they're in dedicated argv-rescan loops that need a different extraction approach. main.cpp drops 18,396 → 18,198 lines (-198). Behavior verified by re-running --convert-blp-batch with a missing directory and confirming the same error message.
This commit is contained in:
parent
0c1f873029
commit
98c7621e1d
4 changed files with 276 additions and 203 deletions
22
tools/editor/cli_convert.hpp
Normal file
22
tools/editor/cli_convert.hpp
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
#pragma once
|
||||
|
||||
namespace wowee {
|
||||
namespace editor {
|
||||
namespace cli {
|
||||
|
||||
// Dispatch the batch format-conversion handlers:
|
||||
// --convert-m2-batch (M2 → WOM)
|
||||
// --convert-wmo-batch (WMO → WOB)
|
||||
// --convert-blp-batch (BLP → PNG)
|
||||
// --convert-dbc-batch (DBC → JSON)
|
||||
//
|
||||
// Each fans out to its single-file --convert-* counterpart via
|
||||
// subprocess so the existing per-file logic stays the source of
|
||||
// truth.
|
||||
//
|
||||
// Returns true if matched; outRc holds the exit code.
|
||||
bool handleConvert(int& i, int argc, char** argv, int& outRc);
|
||||
|
||||
} // namespace cli
|
||||
} // namespace editor
|
||||
} // namespace wowee
|
||||
Loading…
Add table
Add a link
Reference in a new issue