Cleanups and use a thread for message box

This commit is contained in:
louist103 2025-06-21 16:40:51 -04:00
commit 354c5f081a
2 changed files with 13 additions and 17 deletions

View file

@ -607,6 +607,7 @@ 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 = 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);
#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());
@ -688,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);
}

View file

@ -894,20 +894,10 @@ void AnimationContext_SetLoadFrame(PlayState* play, LinkAnimationHeader* animati
if (ResourceMgr_OTRSigCheck(animation) != 0)
animation = ResourceMgr_LoadAnimByName(animation);
LinkAnimationHeader* playerAnimHeader = animation;
Vec3s* ram = frameTable;
// osCreateMesgQueue(&entry->data.load.msgQueue, &entry->data.load.msg, 1);
//
// 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
s16* animData = animation->segment;
// SOH [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.
if (frame < 0) {
frame = 0;