summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorameerj <52414509+ameerj@users.noreply.github.com>2021-11-20 23:48:22 +0100
committerameerj <52414509+ameerj@users.noreply.github.com>2021-11-20 23:50:24 +0100
commitfe1f06c856b768e9afcc9ba9ab8ef09b7152678c (patch)
tree898ea044f1a8367a5ef5abd5841267b484774cb8
parentMerge pull request #7294 from vonchenplus/fix_image_update_error_when_width_too_small (diff)
downloadyuzu-fe1f06c856b768e9afcc9ba9ab8ef09b7152678c.tar
yuzu-fe1f06c856b768e9afcc9ba9ab8ef09b7152678c.tar.gz
yuzu-fe1f06c856b768e9afcc9ba9ab8ef09b7152678c.tar.bz2
yuzu-fe1f06c856b768e9afcc9ba9ab8ef09b7152678c.tar.lz
yuzu-fe1f06c856b768e9afcc9ba9ab8ef09b7152678c.tar.xz
yuzu-fe1f06c856b768e9afcc9ba9ab8ef09b7152678c.tar.zst
yuzu-fe1f06c856b768e9afcc9ba9ab8ef09b7152678c.zip
-rw-r--r--src/core/frontend/framebuffer_layout.cpp7
-rw-r--r--src/core/frontend/framebuffer_layout.h11
-rw-r--r--src/video_core/video_core.cpp6
-rw-r--r--src/video_core/video_core.h2
-rw-r--r--src/yuzu/bootmanager.cpp2
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) {
ASSERT(height > 0);
// The drawing code needs at least somewhat valid values for both screens
// so just calculate them both even if the other isn't showing.
- FramebufferLayout res{width, height, false, {}};
+ FramebufferLayout res{
+ .width = width,
+ .height = height,
+ .screen = {},
+ .is_srgb = false,
+ };
const float window_aspect_ratio = static_cast<float>(height) / static_cast<float>(width);
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 {
struct FramebufferLayout {
u32 width{ScreenUndocked::Width};
u32 height{ScreenUndocked::Height};
- bool is_srgb{};
-
Common::Rectangle<u32> screen;
-
- /**
- * Returns the ration of pixel size of the screen, compared to the native size of the undocked
- * Switch screen.
- */
- float GetScalingRatio() const {
- return static_cast<float>(screen.GetWidth()) / ScreenUndocked::Width;
- }
+ bool is_srgb{};
};
/**
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
}
}
-float GetResolutionScaleFactor(const RendererBase& renderer) {
- return Settings::values.resolution_info.active
- ? Settings::values.resolution_info.up_factor
- : renderer.GetRenderWindow().GetFramebufferLayout().GetScalingRatio();
-}
-
} // 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;
/// Creates an emulated GPU instance using the given system context.
std::unique_ptr<Tegra::GPU> CreateGPU(Core::Frontend::EmuWindow& emu_window, Core::System& system);
-float GetResolutionScaleFactor(const RendererBase& renderer);
-
} // 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() {
void GRenderWindow::CaptureScreenshot(const QString& screenshot_path) {
auto& renderer = system.Renderer();
- const f32 res_scale = VideoCore::GetResolutionScaleFactor(renderer);
+ const f32 res_scale = Settings::values.resolution_info.up_factor;
const Layout::FramebufferLayout layout{Layout::FrameLayoutFromResolutionScale(res_scale)};
screenshot_image = QImage(QSize(layout.width, layout.height), QImage::Format_RGB32);