mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-23 07:40:14 +00:00
Replace MPQ runtime with loose file asset system
Extract assets from MPQ archives into organized loose files indexed by manifest.json, enabling fully parallel reads without StormLib serialization. Add asset_extract and blp_convert tools, PNG texture override support.
This commit is contained in:
parent
5fda1a3157
commit
aa16a687c2
16 changed files with 1427 additions and 101 deletions
62
tools/asset_extract/main.cpp
Normal file
62
tools/asset_extract/main.cpp
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
#include "extractor.hpp"
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include <cstring>
|
||||
|
||||
static void printUsage(const char* prog) {
|
||||
std::cout << "Usage: " << prog << " --mpq-dir <path> --output <path> [options]\n"
|
||||
<< "\n"
|
||||
<< "Extract WoW MPQ archives to organized loose files with manifest.\n"
|
||||
<< "\n"
|
||||
<< "Required:\n"
|
||||
<< " --mpq-dir <path> Path to WoW Data directory containing MPQ files\n"
|
||||
<< " --output <path> Output directory for extracted assets\n"
|
||||
<< "\n"
|
||||
<< "Options:\n"
|
||||
<< " --verify CRC32 verify all extracted files\n"
|
||||
<< " --threads <N> Number of extraction threads (default: auto)\n"
|
||||
<< " --verbose Verbose output\n"
|
||||
<< " --help Show this help\n";
|
||||
}
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
wowee::tools::Extractor::Options opts;
|
||||
|
||||
for (int i = 1; i < argc; ++i) {
|
||||
if (std::strcmp(argv[i], "--mpq-dir") == 0 && i + 1 < argc) {
|
||||
opts.mpqDir = argv[++i];
|
||||
} else if (std::strcmp(argv[i], "--output") == 0 && i + 1 < argc) {
|
||||
opts.outputDir = argv[++i];
|
||||
} else if (std::strcmp(argv[i], "--threads") == 0 && i + 1 < argc) {
|
||||
opts.threads = std::atoi(argv[++i]);
|
||||
} else if (std::strcmp(argv[i], "--verify") == 0) {
|
||||
opts.verify = true;
|
||||
} else if (std::strcmp(argv[i], "--verbose") == 0) {
|
||||
opts.verbose = true;
|
||||
} else if (std::strcmp(argv[i], "--help") == 0 || std::strcmp(argv[i], "-h") == 0) {
|
||||
printUsage(argv[0]);
|
||||
return 0;
|
||||
} else {
|
||||
std::cerr << "Unknown option: " << argv[i] << "\n";
|
||||
printUsage(argv[0]);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (opts.mpqDir.empty() || opts.outputDir.empty()) {
|
||||
std::cerr << "Error: --mpq-dir and --output are required\n\n";
|
||||
printUsage(argv[0]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
std::cout << "=== Wowee Asset Extractor ===\n";
|
||||
std::cout << "MPQ directory: " << opts.mpqDir << "\n";
|
||||
std::cout << "Output: " << opts.outputDir << "\n";
|
||||
|
||||
if (!wowee::tools::Extractor::run(opts)) {
|
||||
std::cerr << "Extraction failed!\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue