aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpineappleEA <pineaea@gmail.com>2021-11-21 12:24:10 +0100
committerpineappleEA <pineaea@gmail.com>2021-11-21 12:24:10 +0100
commit246ae53170f48ac6ccd8fb26344d67064bfbe0bf (patch)
treed690b4795f0c3a5778dcb211d5aa31b746d6d4bf
parent01eb98cfdc3321b5e4560d50f8cf49de4b4254b6 (diff)
early-access version 2231EA-2231
-rwxr-xr-xREADME.md2
-rwxr-xr-xsrc/core/frontend/framebuffer_layout.cpp7
-rwxr-xr-xsrc/core/frontend/framebuffer_layout.h11
-rwxr-xr-xsrc/video_core/video_core.cpp6
-rwxr-xr-xsrc/video_core/video_core.h2
-rwxr-xr-xsrc/yuzu/bootmanager.cpp2
6 files changed, 9 insertions, 21 deletions
diff --git a/README.md b/README.md
index 429cdb2bd..606191fe6 100755
--- a/README.md
+++ b/README.md
@@ -1,7 +1,7 @@
1yuzu emulator early access 1yuzu emulator early access
2============= 2=============
3 3
4This is the source code for early-access 2230. 4This is the source code for early-access 2231.
5 5
6## Legal Notice 6## Legal Notice
7 7
diff --git a/src/core/frontend/framebuffer_layout.cpp b/src/core/frontend/framebuffer_layout.cpp
index 4b58b672a..26a5b12aa 100755
--- 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 100755
--- a/src/core/frontend/framebuffer_layout.h
+++ b/src/core/frontend/framebuffer_layout.h
@@ -35,17 +35,8 @@ enum class AspectRatio {
35struct FramebufferLayout { 35struct 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 100755
--- 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
58float 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 100755
--- 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.
26std::unique_ptr<Tegra::GPU> CreateGPU(Core::Frontend::EmuWindow& emu_window, Core::System& system); 26std::unique_ptr<Tegra::GPU> CreateGPU(Core::Frontend::EmuWindow& emu_window, Core::System& system);
27 27
28float GetResolutionScaleFactor(const RendererBase& renderer);
29
30} // namespace VideoCore 28} // namespace VideoCore
diff --git a/src/yuzu/bootmanager.cpp b/src/yuzu/bootmanager.cpp
index 3c8e1e90d..c992e6d90 100755
--- a/src/yuzu/bootmanager.cpp
+++ b/src/yuzu/bootmanager.cpp
@@ -924,7 +924,7 @@ void GRenderWindow::ReleaseRenderTarget() {
924 924
925void GRenderWindow::CaptureScreenshot(const QString& screenshot_path) { 925void GRenderWindow::CaptureScreenshot(const QString& screenshot_path) {
926 auto& renderer = system.Renderer(); 926 auto& renderer = system.Renderer();
927 const f32 res_scale = VideoCore::GetResolutionScaleFactor(renderer); 927 const f32 res_scale = Settings::values.resolution_info.up_factor;
928 928
929 const Layout::FramebufferLayout layout{Layout::FrameLayoutFromResolutionScale(res_scale)}; 929 const Layout::FramebufferLayout layout{Layout::FrameLayoutFromResolutionScale(res_scale)};
930 screenshot_image = QImage(QSize(layout.width, layout.height), QImage::Format_RGB32); 930 screenshot_image = QImage(QSize(layout.width, layout.height), QImage::Format_RGB32);