fix upscale texture inconsistencies (now it should match Choco/Crispy)

This commit is contained in:
Roman Fomin 2023-05-13 10:33:55 +07:00
parent 23edf7ef4c
commit 590d410b13

View File

@ -230,8 +230,8 @@ static void HandleWindowEvent(SDL_WindowEvent *event)
{ {
SDL_GetWindowSize(screen, &window_width, &window_height); SDL_GetWindowSize(screen, &window_width, &window_height);
SDL_GetWindowPosition(screen, &window_x, &window_y); SDL_GetWindowPosition(screen, &window_x, &window_y);
need_resize = true;
} }
need_resize = true;
break; break;
default: default:
@ -965,7 +965,7 @@ static void CreateUpscaledTexture(boolean force)
{ {
// Tall window. // Tall window.
h = w * actualheight / screen_height; h = w * actualheight / screen_width;
} }
else else
{ {
@ -983,11 +983,11 @@ static void CreateUpscaledTexture(boolean force)
while (w_upscale * screen_width > info.max_texture_width) while (w_upscale * screen_width > info.max_texture_width)
{ {
--w_upscale; --w_upscale;
} }
while (h_upscale * screen_height > info.max_texture_height) while (h_upscale * screen_height > info.max_texture_height)
{ {
--h_upscale; --h_upscale;
} }
if (w_upscale < 1) if (w_upscale < 1)