Merge pull request #4346 from degasus/framedump_sw
VideoSW: Use VideoCommon frame dumping.
This commit is contained in:
commit
5541237b74
|
@ -123,28 +123,10 @@ void SWRenderer::SwapImpl(u32 xfbAddr, u32 fbWidth, u32 fbStride, u32 fbHeight,
|
|||
}
|
||||
|
||||
// Save screenshot
|
||||
if (s_bScreenshot)
|
||||
if (IsFrameDumping())
|
||||
{
|
||||
std::lock_guard<std::mutex> lk(s_criticalScreenshot);
|
||||
|
||||
if (TextureToPng(GetCurrentColorTexture(), fbWidth * 4, s_sScreenshotName, fbWidth, fbHeight,
|
||||
false))
|
||||
OSD::AddMessage("Screenshot saved to " + s_sScreenshotName);
|
||||
|
||||
// Reset settings
|
||||
s_sScreenshotName.clear();
|
||||
s_bScreenshot = false;
|
||||
s_screenshotCompleted.Set();
|
||||
}
|
||||
|
||||
if (SConfig::GetInstance().m_DumpFrames)
|
||||
{
|
||||
static int frame_index = 0;
|
||||
TextureToPng(GetCurrentColorTexture(), fbWidth * 4,
|
||||
StringFromFormat("%sframe%i_color.png",
|
||||
File::GetUserPath(D_DUMPFRAMES_IDX).c_str(), frame_index),
|
||||
fbWidth, fbHeight, true);
|
||||
frame_index++;
|
||||
DumpFrameData(GetCurrentColorTexture(), fbWidth, fbHeight, fbWidth * 4, ticks);
|
||||
FinishFrameData();
|
||||
}
|
||||
|
||||
OSD::DoCallbacks(OSD::CallbackType::OnFrame);
|
||||
|
|
Loading…
Reference in New Issue