mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-10 02:53:51 +00:00
50 lines
1.3 KiB
C++
50 lines
1.3 KiB
C++
|
|
#include "editor_app.hpp"
|
||
|
|
#include "core/logger.hpp"
|
||
|
|
#include <string>
|
||
|
|
#include <cstring>
|
||
|
|
|
||
|
|
static void printUsage(const char* argv0) {
|
||
|
|
LOG_INFO("Usage: ", argv0, " --data <path> [--adt <map> <x> <y>]");
|
||
|
|
LOG_INFO(" --data <path> Path to extracted WoW data (contains manifest.json)");
|
||
|
|
LOG_INFO(" --adt <map> <x> <y> Load an ADT tile on startup");
|
||
|
|
}
|
||
|
|
|
||
|
|
int main(int argc, char* argv[]) {
|
||
|
|
std::string dataPath;
|
||
|
|
std::string adtMap;
|
||
|
|
int adtX = -1, adtY = -1;
|
||
|
|
|
||
|
|
for (int i = 1; i < argc; i++) {
|
||
|
|
if (std::strcmp(argv[i], "--data") == 0 && i + 1 < argc) {
|
||
|
|
dataPath = argv[++i];
|
||
|
|
} else if (std::strcmp(argv[i], "--adt") == 0 && i + 3 < argc) {
|
||
|
|
adtMap = argv[++i];
|
||
|
|
adtX = std::atoi(argv[++i]);
|
||
|
|
adtY = std::atoi(argv[++i]);
|
||
|
|
} else if (std::strcmp(argv[i], "--help") == 0 || std::strcmp(argv[i], "-h") == 0) {
|
||
|
|
printUsage(argv[0]);
|
||
|
|
return 0;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
if (dataPath.empty()) {
|
||
|
|
dataPath = "Data";
|
||
|
|
LOG_INFO("No --data path specified, using default: ", dataPath);
|
||
|
|
}
|
||
|
|
|
||
|
|
wowee::editor::EditorApp app;
|
||
|
|
if (!app.initialize(dataPath)) {
|
||
|
|
LOG_ERROR("Failed to initialize editor");
|
||
|
|
return 1;
|
||
|
|
}
|
||
|
|
|
||
|
|
if (!adtMap.empty()) {
|
||
|
|
app.loadADT(adtMap, adtX, adtY);
|
||
|
|
}
|
||
|
|
|
||
|
|
app.run();
|
||
|
|
app.shutdown();
|
||
|
|
|
||
|
|
return 0;
|
||
|
|
}
|