Avoid some float logic

Also shuts up some VS2019 warnings
This commit is contained in:
Clownacy 2020-07-08 16:05:06 +01:00
parent 8b854a0c95
commit ab82f014ae

View file

@ -140,7 +140,7 @@ void WindowBackend_Software_HandleWindowResize(unsigned int width, unsigned int
viewport_y = 0; viewport_y = 0;
viewport_height = height; viewport_height = height;
viewport_width = framebuffer_width * ((float)height / (float)framebuffer_height); viewport_width = (framebuffer_width * height) / framebuffer_height;
viewport_x = (width - viewport_width) / 2; viewport_x = (width - viewport_width) / 2;
} }
else else
@ -148,7 +148,7 @@ void WindowBackend_Software_HandleWindowResize(unsigned int width, unsigned int
viewport_x = 0; viewport_x = 0;
viewport_width = width; viewport_width = width;
viewport_height = framebuffer_height * ((float)width / (float)framebuffer_width); viewport_height = (framebuffer_height * width) / framebuffer_width;
viewport_y = (height - viewport_height) / 2; viewport_y = (height - viewport_height) / 2;
} }