mirror of https://github.com/PCSX2/pcsx2.git
gs: reimplement renderer switch sstate
This commit is contained in:
parent
18bc19a09c
commit
a7ff19ac98
|
@ -401,10 +401,28 @@ namespace Implementations
|
||||||
if (renderswitch_delay == 0)
|
if (renderswitch_delay == 0)
|
||||||
{
|
{
|
||||||
ScopedCoreThreadPause paused_core;
|
ScopedCoreThreadPause paused_core;
|
||||||
// TODO: add back saving/freezing of gs here -- govanify
|
std::unique_ptr<VmStateBuffer> plugstore;
|
||||||
|
GSFreezeData fP = {0, NULL};
|
||||||
|
GSfreeze(FREEZE_SIZE, &fP);
|
||||||
|
u8* data = new u8[fP.size];
|
||||||
|
fP.data = data;
|
||||||
|
if (CoreThread.HasActiveMachine())
|
||||||
|
{
|
||||||
|
plugstore = std::make_unique<VmStateBuffer>(L"StateCopy_RenderToggle");
|
||||||
|
memSavingState save(plugstore.get());
|
||||||
|
GSfreeze(FREEZE_SAVE, &fP);
|
||||||
|
}
|
||||||
|
GSclose();
|
||||||
|
if (plugstore)
|
||||||
|
{
|
||||||
|
memLoadingState load(plugstore.get());
|
||||||
|
GSfreeze(FREEZE_LOAD, &fP);
|
||||||
|
}
|
||||||
renderswitch = !renderswitch;
|
renderswitch = !renderswitch;
|
||||||
paused_core.AllowResume();
|
GSopen2((void**)pDsp, (renderswitch << 24));
|
||||||
renderswitch_delay = -1;
|
renderswitch_delay = -1;
|
||||||
|
delete[] fP.data;
|
||||||
|
paused_core.AllowResume();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -468,12 +486,8 @@ namespace Implementations
|
||||||
|
|
||||||
// make the recording setup dialog[s] pseudo-modal also for the main PCSX2 window
|
// make the recording setup dialog[s] pseudo-modal also for the main PCSX2 window
|
||||||
// (the GSdx dialog is already properly modal for the GS window)
|
// (the GSdx dialog is already properly modal for the GS window)
|
||||||
bool needsMainFrameEnable = false;
|
|
||||||
if (GetMainFramePtr() && GetMainFramePtr()->IsEnabled())
|
if (GetMainFramePtr() && GetMainFramePtr()->IsEnabled())
|
||||||
{
|
|
||||||
needsMainFrameEnable = true;
|
|
||||||
GetMainFramePtr()->Disable();
|
GetMainFramePtr()->Disable();
|
||||||
}
|
|
||||||
|
|
||||||
// GSsetupRecording can be aborted/canceled by the user. Don't go on to record the audio if that happens.
|
// GSsetupRecording can be aborted/canceled by the user. Don't go on to record the audio if that happens.
|
||||||
std::string filename;
|
std::string filename;
|
||||||
|
|
Loading…
Reference in New Issue