mirror of
https://github.com/HarbourMasters/Shipwright
synced 2026-07-07 06:05:37 -04:00
Tools update (#5454)
* Bump ZAPDTR & OTRExporter. Changes to use o2r by default Changes to the new player animation format # Conflicts: # OTRExporter # ZAPDTR # soh/soh/OTRGlobals.cpp # soh/src/code/z_skelanime.c * Fix actions * Format * Cherry pick ZAPDTR * Update exporter * Move configs to port * Remove copy * Remove more XML copies * Remove extractor directory from actions builds. * Fix OTRExporter for linux * FIx ZAPD volatile * Format * Fix extractor? * Fix linux * Fix * Remove appimage stuff * Screnity now * Remove ZAPD from install paths * Remove soh.sh.in * Fix linux * Cleanups and use a thread for message box
This commit is contained in:
@@ -607,15 +607,16 @@ std::string Extractor::Mkdtemp() {
|
||||
}
|
||||
|
||||
extern "C" int zapd_main(int argc, char** argv);
|
||||
static void MessageboxWorker();
|
||||
|
||||
bool Extractor::CallZapd(std::string installPath, std::string exportdir) {
|
||||
constexpr int argc = 18;
|
||||
constexpr int argc = 22;
|
||||
char xmlPath[1024];
|
||||
char confPath[1024];
|
||||
char portVersion[18]; // 5 digits for int16_max (x3) + separators + terminator
|
||||
std::array<const char*, argc> argv;
|
||||
const char* version = GetZapdVerStr();
|
||||
const char* otrFile = IsMasterQuest() ? "oot-mq.otr" : "oot.otr";
|
||||
const char* otrFile = IsMasterQuest() ? "oot-mq.o2r" : "oot.o2r";
|
||||
|
||||
std::string romPath = std::filesystem::absolute(mCurrentRomPath).string();
|
||||
installPath = std::filesystem::absolute(installPath).string();
|
||||
@@ -632,8 +633,8 @@ bool Extractor::CallZapd(std::string installPath, std::string exportdir) {
|
||||
|
||||
std::filesystem::current_path(tempdir);
|
||||
|
||||
snprintf(xmlPath, 1024, "assets/extractor/xmls/%s", version);
|
||||
snprintf(confPath, 1024, "assets/extractor/Config_%s.xml", version);
|
||||
snprintf(xmlPath, 1024, "assets/xml/%s", version);
|
||||
snprintf(confPath, 1024, "assets/Config_%s.xml", version);
|
||||
snprintf(portVersion, 18, "%d.%d.%d", gBuildVersionMajor, gBuildVersionMinor, gBuildVersionPatch);
|
||||
|
||||
argv[0] = "ZAPD";
|
||||
@@ -643,9 +644,9 @@ bool Extractor::CallZapd(std::string installPath, std::string exportdir) {
|
||||
argv[4] = "-b";
|
||||
argv[5] = romPath.c_str();
|
||||
argv[6] = "-fl";
|
||||
argv[7] = "assets/extractor/filelists";
|
||||
argv[7] = "assets/filelists";
|
||||
argv[8] = "-gsf";
|
||||
argv[9] = "1";
|
||||
argv[9] = "0";
|
||||
argv[10] = "-rconf";
|
||||
argv[11] = confPath;
|
||||
argv[12] = "-se";
|
||||
@@ -654,6 +655,10 @@ bool Extractor::CallZapd(std::string installPath, std::string exportdir) {
|
||||
argv[15] = otrFile;
|
||||
argv[16] = "--portVer";
|
||||
argv[17] = portVersion;
|
||||
argv[18] = "-o";
|
||||
argv[19] = "placeholder";
|
||||
argv[20] = "-osf";
|
||||
argv[21] = "placeholder";
|
||||
|
||||
#ifdef _WIN32
|
||||
// Grab a handle to the command window.
|
||||
@@ -665,10 +670,8 @@ bool Extractor::CallZapd(std::string installPath, std::string exportdir) {
|
||||
SetWindowPos(cmdWindow, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE);
|
||||
#else
|
||||
// Show extraction in background message until linux/mac can have visual progress
|
||||
SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_INFORMATION, "Extracting",
|
||||
"Extraction will now begin in the background.\n\nPlease be patient for the process to "
|
||||
"finish. Do not close the main program.",
|
||||
nullptr);
|
||||
std::thread mbThread(MessageboxWorker);
|
||||
mbThread.detach();
|
||||
#endif
|
||||
|
||||
zapd_main(argc, (char**)argv.data());
|
||||
@@ -684,5 +687,12 @@ bool Extractor::CallZapd(std::string installPath, std::string exportdir) {
|
||||
std::filesystem::current_path(curdir);
|
||||
std::filesystem::remove_all(tempdir);
|
||||
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
static void MessageboxWorker() {
|
||||
SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_INFORMATION, "Extracting",
|
||||
"Extraction will now begin in the background.\n\nPlease be patient for the process to "
|
||||
"finish. Do not close the main program.",
|
||||
nullptr);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user