diff options
| -rw-r--r-- | src/core/frontend/framebuffer_layout.cpp | 7 | ||||
| -rw-r--r-- | src/core/frontend/framebuffer_layout.h | 11 | ||||
| -rw-r--r-- | src/video_core/video_core.cpp | 6 | ||||
| -rw-r--r-- | src/video_core/video_core.h | 2 | ||||
| -rw-r--r-- | src/yuzu/bootmanager.cpp | 2 |
5 files changed, 8 insertions, 20 deletions
diff --git a/src/core/frontend/framebuffer_layout.cpp b/src/core/frontend/framebuffer_layout.cpp index 4b58b672a..26a5b12aa 100644 --- a/src/core/frontend/framebuffer_layout.cpp +++ b/src/core/frontend/framebuffer_layout.cpp | |||
| @@ -25,7 +25,12 @@ FramebufferLayout DefaultFrameLayout(u32 width, u32 height) { | |||
| 25 | ASSERT(height > 0); | 25 | ASSERT(height > 0); |
| 26 | // The drawing code needs at least somewhat valid values for both screens | 26 | // The drawing code needs at least somewhat valid values for both screens |
| 27 | // so just calculate them both even if the other isn't showing. | 27 | // so just calculate them both even if the other isn't showing. |
| 28 | FramebufferLayout res{width, height, false, {}}; | 28 | FramebufferLayout res{ |
| 29 | .width = width, | ||
| 30 | .height = height, | ||
| 31 | .screen = {}, | ||
| 32 | .is_srgb = false, | ||
| 33 | }; | ||
| 29 | 34 | ||
| 30 | const float window_aspect_ratio = static_cast<float>(height) / static_cast<float>(width); | 35 | const float window_aspect_ratio = static_cast<float>(height) / static_cast<float>(width); |
| 31 | const float emulation_aspect_ratio = EmulationAspectRatio( | 36 | const float emulation_aspect_ratio = EmulationAspectRatio( |
diff --git a/src/core/frontend/framebuffer_layout.h b/src/core/frontend/framebuffer_layout.h index 2e36c0163..8e341e4e2 100644 --- a/src/core/frontend/framebuffer_layout.h +++ b/src/core/frontend/framebuffer_layout.h | |||
| @@ -35,17 +35,8 @@ enum class AspectRatio { | |||
| 35 | struct FramebufferLayout { | 35 | struct FramebufferLayout { |
| 36 | u32 width{ScreenUndocked::Width}; | 36 | u32 width{ScreenUndocked::Width}; |
| 37 | u32 height{ScreenUndocked::Height}; | 37 | u32 height{ScreenUndocked::Height}; |
| 38 | bool is_srgb{}; | ||
| 39 | |||
| 40 | Common::Rectangle<u32> screen; | 38 | Common::Rectangle<u32> screen; |
| 41 | 39 | bool is_srgb{}; | |
| 42 | /** | ||
| 43 | * Returns the ration of pixel size of the screen, compared to the native size of the undocked | ||
| 44 | * Switch screen. | ||
| 45 | */ | ||
| 46 | float GetScalingRatio() const { | ||
| 47 | return static_cast<float>(screen.GetWidth()) / ScreenUndocked::Width; | ||
| 48 | } | ||
| 49 | }; | 40 | }; |
| 50 | 41 | ||
| 51 | /** | 42 | /** |
diff --git a/src/video_core/video_core.cpp b/src/video_core/video_core.cpp index e852c817e..329bf4def 100644 --- a/src/video_core/video_core.cpp +++ b/src/video_core/video_core.cpp | |||
| @@ -55,10 +55,4 @@ std::unique_ptr<Tegra::GPU> CreateGPU(Core::Frontend::EmuWindow& emu_window, Cor | |||
| 55 | } | 55 | } |
| 56 | } | 56 | } |
| 57 | 57 | ||
| 58 | float GetResolutionScaleFactor(const RendererBase& renderer) { | ||
| 59 | return Settings::values.resolution_info.active | ||
| 60 | ? Settings::values.resolution_info.up_factor | ||
| 61 | : renderer.GetRenderWindow().GetFramebufferLayout().GetScalingRatio(); | ||
| 62 | } | ||
| 63 | |||
| 64 | } // namespace VideoCore | 58 | } // namespace VideoCore |
diff --git a/src/video_core/video_core.h b/src/video_core/video_core.h index f86877e86..084df641f 100644 --- a/src/video_core/video_core.h +++ b/src/video_core/video_core.h | |||
| @@ -25,6 +25,4 @@ class RendererBase; | |||
| 25 | /// Creates an emulated GPU instance using the given system context. | 25 | /// Creates an emulated GPU instance using the given system context. |
| 26 | std::unique_ptr<Tegra::GPU> CreateGPU(Core::Frontend::EmuWindow& emu_window, Core::System& system); | 26 | std::unique_ptr<Tegra::GPU> CreateGPU(Core::Frontend::EmuWindow& emu_window, Core::System& system); |
| 27 | 27 | ||
| 28 | float GetResolutionScaleFactor(const RendererBase& renderer); | ||
| 29 | |||
| 30 | } // namespace VideoCore | 28 | } // namespace VideoCore |
diff --git a/src/yuzu/bootmanager.cpp b/src/yuzu/bootmanager.cpp index 976acd176..822ba1a34 100644 --- a/src/yuzu/bootmanager.cpp +++ b/src/yuzu/bootmanager.cpp | |||
| @@ -630,7 +630,7 @@ void GRenderWindow::ReleaseRenderTarget() { | |||
| 630 | 630 | ||
| 631 | void GRenderWindow::CaptureScreenshot(const QString& screenshot_path) { | 631 | void GRenderWindow::CaptureScreenshot(const QString& screenshot_path) { |
| 632 | auto& renderer = system.Renderer(); | 632 | auto& renderer = system.Renderer(); |
| 633 | const f32 res_scale = VideoCore::GetResolutionScaleFactor(renderer); | 633 | const f32 res_scale = Settings::values.resolution_info.up_factor; |
| 634 | 634 | ||
| 635 | const Layout::FramebufferLayout layout{Layout::FrameLayoutFromResolutionScale(res_scale)}; | 635 | const Layout::FramebufferLayout layout{Layout::FrameLayoutFromResolutionScale(res_scale)}; |
| 636 | screenshot_image = QImage(QSize(layout.width, layout.height), QImage::Format_RGB32); | 636 | screenshot_image = QImage(QSize(layout.width, layout.height), QImage::Format_RGB32); |