mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-10 02:53:51 +00:00
refactor(editor): extract single-file --convert-* into cli_convert_single.cpp
Moves the five single-file format converters (--convert-m2,
--convert-wmo, --convert-dbc-json, --convert-json-dbc,
--convert-blp-png) out of two dedicated post-loop blocks in
main.cpp into a new cli_convert_single.{hpp,cpp} module. The
batch wrappers in cli_convert.cpp keep working — they shell
out to wowee_editor with these flags.
main.cpp shrinks by ~335 lines (10,979 → 10,644). The two
trailing for-loops were dead code after wiring the dispatcher
into the main loop, so they're gone too.
This commit is contained in:
parent
2658e8297a
commit
0d2312ec8d
4 changed files with 420 additions and 340 deletions
27
tools/editor/cli_convert_single.hpp
Normal file
27
tools/editor/cli_convert_single.hpp
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
#pragma once
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace wowee {
|
||||
namespace editor {
|
||||
namespace cli {
|
||||
|
||||
// Dispatch the single-file format-conversion handlers. These are
|
||||
// the source-of-truth implementations; the batch wrappers in
|
||||
// cli_convert.cpp shell out to wowee_editor with these flags.
|
||||
// --convert-m2 M2 → WOM (uses asset manager + dataPath)
|
||||
// --convert-wmo WMO → WOB (uses asset manager + dataPath)
|
||||
// --convert-dbc-json DBC → JSON sidecar
|
||||
// --convert-json-dbc JSON sidecar → binary DBC
|
||||
// --convert-blp-png BLP → PNG
|
||||
//
|
||||
// dataPath is mutated to "Data" if empty so the M2/WMO handlers
|
||||
// have a default location to look in.
|
||||
//
|
||||
// Returns true if matched; outRc holds the exit code.
|
||||
bool handleConvertSingle(int& i, int argc, char** argv,
|
||||
std::string& dataPath, int& outRc);
|
||||
|
||||
} // namespace cli
|
||||
} // namespace editor
|
||||
} // namespace wowee
|
||||
Loading…
Add table
Add a link
Reference in a new issue