Skip to content

Commit 5e623d1

Browse files
committed
Moved the check for negative values in $Force Scaling Above so that $Scale Gauges can work properly
1 parent 4e9f5dc commit 5e623d1

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

code/hud/hudparse.cpp

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1107,7 +1107,8 @@ void adjust_base_res(int *base_res, int *force_scaling_above_res, bool scaling =
11071107
// no scaling is set and current res is between base res and "force scaling above res"
11081108
// Avoid HUD blurring caused solely by rounding errors
11091109
if ((!scaling && gr_screen.center_w >= base_res[0] && gr_screen.center_h >= base_res[1] &&
1110-
(gr_screen.center_w <= force_scaling_above_res[0] || gr_screen.center_h <= force_scaling_above_res[1])) ||
1110+
(force_scaling_above_res[0] <= 0 || force_scaling_above_res[1] <= 0 ||
1111+
gr_screen.center_w <= force_scaling_above_res[0] || gr_screen.center_h <= force_scaling_above_res[1])) ||
11111112
(gr_screen.center_w >= base_res[0] && gr_screen.center_h == base_res[1]) ||
11121113
(gr_screen.center_w == base_res[0] && gr_screen.center_h >= base_res[1])) {
11131114
base_res[0] = gr_screen.center_w;
@@ -1117,12 +1118,8 @@ void adjust_base_res(int *base_res, int *force_scaling_above_res, bool scaling =
11171118

11181119
if (!scaling && force_scaling_above_res[0] > base_res[0] && force_scaling_above_res[1] > base_res[1] &&
11191120
gr_screen.center_w > force_scaling_above_res[0] && gr_screen.center_h > force_scaling_above_res[1]) {
1120-
if (force_scaling_above_res[0] > 0) {
1121-
base_res[0] = force_scaling_above_res[0];
1122-
}
1123-
if (force_scaling_above_res[1] > 0) {
1124-
base_res[1] = force_scaling_above_res[1];
1125-
}
1121+
base_res[0] = force_scaling_above_res[0];
1122+
base_res[1] = force_scaling_above_res[1];
11261123
}
11271124

11281125
float aspect_quotient = ((float)gr_screen.center_w / (float)gr_screen.center_h) / ((float)base_res[0] / (float)base_res[1]);

0 commit comments

Comments
 (0)