render: Fixed some compiler warnings. Fixes #5197.
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 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
diff --git a/src/render/SDL_render.c b/src/render/SDL_render.c
index 5293c0a..b75a034 100644
--- a/src/render/SDL_render.c
+++ b/src/render/SDL_render.c
@@ -731,13 +731,13 @@ SDL_RendererEventWatch(void *userdata, SDL_Event *event)
if (renderer->target) {
renderer->viewport_backup.x = 0;
renderer->viewport_backup.y = 0;
- renderer->viewport_backup.w = w;
- renderer->viewport_backup.h = h;
+ renderer->viewport_backup.w = (float) w;
+ renderer->viewport_backup.h = (float) h;
} else {
renderer->viewport.x = 0;
renderer->viewport.y = 0;
- renderer->viewport.w = w;
- renderer->viewport.h = h;
+ renderer->viewport.w = (float) w;
+ renderer->viewport.h = (float) h;
QueueCmdSetViewport(renderer);
FlushRenderCommandsIfNotBatching(renderer);
}
@@ -2194,8 +2194,8 @@ SDL_SetRenderTarget(SDL_Renderer *renderer, SDL_Texture *texture)
if (texture) {
renderer->viewport.x = 0.0f;
renderer->viewport.y = 0.0f;
- renderer->viewport.w = texture->w;
- renderer->viewport.h = texture->h;
+ renderer->viewport.w = (float) texture->w;
+ renderer->viewport.h = (float) texture->h;
SDL_zero(renderer->clip_rect);
renderer->clipping_enabled = SDL_FALSE;
renderer->scale.x = 1.0f;
@@ -2408,13 +2408,13 @@ SDL_RenderSetViewport(SDL_Renderer * renderer, const SDL_Rect * rect)
renderer->viewport.h = rect->h * renderer->scale.y;
} else {
int w, h;
- renderer->viewport.x = 0.0f;
- renderer->viewport.y = 0.0f;
if (SDL_GetRendererOutputSize(renderer, &w, &h) < 0) {
return -1;
}
- renderer->viewport.w = w;
- renderer->viewport.h = h;
+ renderer->viewport.x = 0.0f;
+ renderer->viewport.y = 0.0f;
+ renderer->viewport.w = (float) w;
+ renderer->viewport.h = (float) h;
}
retval = QueueCmdSetViewport(renderer);
return retval < 0 ? retval : FlushRenderCommandsIfNotBatching(renderer);
@@ -2947,8 +2947,8 @@ SDL_RenderDrawLines(SDL_Renderer * renderer,
}
for (i = 0; i < count; ++i) {
- fpoints[i].x = points[i].x;
- fpoints[i].y = points[i].y;
+ fpoints[i].x = (float) points[i].x;
+ fpoints[i].y = (float) points[i].y;
}
retval = SDL_RenderDrawLinesF(renderer, fpoints, count);