Skip to content

Commit

Permalink
Fixed compile warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Apr 18, 2022
1 parent 57927a2 commit b9fe6ba
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/render/SDL_render.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);
}
}

Expand All @@ -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);
Expand Down

0 comments on commit b9fe6ba

Please sign in to comment.