mtgs: make renderswitch save current state

This commit is contained in:
Gauvain 'GovanifY' Roussel-Tarbouriech 2021-06-16 03:18:30 +02:00 committed by Kojin
parent ab65f2ab5e
commit fa4f4bca73
2 changed files with 9 additions and 2 deletions

View File

@ -925,6 +925,7 @@ void SysMtgsThread::WaitForOpen()
void SysMtgsThread::Freeze(int mode, MTGS_FreezeData& data)
{
Resume();
WaitForOpen();
SendPointerPacket(GS_RINGTYPE_FREEZE, mode, &data);
Resume();
WaitGS();

View File

@ -400,9 +400,15 @@ namespace Implementations
return;
if (renderswitch_delay == 0)
{
GetMTGS().Suspend();
freezeData fP = {0, nullptr};
MTGS_FreezeData sstate = {&fP, 0};
GetMTGS().Freeze(FREEZE_SIZE, sstate);
fP.data = new char[fP.size];
GetMTGS().Freeze(FREEZE_SAVE, sstate);
GetMTGS().Suspend(true);
renderswitch = !renderswitch;
GetMTGS().Resume();
GetMTGS().Freeze(FREEZE_LOAD, sstate);
delete[] fP.data;
renderswitch_delay = -1;
}
}