Browse Source
Merge pull request #8192 from german77/screenshot
bootmanager: Don't create another screenshot request if previous one is not done yet
pull/15/merge
Mai M
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with
13 additions and
0 deletions
-
src/video_core/renderer_base.cpp
-
src/video_core/renderer_base.h
-
src/yuzu/bootmanager.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<void(bool)> callback, |
|
|
|
const Layout::FramebufferLayout& layout) { |
|
|
|
if (renderer_settings.screenshot_requested) { |
|
|
|
|
|
|
|
@ -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<void(bool)> callback, |
|
|
|
const Layout::FramebufferLayout& layout); |
|
|
|
|
|
|
|
@ -933,6 +933,12 @@ 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_WARNING(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( |
|
|
|
|