summaryrefslogtreecommitdiff
path: root/src/yuzu
diff options
context:
space:
mode:
authorameerj <52414509+ameerj@users.noreply.github.com>2021-09-10 01:28:02 -0400
committerFernando Sahmkow <fsahmkow27@gmail.com>2021-11-16 22:11:30 +0100
commit80f8d4989eca127c7ca8c7bd63134127d6fd5edc (patch)
tree299bc0d76a3972fbd1875fec40c051bf8c07ce6c /src/yuzu
parentfcf2b2c78a3c45ddcda6594b2fd3df733ceb951c (diff)
bootmanager: Fix screenshot resolution factor usage
Fixes screenshots at non integer scaling
Diffstat (limited to 'src/yuzu')
-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
5 files changed, 6 insertions, 10 deletions
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() {
main_context.reset();
}
-void GRenderWindow::CaptureScreenshot(u32 res_scale, const QString& screenshot_path) {
- VideoCore::RendererBase& renderer = system.Renderer();
- if (res_scale == 0) {
- res_scale = VideoCore::GetResolutionScaleFactor(renderer);
- }
+void GRenderWindow::CaptureScreenshot(const QString& screenshot_path) {
+ auto& renderer = system.Renderer();
+ const f32 res_scale = VideoCore::GetResolutionScaleFactor(renderer);
const Layout::FramebufferLayout layout{Layout::FrameLayoutFromResolutionScale(res_scale)};
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:
bool IsLoadingComplete() const;
- void CaptureScreenshot(u32 res_scale, const QString& screenshot_path);
+ void CaptureScreenshot(const QString& screenshot_path);
std::pair<u32, u32> ScaleTouch(const QPointF& pos) const;
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) {
}
void MicroProfileWidget::wheelEvent(QWheelEvent* ev) {
- const auto wheel_position = ev->position().toPoint();
+ const auto wheel_position = ev->pos();
MicroProfileMousePosition(wheel_position.x() / x_scale, wheel_position.y() / y_scale,
ev->angleDelta().y() / 120);
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() {
}
}
#endif
- render_window->CaptureScreenshot(UISettings::values.screenshot_resolution_factor.GetValue(),
- filename);
+ render_window->CaptureScreenshot(filename);
}
// 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 {
Settings::BasicSetting<bool> enable_discord_presence{true, "enable_discord_presence"};
Settings::BasicSetting<bool> enable_screenshot_save_as{true, "enable_screenshot_save_as"};
- Settings::BasicSetting<u16> screenshot_resolution_factor{0, "screenshot_resolution_factor"};
QString roms_path;
QString symbols_path;