mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 22:29:39 -06:00
Apply More Core::RunAsCPUThread
In places where applicable, Core::RunAsCPUThread has replaced Core::SetState workarounds to pause and resume emulation for thread-sensitive operations. - void Core::SaveScreenShot() - void Core::SaveScreenShot(std::string_view name) - void JitInterface::GetProfileResults(Profiler::ProfileStats *prof_stats) - void MainWindow::OnExportRecording()
This commit is contained in:
@ -732,26 +732,14 @@ static std::string GenerateScreenshotName()
|
||||
|
||||
void SaveScreenShot()
|
||||
{
|
||||
const bool bPaused = GetState() == State::Paused;
|
||||
|
||||
SetState(State::Paused);
|
||||
|
||||
g_renderer->SaveScreenshot(GenerateScreenshotName());
|
||||
|
||||
if (!bPaused)
|
||||
SetState(State::Running);
|
||||
Core::RunAsCPUThread([] { g_renderer->SaveScreenshot(GenerateScreenshotName()); });
|
||||
}
|
||||
|
||||
void SaveScreenShot(std::string_view name)
|
||||
{
|
||||
const bool bPaused = GetState() == State::Paused;
|
||||
|
||||
SetState(State::Paused);
|
||||
|
||||
g_renderer->SaveScreenshot(fmt::format("{}{}.png", GenerateScreenshotFolderPath(), name));
|
||||
|
||||
if (!bPaused)
|
||||
SetState(State::Running);
|
||||
Core::RunAsCPUThread([&name] {
|
||||
g_renderer->SaveScreenshot(fmt::format("{}{}.png", GenerateScreenshotFolderPath(), name));
|
||||
});
|
||||
}
|
||||
|
||||
void RequestRefreshInfo()
|
||||
|
Reference in New Issue
Block a user