Fixed compile warnings
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
diff --git a/src/render/SDL_render.c b/src/render/SDL_render.c
index 87c7583..58cda3d 100644
--- a/src/render/SDL_render.c
+++ b/src/render/SDL_render.c
@@ -2476,8 +2476,8 @@ RenderGetViewportSize(SDL_Renderer * renderer, SDL_FRect * rect)
{
rect->x = 0.0f;
rect->y = 0.0f;
- rect->w = renderer->viewport.w / renderer->scale.x;
- rect->h = renderer->viewport.h / renderer->scale.y;
+ rect->w = (float)(renderer->viewport.w / renderer->scale.x);
+ rect->h = (float)(renderer->viewport.h / renderer->scale.y);
}
int
@@ -2555,10 +2555,10 @@ SDL_RenderWindowToLogical(SDL_Renderer * renderer, int windowX, int windowY, flo
window_physical_y = ((float) windowY) / renderer->dpi_scale.y;
if (logicalX) {
- *logicalX = (window_physical_x - renderer->viewport.x) / renderer->scale.x;
+ *logicalX = (float)((window_physical_x - renderer->viewport.x) / renderer->scale.x);
}
if (logicalY) {
- *logicalY = (window_physical_y - renderer->viewport.y) / renderer->scale.y;
+ *logicalY = (float)((window_physical_y - renderer->viewport.y) / renderer->scale.y);
}
}
@@ -2569,8 +2569,8 @@ SDL_RenderLogicalToWindow(SDL_Renderer * renderer, float logicalX, float logical
CHECK_RENDERER_MAGIC(renderer, );
- window_physical_x = (logicalX * renderer->scale.x) + renderer->viewport.x;
- window_physical_y = (logicalY * renderer->scale.y) + renderer->viewport.y;
+ window_physical_x = (float)((logicalX * renderer->scale.x) + renderer->viewport.x);
+ window_physical_y = (float)((logicalY * renderer->scale.y) + renderer->viewport.y);
if (windowX) {
*windowX = (int)(window_physical_x * renderer->dpi_scale.x);