From 583a04f142bb7e55ac2b83542f1962a644d1f91d Mon Sep 17 00:00:00 2001 From: pineappleEA Date: Tue, 12 Apr 2022 21:13:58 +0200 Subject: [PATCH] early-access version 2671 --- README.md | 2 +- src/video_core/renderer_base.cpp | 4 ++++ src/video_core/renderer_base.h | 3 +++ src/yuzu/bootmanager.cpp | 5 +++++ 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 04e538701..a99658336 100755 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ yuzu emulator early access ============= -This is the source code for early-access 2670. +This is the source code for early-access 2671. ## Legal Notice diff --git a/src/video_core/renderer_base.cpp b/src/video_core/renderer_base.cpp index c9627cffd..9756a81d6 100755 --- a/src/video_core/renderer_base.cpp +++ b/src/video_core/renderer_base.cpp @@ -26,6 +26,10 @@ void RendererBase::UpdateCurrentFramebufferLayout() { render_window.UpdateCurrentFramebufferLayout(layout.width, layout.height); } +bool RendererBase::IsScreenshotPending() const { + return renderer_settings.screenshot_requested; +} + void RendererBase::RequestScreenshot(void* data, std::function callback, const Layout::FramebufferLayout& layout) { if (renderer_settings.screenshot_requested) { diff --git a/src/video_core/renderer_base.h b/src/video_core/renderer_base.h index c5f974080..30d19b178 100755 --- a/src/video_core/renderer_base.h +++ b/src/video_core/renderer_base.h @@ -83,6 +83,9 @@ public: /// Refreshes the settings common to all renderers void RefreshBaseSettings(); + /// Returns true if a screenshot is being processed + bool IsScreenshotPending() const; + /// Request a screenshot of the next frame void RequestScreenshot(void* data, std::function callback, const Layout::FramebufferLayout& layout); diff --git a/src/yuzu/bootmanager.cpp b/src/yuzu/bootmanager.cpp index 27b0300d2..8f17b6acb 100755 --- a/src/yuzu/bootmanager.cpp +++ b/src/yuzu/bootmanager.cpp @@ -933,6 +933,11 @@ void GRenderWindow::CaptureScreenshot(const QString& screenshot_path) { auto& renderer = system.Renderer(); const f32 res_scale = Settings::values.resolution_info.up_factor; + if (renderer.IsScreenshotPending()) { + LOG_ERROR(Render, "A screenshot is already requested or in progress, ignoring the request"); + return; + } + const Layout::FramebufferLayout layout{Layout::FrameLayoutFromResolutionScale(res_scale)}; screenshot_image = QImage(QSize(layout.width, layout.height), QImage::Format_RGB32); renderer.RequestScreenshot(