steamcompmgr: Add regular FIT as an option

This commit is contained in:
Joshua Ashton 2022-10-28 02:02:06 +01:00
parent 4a4178075e
commit c9c0044250
2 changed files with 5 additions and 2 deletions

View file

@ -32,6 +32,7 @@ enum class GamescopeUpscaleScaler : uint32_t
{ {
SMART_FIT, SMART_FIT,
INTEGER, INTEGER,
FIT,
}; };
extern GamescopeUpscaleFilter g_upscaleFilter; extern GamescopeUpscaleFilter g_upscaleFilter;

View file

@ -1301,6 +1301,7 @@ void MouseCursor::paint(win *window, win *fit, struct FrameInfo_t *frameInfo)
int cursorOffsetX, cursorOffsetY; int cursorOffsetX, cursorOffsetY;
currentScaleRatio = (XRatio < YRatio) ? XRatio : YRatio; currentScaleRatio = (XRatio < YRatio) ? XRatio : YRatio;
if (g_upscaleScaler == GamescopeUpscaleScaler::SMART_FIT)
currentScaleRatio = std::min(g_flMaxWindowScale, currentScaleRatio); currentScaleRatio = std::min(g_flMaxWindowScale, currentScaleRatio);
currentScaleRatio *= outputScaleRatio; currentScaleRatio *= outputScaleRatio;
if (g_upscaleScaler == GamescopeUpscaleScaler::INTEGER) if (g_upscaleScaler == GamescopeUpscaleScaler::INTEGER)
@ -1492,6 +1493,7 @@ paint_window(win *w, win *scaleW, struct FrameInfo_t *frameInfo,
float YRatio = (float)g_nNestedHeight / sourceHeight; float YRatio = (float)g_nNestedHeight / sourceHeight;
currentScaleRatio = (XRatio < YRatio) ? XRatio : YRatio; currentScaleRatio = (XRatio < YRatio) ? XRatio : YRatio;
if (g_upscaleScaler == GamescopeUpscaleScaler::SMART_FIT)
currentScaleRatio = std::min(g_flMaxWindowScale, currentScaleRatio); currentScaleRatio = std::min(g_flMaxWindowScale, currentScaleRatio);
currentScaleRatio *= outputScaleRatio; currentScaleRatio *= outputScaleRatio;
if (g_upscaleScaler == GamescopeUpscaleScaler::INTEGER) if (g_upscaleScaler == GamescopeUpscaleScaler::INTEGER)