]> git.lizzy.rs Git - nothing.git/blobdiff - src/game/sprite_font.c
(#946) Additional work
[nothing.git] / src / game / sprite_font.c
index 6514f216f5281a52a0a89d0eb40ee0f77a14012c..0c32f3073b6345087018a99391916b4724b1cc97 100644 (file)
@@ -1,4 +1,4 @@
-#include <SDL2/SDL.h>
+#include <SDL.h>
 #include "system/stacktrace.h"
 #include <stdio.h>
 #include <string.h>
@@ -24,10 +24,7 @@ Sprite_font *create_sprite_font_from_file(const char *bmp_file_path,
     trace_assert(bmp_file_path);
     trace_assert(renderer);
 
-    Lt * const lt = create_lt();
-    if (lt == NULL) {
-        return NULL;
-    }
+    Lt *lt = create_lt();
 
     Sprite_font * const sprite_font = PUSH_LT(lt, nth_calloc(1, sizeof(Sprite_font)), free);
     if (sprite_font == NULL) {
@@ -89,8 +86,8 @@ static SDL_Rect sprite_font_char_rect(const Sprite_font *sprite_font, char x)
 
 int sprite_font_render_text(const Sprite_font *sprite_font,
                             SDL_Renderer *renderer,
-                            Vec position,
-                            Vec size,
+                            Vec2f position,
+                            Vec2f size,
                             Color color,
                             const char *text)
 {
@@ -128,8 +125,8 @@ int sprite_font_render_text(const Sprite_font *sprite_font,
 }
 
 Rect sprite_font_boundary_box(const Sprite_font *sprite_font,
-                                Vec position,
-                                Vec size,
+                                Vec2f position,
+                                Vec2f size,
                                 const char *text)
 {
     trace_assert(sprite_font);