From 9b6f159d752df4371d8269eee192a7eb11d1fa94 Mon Sep 17 00:00:00 2001 From: zilmar Date: Mon, 25 Jan 2016 18:00:01 +1100 Subject: [PATCH] [Glide64] Remove GFXWindow --- Source/Glide64/Gfx_1.3.h | 1 - Source/Glide64/Main.cpp | 16 +--------------- Source/Glide64/rdp.cpp | 10 +++++++--- 3 files changed, 8 insertions(+), 19 deletions(-) diff --git a/Source/Glide64/Gfx_1.3.h b/Source/Glide64/Gfx_1.3.h index 673e2ce5f..521293169 100644 --- a/Source/Glide64/Gfx_1.3.h +++ b/Source/Glide64/Gfx_1.3.h @@ -364,7 +364,6 @@ extern "C" { } GFX_INFO; extern GFX_INFO gfx; - extern wxWindow * GFXWindow; extern bool no_dlist; typedef void (FX_CALL *GRCOLORCOMBINEEXT) (GrCCUColor_t a, diff --git a/Source/Glide64/Main.cpp b/Source/Glide64/Main.cpp index c10897ab2..fce5cc9e7 100644 --- a/Source/Glide64/Main.cpp +++ b/Source/Glide64/Main.cpp @@ -77,7 +77,6 @@ std::ofstream rdp_err; #endif GFX_INFO gfx; -wxWindow * GFXWindow = NULL; int to_fullscreen = FALSE; int GfxInitDone = FALSE; @@ -1158,12 +1157,6 @@ bool wxDLLApp::OnInit() void wxDLLApp::CleanUp() { wxApp::CleanUp(); - if (GFXWindow) - { - GFXWindow->SetHWND(NULL); - delete GFXWindow; - GFXWindow = NULL; - } } #ifndef __WINDOWS__ @@ -1209,8 +1202,6 @@ extern "C" int WINAPI DllMain(HINSTANCE hinst, } else if (fdwReason == DLL_PROCESS_DETACH) { - if (GFXWindow != NULL) - GFXWindow->SetHWND(NULL); return DllUnload(); } return TRUE; @@ -1395,7 +1386,7 @@ void CALL CloseDLL(void) { ext_ghq_shutdown(); settings.ghq_use = 0; - } +} #endif ReleaseGfx(); ZLUT_release(); @@ -1496,11 +1487,6 @@ int CALL InitiateGFX(GFX_INFO Gfx_Info) debug_init(); // Initialize debugger gfx = Gfx_Info; -#ifdef __WINDOWS__ - if (GFXWindow == NULL) - GFXWindow = new wxWindow(); - GFXWindow->SetHWND(gfx.hWnd); -#endif #ifdef WINPROC_OVERRIDE // [H.Morii] inject our own winproc so that "alt-enter to fullscreen" diff --git a/Source/Glide64/rdp.cpp b/Source/Glide64/rdp.cpp index 4e7017edc..65d0fdfd0 100644 --- a/Source/Glide64/rdp.cpp +++ b/Source/Glide64/rdp.cpp @@ -326,7 +326,7 @@ void microcheck() settings.ucode = GetSetting(Set_ucode); ReleaseGfx(); - wxMessageBox(stdstr_f("Error: uCode crc not found in INI, using currently selected uCode\n\n%08lx", uc_crc).c_str(), "Error", wxOK | wxICON_EXCLAMATION, GFXWindow); + MessageBox(gfx.hWnd, stdstr_f("Error: uCode crc not found in INI, using currently selected uCode\n\n%08lx", uc_crc).c_str(), "Error", MB_OK | MB_ICONEXCLAMATION); ucode_error_report = FALSE; // don't report any more ucode errors from this game } @@ -335,7 +335,7 @@ void microcheck() settings.ucode = GetSetting(Set_ucode); ReleaseGfx(); - wxMessageBox(stdstr_f("Error: Unsupported uCode!\n\ncrc: %08lx", uc_crc).c_str(), "Error", wxOK | wxICON_EXCLAMATION, GFXWindow); + MessageBox(gfx.hWnd, stdstr_f("Error: Unsupported uCode!\n\ncrc: %08lx", uc_crc).c_str(), "Error", MB_OK | MB_ICONEXCLAMATION); ucode_error_report = FALSE; // don't report any more ucode errors from this game } @@ -793,10 +793,14 @@ EXPORT void CALL ProcessDList(void) } #endif } - if (wxMessageBox(_T("The GFX plugin caused an exception and has been disabled.\nWould you like to turn it back on and attempt to continue?"), _T("Glide64 Exception"), wxYES_NO|wxICON_EXCLAMATION, GFXWindow) == wxNO) + if (MessageBox(gfx.hWnd, "The GFX plugin caused an exception and has been disabled.\nWould you like to turn it back on and attempt to continue?","Glide64 Exception", MB_YESNO|MB_ICONEXCLAMATION) == MB_NO) + { exception = TRUE; + } else + { to_fullscreen = TRUE; + } return; } #endif