mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-08-24 07:05:34 -07:00
Cleanups and use a thread for message box
This commit is contained in:
parent
5f98123c37
commit
354c5f081a
2 changed files with 13 additions and 17 deletions
|
@ -607,6 +607,7 @@ std::string Extractor::Mkdtemp() {
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" int zapd_main(int argc, char** argv);
|
extern "C" int zapd_main(int argc, char** argv);
|
||||||
|
static void MessageboxWorker();
|
||||||
|
|
||||||
bool Extractor::CallZapd(std::string installPath, std::string exportdir) {
|
bool Extractor::CallZapd(std::string installPath, std::string exportdir) {
|
||||||
constexpr int argc = 22;
|
constexpr int argc = 22;
|
||||||
|
@ -669,10 +670,8 @@ bool Extractor::CallZapd(std::string installPath, std::string exportdir) {
|
||||||
SetWindowPos(cmdWindow, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE);
|
SetWindowPos(cmdWindow, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE);
|
||||||
#else
|
#else
|
||||||
// Show extraction in background message until linux/mac can have visual progress
|
// Show extraction in background message until linux/mac can have visual progress
|
||||||
SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_INFORMATION, "Extracting",
|
std::thread mbThread(MessageboxWorker);
|
||||||
"Extraction will now begin in the background.\n\nPlease be patient for the process to "
|
mbThread.detach();
|
||||||
"finish. Do not close the main program.",
|
|
||||||
nullptr);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
zapd_main(argc, (char**)argv.data());
|
zapd_main(argc, (char**)argv.data());
|
||||||
|
@ -688,5 +687,12 @@ bool Extractor::CallZapd(std::string installPath, std::string exportdir) {
|
||||||
std::filesystem::current_path(curdir);
|
std::filesystem::current_path(curdir);
|
||||||
std::filesystem::remove_all(tempdir);
|
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);
|
||||||
}
|
}
|
||||||
|
|
|
@ -894,20 +894,10 @@ void AnimationContext_SetLoadFrame(PlayState* play, LinkAnimationHeader* animati
|
||||||
if (ResourceMgr_OTRSigCheck(animation) != 0)
|
if (ResourceMgr_OTRSigCheck(animation) != 0)
|
||||||
animation = ResourceMgr_LoadAnimByName(animation);
|
animation = ResourceMgr_LoadAnimByName(animation);
|
||||||
|
|
||||||
LinkAnimationHeader* playerAnimHeader = animation;
|
|
||||||
Vec3s* ram = frameTable;
|
Vec3s* ram = frameTable;
|
||||||
|
|
||||||
// osCreateMesgQueue(&entry->data.load.msgQueue, &entry->data.load.msg, 1);
|
s16* animData = animation->segment;
|
||||||
//
|
// SOH [Port] sometimes a HESS can set a negative frame value from a negative playback speed. When converted to
|
||||||
// char animPath[2048];
|
|
||||||
//
|
|
||||||
// snprintf(animPath, sizeof(animPath), "misc/link_animetion/gPlayerAnimData_%06X",
|
|
||||||
// (((uintptr_t)linkAnimHeader->segmentVoid - 0x07000000)));
|
|
||||||
//
|
|
||||||
// printf("Streaming %s, seg = %08X\n", animPath, linkAnimHeader->segment);
|
|
||||||
|
|
||||||
s16* animData = /* ResourceMgr_LoadPlayerAnimByName*/ (animation->segment);
|
|
||||||
// 2S2H [Port] sometimes a HESS can set a negative frame value from a negative playback speed. When converted to
|
|
||||||
// a signed value this will cause a crash due to copying way much data.
|
// a signed value this will cause a crash due to copying way much data.
|
||||||
if (frame < 0) {
|
if (frame < 0) {
|
||||||
frame = 0;
|
frame = 0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue