summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/frontend/framebuffer_layout.cpp15
-rw-r--r--src/core/frontend/framebuffer_layout.h2
-rw-r--r--src/yuzu/bootmanager.cpp8
-rw-r--r--src/yuzu/bootmanager.h2
-rw-r--r--src/yuzu/debugger/profiler.cpp2
-rw-r--r--src/yuzu/main.cpp3
-rw-r--r--src/yuzu/uisettings.h1
7 files changed, 13 insertions, 20 deletions
diff --git a/src/core/frontend/framebuffer_layout.cpp b/src/core/frontend/framebuffer_layout.cpp
index 0832463d6..4b58b672a 100644
--- a/src/core/frontend/framebuffer_layout.cpp
+++ b/src/core/frontend/framebuffer_layout.cpp
@@ -44,16 +44,13 @@ FramebufferLayout DefaultFrameLayout(u32 width, u32 height) {
44 return res; 44 return res;
45} 45}
46 46
47FramebufferLayout FrameLayoutFromResolutionScale(u32 res_scale) { 47FramebufferLayout FrameLayoutFromResolutionScale(f32 res_scale) {
48 u32 width, height; 48 const bool is_docked = Settings::values.use_docked_mode.GetValue();
49 const u32 screen_width = is_docked ? ScreenDocked::Width : ScreenUndocked::Width;
50 const u32 screen_height = is_docked ? ScreenDocked::Height : ScreenUndocked::Height;
49 51
50 if (Settings::values.use_docked_mode.GetValue()) { 52 const u32 width = static_cast<u32>(static_cast<f32>(screen_width) * res_scale);
51 width = ScreenDocked::Width * res_scale; 53 const u32 height = static_cast<u32>(static_cast<f32>(screen_height) * res_scale);
52 height = ScreenDocked::Height * res_scale;
53 } else {
54 width = ScreenUndocked::Width * res_scale;
55 height = ScreenUndocked::Height * res_scale;
56 }
57 54
58 return DefaultFrameLayout(width, height); 55 return DefaultFrameLayout(width, height);
59} 56}
diff --git a/src/core/frontend/framebuffer_layout.h b/src/core/frontend/framebuffer_layout.h
index e2e3bbbb3..2e36c0163 100644
--- a/src/core/frontend/framebuffer_layout.h
+++ b/src/core/frontend/framebuffer_layout.h
@@ -60,7 +60,7 @@ FramebufferLayout DefaultFrameLayout(u32 width, u32 height);
60 * Convenience method to get frame layout by resolution scale 60 * Convenience method to get frame layout by resolution scale
61 * @param res_scale resolution scale factor 61 * @param res_scale resolution scale factor
62 */ 62 */
63FramebufferLayout FrameLayoutFromResolutionScale(u32 res_scale); 63FramebufferLayout FrameLayoutFromResolutionScale(f32 res_scale);
64 64
65/** 65/**
66 * Convenience method to determine emulation aspect ratio 66 * Convenience method to determine emulation aspect ratio
diff --git a/src/yuzu/bootmanager.cpp b/src/yuzu/bootmanager.cpp
index 46ab0603d..976acd176 100644
--- a/src/yuzu/bootmanager.cpp
+++ b/src/yuzu/bootmanager.cpp
@@ -628,11 +628,9 @@ void GRenderWindow::ReleaseRenderTarget() {
628 main_context.reset(); 628 main_context.reset();
629} 629}
630 630
631void GRenderWindow::CaptureScreenshot(u32 res_scale, const QString& screenshot_path) { 631void GRenderWindow::CaptureScreenshot(const QString& screenshot_path) {
632 VideoCore::RendererBase& renderer = system.Renderer(); 632 auto& renderer = system.Renderer();
633 if (res_scale == 0) { 633 const f32 res_scale = VideoCore::GetResolutionScaleFactor(renderer);
634 res_scale = VideoCore::GetResolutionScaleFactor(renderer);
635 }
636 634
637 const Layout::FramebufferLayout layout{Layout::FrameLayoutFromResolutionScale(res_scale)}; 635 const Layout::FramebufferLayout layout{Layout::FrameLayoutFromResolutionScale(res_scale)};
638 screenshot_image = QImage(QSize(layout.width, layout.height), QImage::Format_RGB32); 636 screenshot_image = QImage(QSize(layout.width, layout.height), QImage::Format_RGB32);
diff --git a/src/yuzu/bootmanager.h b/src/yuzu/bootmanager.h
index e6a0666e9..40fd4a9d6 100644
--- a/src/yuzu/bootmanager.h
+++ b/src/yuzu/bootmanager.h
@@ -178,7 +178,7 @@ public:
178 178
179 bool IsLoadingComplete() const; 179 bool IsLoadingComplete() const;
180 180
181 void CaptureScreenshot(u32 res_scale, const QString& screenshot_path); 181 void CaptureScreenshot(const QString& screenshot_path);
182 182
183 std::pair<u32, u32> ScaleTouch(const QPointF& pos) const; 183 std::pair<u32, u32> ScaleTouch(const QPointF& pos) const;
184 184
diff --git a/src/yuzu/debugger/profiler.cpp b/src/yuzu/debugger/profiler.cpp
index 33110685a..a8b254199 100644
--- a/src/yuzu/debugger/profiler.cpp
+++ b/src/yuzu/debugger/profiler.cpp
@@ -163,7 +163,7 @@ void MicroProfileWidget::mouseReleaseEvent(QMouseEvent* ev) {
163} 163}
164 164
165void MicroProfileWidget::wheelEvent(QWheelEvent* ev) { 165void MicroProfileWidget::wheelEvent(QWheelEvent* ev) {
166 const auto wheel_position = ev->position().toPoint(); 166 const auto wheel_position = ev->pos();
167 MicroProfileMousePosition(wheel_position.x() / x_scale, wheel_position.y() / y_scale, 167 MicroProfileMousePosition(wheel_position.x() / x_scale, wheel_position.y() / y_scale,
168 ev->angleDelta().y() / 120); 168 ev->angleDelta().y() / 120);
169 ev->accept(); 169 ev->accept();
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp
index a246f6bb3..3cb146982 100644
--- a/src/yuzu/main.cpp
+++ b/src/yuzu/main.cpp
@@ -2892,8 +2892,7 @@ void GMainWindow::OnCaptureScreenshot() {
2892 } 2892 }
2893 } 2893 }
2894#endif 2894#endif
2895 render_window->CaptureScreenshot(UISettings::values.screenshot_resolution_factor.GetValue(), 2895 render_window->CaptureScreenshot(filename);
2896 filename);
2897} 2896}
2898 2897
2899// TODO: Written 2020-10-01: Remove per-game config migration code when it is irrelevant 2898// TODO: Written 2020-10-01: Remove per-game config migration code when it is irrelevant
diff --git a/src/yuzu/uisettings.h b/src/yuzu/uisettings.h
index cac19452f..936914ef3 100644
--- a/src/yuzu/uisettings.h
+++ b/src/yuzu/uisettings.h
@@ -68,7 +68,6 @@ struct Values {
68 Settings::BasicSetting<bool> enable_discord_presence{true, "enable_discord_presence"}; 68 Settings::BasicSetting<bool> enable_discord_presence{true, "enable_discord_presence"};
69 69
70 Settings::BasicSetting<bool> enable_screenshot_save_as{true, "enable_screenshot_save_as"}; 70 Settings::BasicSetting<bool> enable_screenshot_save_as{true, "enable_screenshot_save_as"};
71 Settings::BasicSetting<u16> screenshot_resolution_factor{0, "screenshot_resolution_factor"};
72 71
73 QString roms_path; 72 QString roms_path;
74 QString symbols_path; 73 QString symbols_path;