early-access version 2671

This commit is contained in:
pineappleEA 2022-04-12 21:13:58 +02:00
parent 915c2ef167
commit 583a04f142
4 changed files with 13 additions and 1 deletions

View File

@ -1,7 +1,7 @@
yuzu emulator early access yuzu emulator early access
============= =============
This is the source code for early-access 2670. This is the source code for early-access 2671.
## Legal Notice ## Legal Notice

View File

@ -26,6 +26,10 @@ void RendererBase::UpdateCurrentFramebufferLayout() {
render_window.UpdateCurrentFramebufferLayout(layout.width, layout.height); 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, void RendererBase::RequestScreenshot(void* data, std::function<void(bool)> callback,
const Layout::FramebufferLayout& layout) { const Layout::FramebufferLayout& layout) {
if (renderer_settings.screenshot_requested) { if (renderer_settings.screenshot_requested) {

View File

@ -83,6 +83,9 @@ public:
/// Refreshes the settings common to all renderers /// Refreshes the settings common to all renderers
void RefreshBaseSettings(); void RefreshBaseSettings();
/// Returns true if a screenshot is being processed
bool IsScreenshotPending() const;
/// Request a screenshot of the next frame /// Request a screenshot of the next frame
void RequestScreenshot(void* data, std::function<void(bool)> callback, void RequestScreenshot(void* data, std::function<void(bool)> callback,
const Layout::FramebufferLayout& layout); const Layout::FramebufferLayout& layout);

View File

@ -933,6 +933,11 @@ void GRenderWindow::CaptureScreenshot(const QString& screenshot_path) {
auto& renderer = system.Renderer(); auto& renderer = system.Renderer();
const f32 res_scale = Settings::values.resolution_info.up_factor; 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)}; const Layout::FramebufferLayout layout{Layout::FrameLayoutFromResolutionScale(res_scale)};
screenshot_image = QImage(QSize(layout.width, layout.height), QImage::Format_RGB32); screenshot_image = QImage(QSize(layout.width, layout.height), QImage::Format_RGB32);
renderer.RequestScreenshot( renderer.RequestScreenshot(