mirror of https://github.com/PCSX2/pcsx2.git
gs: ensure the panel doesn't open at all when unneeded
This commit is contained in:
parent
b06468e268
commit
7597ac12b6
|
@ -52,6 +52,7 @@ using namespace Threading;
|
||||||
|
|
||||||
__aligned(32) MTGS_BufferedData RingBuffer;
|
__aligned(32) MTGS_BufferedData RingBuffer;
|
||||||
extern bool renderswitch;
|
extern bool renderswitch;
|
||||||
|
std::atomic_bool init_gspanel = true;
|
||||||
|
|
||||||
|
|
||||||
#ifdef RINGBUF_DEBUG_STACK
|
#ifdef RINGBUF_DEBUG_STACK
|
||||||
|
@ -242,6 +243,7 @@ void SysMtgsThread::OpenGS()
|
||||||
if (m_Opened)
|
if (m_Opened)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (init_gspanel)
|
||||||
sApp.OpenGsPanel();
|
sApp.OpenGsPanel();
|
||||||
|
|
||||||
memcpy(RingBuffer.Regs, PS2MEM_GS, sizeof(PS2MEM_GS));
|
memcpy(RingBuffer.Regs, PS2MEM_GS, sizeof(PS2MEM_GS));
|
||||||
|
@ -596,6 +598,7 @@ void SysMtgsThread::CloseGS()
|
||||||
return;
|
return;
|
||||||
m_Opened = false;
|
m_Opened = false;
|
||||||
GSclose();
|
GSclose();
|
||||||
|
if (init_gspanel)
|
||||||
sApp.CloseGsPanel();
|
sApp.CloseGsPanel();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -51,6 +51,8 @@
|
||||||
|
|
||||||
using namespace Dialogs;
|
using namespace Dialogs;
|
||||||
|
|
||||||
|
extern std::atomic_bool init_gspanel;
|
||||||
|
|
||||||
void MainEmuFrame::Menu_SysSettings_Click(wxCommandEvent& event)
|
void MainEmuFrame::Menu_SysSettings_Click(wxCommandEvent& event)
|
||||||
{
|
{
|
||||||
AppOpenDialog<SysConfigDialog>(this);
|
AppOpenDialog<SysConfigDialog>(this);
|
||||||
|
@ -91,20 +93,27 @@ void MainEmuFrame::Menu_PADSettings_Click(wxCommandEvent& event)
|
||||||
void MainEmuFrame::Menu_GSSettings_Click(wxCommandEvent& event)
|
void MainEmuFrame::Menu_GSSettings_Click(wxCommandEvent& event)
|
||||||
{
|
{
|
||||||
ScopedCoreThreadPause paused_core;
|
ScopedCoreThreadPause paused_core;
|
||||||
bool is_frame_closed = (wxGetApp().GetGsFramePtr() == nullptr);
|
bool is_frame_init = !(wxGetApp().GetGsFramePtr() == nullptr);
|
||||||
if (!is_frame_closed)
|
bool need_shutdown = GetMTGS().IsClosed();
|
||||||
is_frame_closed = !wxGetApp().GetGsFramePtr()->IsShown();
|
init_gspanel = false;
|
||||||
freezeData fP = {0, nullptr};
|
freezeData fP = {0, nullptr};
|
||||||
MTGS_FreezeData sstate = {&fP, 0};
|
MTGS_FreezeData sstate = {&fP, 0};
|
||||||
|
if (is_frame_init)
|
||||||
|
{
|
||||||
GetMTGS().Freeze(FREEZE_SIZE, sstate);
|
GetMTGS().Freeze(FREEZE_SIZE, sstate);
|
||||||
fP.data = new char[fP.size];
|
fP.data = new char[fP.size];
|
||||||
GetMTGS().Freeze(FREEZE_SAVE, sstate);
|
GetMTGS().Freeze(FREEZE_SAVE, sstate);
|
||||||
GetMTGS().Suspend(true);
|
GetMTGS().Suspend(true);
|
||||||
|
}
|
||||||
GSconfigure();
|
GSconfigure();
|
||||||
|
if (is_frame_init)
|
||||||
|
{
|
||||||
GetMTGS().Freeze(FREEZE_LOAD, sstate);
|
GetMTGS().Freeze(FREEZE_LOAD, sstate);
|
||||||
delete[] fP.data;
|
delete[] fP.data;
|
||||||
if (is_frame_closed)
|
}
|
||||||
wxGetApp().GetGsFramePtr()->Hide();
|
if (need_shutdown)
|
||||||
|
GetMTGS().Suspend(true);
|
||||||
|
init_gspanel = true;
|
||||||
paused_core.AllowResume();
|
paused_core.AllowResume();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue