QT changes, fixed 4:3 integer stretch.

This commit is contained in:
OBattler
2023-10-14 23:42:02 +02:00
parent 7013949310
commit 6c9b28493a
3 changed files with 45 additions and 72 deletions

View File

@@ -73,14 +73,12 @@ RendererCommon::onResize(int width, int height)
double gw = source.width();
double gh = source.height();
double hsr = hw / hh;
double r43 = 4.0 / 3.0;
switch (video_fullscreen_scale) {
case FULLSCR_SCALE_INT:
case FULLSCR_SCALE_INT43:
if (video_fullscreen_scale == FULLSCR_SCALE_INT43)
gsr = 4.0 / 3.0;
else
gsr = gw / gh;
gsr = gw / gh;
if (gsr <= hsr) {
dw = hh * gsr;
@@ -89,8 +87,20 @@ RendererCommon::onResize(int width, int height)
dw = hw;
dh = hw / gsr;
}
integer_scale(&dw, &gw);
integer_scale(&dh, &gh);
if (video_fullscreen_scale == FULLSCR_SCALE_INT43) {
if (r43 <= gsr) {
dw = dh * r43;
dh = dh;
} else {
dh = dw / r43;
dw = dw;
}
}
dx = (hw - dw) / 2.0;
dy = (hh - dh) / 2.0;
destination.setRect((int) dx, (int) dy, (int) dw, (int) dh);
@@ -98,7 +108,7 @@ RendererCommon::onResize(int width, int height)
case FULLSCR_SCALE_43:
case FULLSCR_SCALE_KEEPRATIO:
if (video_fullscreen_scale == FULLSCR_SCALE_43)
gsr = 4.0 / 3.0;
gsr = r43;
else
gsr = gw / gh;