From 8aa147fa099c4ab512dd83add4b0268014e7aa14 Mon Sep 17 00:00:00 2001 From: Philipp Wiesemann Date: Fri, 4 Aug 2017 23:00:30 +0200 Subject: [PATCH] Fixed compiler warnings about type conversions. Found by buildbot. --- src/render/SDL_render.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/render/SDL_render.c b/src/render/SDL_render.c index e2fc16e5c..1955cb55f 100644 --- a/src/render/SDL_render.c +++ b/src/render/SDL_render.c @@ -168,8 +168,8 @@ SDL_RendererEventWatch(void *userdata, SDL_Event *event) } else if (event->type == SDL_MOUSEMOTION) { SDL_Window *window = SDL_GetWindowFromID(event->motion.windowID); if (renderer->logical_w && window == renderer->window) { - event->motion.x -= (renderer->viewport.x * renderer->dpi_scale.x); - event->motion.y -= (renderer->viewport.y * renderer->dpi_scale.y); + event->motion.x -= (int)(renderer->viewport.x * renderer->dpi_scale.x); + event->motion.y -= (int)(renderer->viewport.y * renderer->dpi_scale.y); event->motion.x = (int)(event->motion.x / (renderer->scale.x * renderer->dpi_scale.x)); event->motion.y = (int)(event->motion.y / (renderer->scale.y * renderer->dpi_scale.y)); if (event->motion.xrel > 0) { @@ -187,8 +187,8 @@ SDL_RendererEventWatch(void *userdata, SDL_Event *event) event->type == SDL_MOUSEBUTTONUP) { SDL_Window *window = SDL_GetWindowFromID(event->button.windowID); if (renderer->logical_w && window == renderer->window) { - event->motion.x -= (renderer->viewport.x * renderer->dpi_scale.x); - event->motion.y -= (renderer->viewport.y * renderer->dpi_scale.y); + event->motion.x -= (int)(renderer->viewport.x * renderer->dpi_scale.x); + event->motion.y -= (int)(renderer->viewport.y * renderer->dpi_scale.y); event->motion.x = (int)(event->motion.x / (renderer->scale.x * renderer->dpi_scale.x)); event->motion.y = (int)(event->motion.y / (renderer->scale.y * renderer->dpi_scale.y)); }