SDL_ttf: Fix C4244 conversion warnings

From 6ea56cb80cbeec68ce3cd53621de4a594a43445b Mon Sep 17 00:00:00 2001
From: Anonymous Maarten <[EMAIL REDACTED]>
Date: Mon, 3 Jul 2023 04:03:14 +0200
Subject: [PATCH] Fix C4244 conversion warnings

---
 glfont.c   | 4 ++--
 showfont.c | 8 ++++----
 testapp.c  | 8 ++++----
 3 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/glfont.c b/glfont.c
index f29512e..9f204d1 100644
--- a/glfont.c
+++ b/glfont.c
@@ -404,8 +404,8 @@ int main(int argc, char *argv[])
         while (SDL_PollEvent(&event)) {
             switch (event.type) {
                 case SDL_EVENT_MOUSE_MOTION:
-                x = event.motion.x - w/2;
-                y = event.motion.y - h/2;
+                x = (int)(event.motion.x - w/2);
+                y = (int)(event.motion.y - h/2);
                 break;
 
                 case SDL_EVENT_KEY_DOWN:
diff --git a/showfont.c b/showfont.c
index fa528a8..d9bbeb5 100644
--- a/showfont.c
+++ b/showfont.c
@@ -344,10 +344,10 @@ int main(int argc, char *argv[])
         }
         switch (event.type) {
             case SDL_EVENT_MOUSE_BUTTON_DOWN:
-                scene.messageRect.x = event.button.x - text->w/2;
-                scene.messageRect.y = event.button.y - text->h/2;
-                scene.messageRect.w = text->w;
-                scene.messageRect.h = text->h;
+                scene.messageRect.x = (float)(event.button.x - text->w/2);
+                scene.messageRect.y = (float)(event.button.y - text->h/2);
+                scene.messageRect.w = (float)text->w;
+                scene.messageRect.h = (float)text->h;
                 draw_scene(renderer, &scene);
                 break;
 
diff --git a/testapp.c b/testapp.c
index 137b68e..279ba61 100644
--- a/testapp.c
+++ b/testapp.c
@@ -1041,10 +1041,10 @@ int main(void)
              dstrect.h = text_surface->h;
              {
                 SDL_FRect d;
-                d.x = dstrect.x;
-                d.y = dstrect.y;
-                d.w = dstrect.w;
-                d.h = dstrect.h;
+                d.x = (float)dstrect.x;
+                d.y = (float)dstrect.y;
+                d.w = (float)dstrect.w;
+                d.h = (float)dstrect.h;
                 SDL_RenderTexture(renderer, text_texture, NULL, &d);
              }
              SDL_RenderPresent(renderer);