From a7203603fe2fab3b8d5bb40c317dfe049e6f5d75 Mon Sep 17 00:00:00 2001 From: Joshua Ashton Date: Fri, 28 Oct 2022 02:20:19 +0100 Subject: [PATCH] steamcompmgr: Add STRETCH scaling mode --- src/main.hpp | 1 + src/steamcompmgr.cpp | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/src/main.hpp b/src/main.hpp index b227d73..5034efa 100644 --- a/src/main.hpp +++ b/src/main.hpp @@ -34,6 +34,7 @@ enum class GamescopeUpscaleScaler : uint32_t INTEGER, FIT, FILL, + STRETCH, }; extern GamescopeUpscaleFilter g_upscaleFilter; diff --git a/src/steamcompmgr.cpp b/src/steamcompmgr.cpp index 7ac5afe..7254bad 100644 --- a/src/steamcompmgr.cpp +++ b/src/steamcompmgr.cpp @@ -901,6 +901,13 @@ void calc_scale_factor(float &out_scale_x, float &out_scale_y, float sourceWidth float XRatio = (float)g_nNestedWidth / sourceWidth; float YRatio = (float)g_nNestedHeight / sourceHeight; + if (g_upscaleScaler == GamescopeUpscaleScaler::STRETCH) + { + out_scale_x = XRatio * XOutputRatio; + out_scale_y = YRatio * YOutputRatio; + return; + } + if (g_upscaleScaler != GamescopeUpscaleScaler::FILL) { out_scale_x = std::min(XRatio, YRatio);