mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-12-23 14:03:40 +00:00
[client] added new option win:dontUpscale
This commit is contained in:
parent
38b05cda50
commit
46df25bb80
@ -142,6 +142,13 @@ static struct Option options[] =
|
|||||||
.type = OPTION_TYPE_BOOL,
|
.type = OPTION_TYPE_BOOL,
|
||||||
.value.x_bool = true,
|
.value.x_bool = true,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
.module = "win",
|
||||||
|
.name = "dontUpscale",
|
||||||
|
.description = "Never try to upscale the window",
|
||||||
|
.type = OPTION_TYPE_BOOL,
|
||||||
|
.value.x_bool = false,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
.module = "win",
|
.module = "win",
|
||||||
.name = "borderless",
|
.name = "borderless",
|
||||||
@ -400,6 +407,7 @@ bool config_load(int argc, char * argv[])
|
|||||||
params.allowResize = option_get_bool ("win", "allowResize" );
|
params.allowResize = option_get_bool ("win", "allowResize" );
|
||||||
params.keepAspect = option_get_bool ("win", "keepAspect" );
|
params.keepAspect = option_get_bool ("win", "keepAspect" );
|
||||||
params.forceAspect = option_get_bool ("win", "forceAspect" );
|
params.forceAspect = option_get_bool ("win", "forceAspect" );
|
||||||
|
params.dontUpscale = option_get_bool ("win", "dontUpscale" );
|
||||||
params.borderless = option_get_bool ("win", "borderless" );
|
params.borderless = option_get_bool ("win", "borderless" );
|
||||||
params.fullscreen = option_get_bool ("win", "fullScreen" );
|
params.fullscreen = option_get_bool ("win", "fullScreen" );
|
||||||
params.maximize = option_get_bool ("win", "maximize" );
|
params.maximize = option_get_bool ("win", "maximize" );
|
||||||
|
@ -92,6 +92,17 @@ static void updatePositionInfo()
|
|||||||
const float wndAspect = (float)state.windowH / (float)state.windowW;
|
const float wndAspect = (float)state.windowH / (float)state.windowW;
|
||||||
bool force = true;
|
bool force = true;
|
||||||
|
|
||||||
|
if (params.dontUpscale &&
|
||||||
|
state.srcSize.x <= state.windowW &&
|
||||||
|
state.srcSize.y <= state.windowH)
|
||||||
|
{
|
||||||
|
force = false;
|
||||||
|
state.dstRect.w = state.srcSize.x;
|
||||||
|
state.dstRect.h = state.srcSize.y;
|
||||||
|
state.dstRect.x = state.windowW / 2 - state.srcSize.x / 2;
|
||||||
|
state.dstRect.y = state.windowH / 2 - state.srcSize.y / 2;
|
||||||
|
}
|
||||||
|
else
|
||||||
if ((int)(wndAspect * 1000) == (int)(srcAspect * 1000))
|
if ((int)(wndAspect * 1000) == (int)(srcAspect * 1000))
|
||||||
{
|
{
|
||||||
force = false;
|
force = false;
|
||||||
|
@ -128,6 +128,7 @@ struct AppParams
|
|||||||
bool allowResize;
|
bool allowResize;
|
||||||
bool keepAspect;
|
bool keepAspect;
|
||||||
bool forceAspect;
|
bool forceAspect;
|
||||||
|
bool dontUpscale;
|
||||||
bool borderless;
|
bool borderless;
|
||||||
bool fullscreen;
|
bool fullscreen;
|
||||||
bool maximize;
|
bool maximize;
|
||||||
|
Loading…
Reference in New Issue
Block a user