steamcompmgr: Add STRETCH scaling mode
This commit is contained in:
parent
f302a23069
commit
a7203603fe
2 changed files with 8 additions and 0 deletions
|
@ -34,6 +34,7 @@ enum class GamescopeUpscaleScaler : uint32_t
|
|||
INTEGER,
|
||||
FIT,
|
||||
FILL,
|
||||
STRETCH,
|
||||
};
|
||||
|
||||
extern GamescopeUpscaleFilter g_upscaleFilter;
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue