1
0
Fork 0
forked from suyu/suyu

Merge pull request #6837 from german77/no-pause-screenshot

main: Avoid stopping emulation when taking a screenshot
This commit is contained in:
Ameer J 2021-08-09 23:49:48 -04:00 committed by GitHub
commit 9fbe188c01
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2814,8 +2814,6 @@ void GMainWindow::OnToggleFilterBar() {
} }
void GMainWindow::OnCaptureScreenshot() { void GMainWindow::OnCaptureScreenshot() {
OnPauseGame();
const u64 title_id = Core::System::GetInstance().CurrentProcess()->GetTitleID(); const u64 title_id = Core::System::GetInstance().CurrentProcess()->GetTitleID();
const auto screenshot_path = const auto screenshot_path =
QString::fromStdString(Common::FS::GetYuzuPathString(Common::FS::YuzuPath::ScreenshotsDir)); QString::fromStdString(Common::FS::GetYuzuPathString(Common::FS::YuzuPath::ScreenshotsDir));
@ -2827,23 +2825,22 @@ void GMainWindow::OnCaptureScreenshot() {
.arg(date); .arg(date);
if (!Common::FS::CreateDir(screenshot_path.toStdString())) { if (!Common::FS::CreateDir(screenshot_path.toStdString())) {
OnStartGame();
return; return;
} }
#ifdef _WIN32 #ifdef _WIN32
if (UISettings::values.enable_screenshot_save_as) { if (UISettings::values.enable_screenshot_save_as) {
OnPauseGame();
filename = QFileDialog::getSaveFileName(this, tr("Capture Screenshot"), filename, filename = QFileDialog::getSaveFileName(this, tr("Capture Screenshot"), filename,
tr("PNG Image (*.png)")); tr("PNG Image (*.png)"));
OnStartGame();
if (filename.isEmpty()) { if (filename.isEmpty()) {
OnStartGame();
return; return;
} }
} }
#endif #endif
render_window->CaptureScreenshot(UISettings::values.screenshot_resolution_factor.GetValue(), render_window->CaptureScreenshot(UISettings::values.screenshot_resolution_factor.GetValue(),
filename); filename);
OnStartGame();
} }
// TODO: Written 2020-10-01: Remove per-game config migration code when it is irrelevant // TODO: Written 2020-10-01: Remove per-game config migration code when it is irrelevant