mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-12 20:27:53 +00:00
[client] main: add new option for integer only upscaling
The new option `win:intUpscale` will limit upscaling to integer sizes only if enabled.
This commit is contained in:
parent
7b7a06b63f
commit
655c993c5b
3 changed files with 23 additions and 0 deletions
|
@ -163,6 +163,13 @@ static struct Option options[] =
|
||||||
.type = OPTION_TYPE_BOOL,
|
.type = OPTION_TYPE_BOOL,
|
||||||
.value.x_bool = false,
|
.value.x_bool = false,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
.module = "win",
|
||||||
|
.name = "intUpscale",
|
||||||
|
.description = "Allow only integer upscaling",
|
||||||
|
.type = OPTION_TYPE_BOOL,
|
||||||
|
.value.x_bool = false,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
.module = "win",
|
.module = "win",
|
||||||
.name = "shrinkOnUpscale",
|
.name = "shrinkOnUpscale",
|
||||||
|
@ -603,6 +610,7 @@ bool config_load(int argc, char * argv[])
|
||||||
g_params.keepAspect = option_get_bool ("win", "keepAspect" );
|
g_params.keepAspect = option_get_bool ("win", "keepAspect" );
|
||||||
g_params.forceAspect = option_get_bool ("win", "forceAspect" );
|
g_params.forceAspect = option_get_bool ("win", "forceAspect" );
|
||||||
g_params.dontUpscale = option_get_bool ("win", "dontUpscale" );
|
g_params.dontUpscale = option_get_bool ("win", "dontUpscale" );
|
||||||
|
g_params.intUpscale = option_get_bool ("win", "intUpscale" );
|
||||||
g_params.shrinkOnUpscale = option_get_bool ("win", "shrinkOnUpscale");
|
g_params.shrinkOnUpscale = option_get_bool ("win", "shrinkOnUpscale");
|
||||||
g_params.borderless = option_get_bool ("win", "borderless" );
|
g_params.borderless = option_get_bool ("win", "borderless" );
|
||||||
g_params.fullscreen = option_get_bool ("win", "fullScreen" );
|
g_params.fullscreen = option_get_bool ("win", "fullScreen" );
|
||||||
|
|
|
@ -223,6 +223,20 @@ void core_updatePositionInfo(void)
|
||||||
g_state.dstRect.y = g_state.windowCY - srcH / 2;
|
g_state.dstRect.y = g_state.windowCY - srcH / 2;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
if (g_params.intUpscale &&
|
||||||
|
srcW <= g_state.windowW &&
|
||||||
|
srcH <= g_state.windowH)
|
||||||
|
{
|
||||||
|
force = false;
|
||||||
|
const int scale = min(
|
||||||
|
floor(g_state.windowW / srcW),
|
||||||
|
floor(g_state.windowH / srcH));
|
||||||
|
g_state.dstRect.w = srcW * scale;
|
||||||
|
g_state.dstRect.h = srcH * scale;
|
||||||
|
g_state.dstRect.x = g_state.windowCX - g_state.dstRect.w / 2;
|
||||||
|
g_state.dstRect.y = g_state.windowCY - g_state.dstRect.h / 2;
|
||||||
|
}
|
||||||
|
else
|
||||||
if ((int)(wndAspect * 1000) == (int)(srcAspect * 1000))
|
if ((int)(wndAspect * 1000) == (int)(srcAspect * 1000))
|
||||||
{
|
{
|
||||||
force = false;
|
force = false;
|
||||||
|
|
|
@ -148,6 +148,7 @@ struct AppParams
|
||||||
bool keepAspect;
|
bool keepAspect;
|
||||||
bool forceAspect;
|
bool forceAspect;
|
||||||
bool dontUpscale;
|
bool dontUpscale;
|
||||||
|
bool intUpscale;
|
||||||
bool shrinkOnUpscale;
|
bool shrinkOnUpscale;
|
||||||
bool borderless;
|
bool borderless;
|
||||||
bool fullscreen;
|
bool fullscreen;
|
||||||
|
|
Loading…
Reference in a new issue