GPU: Ensure screenshots are saved before shutdown

This commit is contained in:
Stenzek
2024-03-15 15:04:57 +10:00
parent 5054d46075
commit 6aa491f863
3 changed files with 128 additions and 64 deletions

View File

@ -4364,20 +4364,7 @@ bool System::SaveScreenshot(const char* filename, DisplayScreenshotMode mode, Di
filename = auto_filename.c_str();
}
if (FileSystem::FileExists(filename))
{
Host::AddFormattedOSDMessage(10.0f, TRANSLATE("OSDMessage", "Screenshot file '%s' already exists."), filename);
return false;
}
if (!g_gpu->RenderScreenshotToFile(filename, mode, quality, compress_on_thread))
{
Host::AddFormattedOSDMessage(10.0f, TRANSLATE("OSDMessage", "Failed to save screenshot to '%s'"), filename);
return false;
}
Host::AddFormattedOSDMessage(5.0f, TRANSLATE("OSDMessage", "Screenshot saved to '%s'."), filename);
return true;
return g_gpu->RenderScreenshotToFile(filename, mode, quality, compress_on_thread, true);
}
std::string System::GetGameSaveStateFileName(const std::string_view& serial, s32 slot)