changeset 633:6271599928d4

core: remove mlk_font_ok
author David Demelier <markand@malikania.fr>
date Mon, 28 Aug 2023 20:01:48 +0200
parents 3d238b43a9aa
children 3930234ab1f5
files libmlk-core/mlk/core/font.c libmlk-core/mlk/core/font.h
diffstat 2 files changed, 4 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/libmlk-core/mlk/core/font.c	Sun Aug 27 13:22:51 2023 +0200
+++ b/libmlk-core/mlk/core/font.c	Mon Aug 28 20:01:48 2023 +0200
@@ -58,15 +58,10 @@
 }
 
 int
-mlk_font_ok(const struct mlk_font *font)
-{
-	return font && font->handle;
-}
-
-int
 mlk_font_render(struct mlk_font *font, struct mlk_texture *tex, const char *text, unsigned long color)
 {
-	assert(mlk_font_ok(font));
+	assert(font);
+	assert(tex);
 	assert(text);
 
 	SDL_Color fg = {
@@ -96,7 +91,7 @@
 unsigned int
 mlk_font_height(const struct mlk_font *font)
 {
-	assert(mlk_font_ok(font));
+	assert(font);
 
 	return TTF_FontHeight(font->handle);
 }
@@ -104,7 +99,7 @@
 int
 mlk_font_query(const struct mlk_font *font, const char *text, unsigned int *w, unsigned int *h)
 {
-	assert(mlk_font_ok(font));
+	assert(font);
 	assert(text);
 
 	if (w)
--- a/libmlk-core/mlk/core/font.h	Sun Aug 27 13:22:51 2023 +0200
+++ b/libmlk-core/mlk/core/font.h	Mon Aug 28 20:01:48 2023 +0200
@@ -107,15 +107,6 @@
                  unsigned int size);
 
 /**
- * Tells if the font is usable.
- *
- * \param font the font to check
- * \return non-zero if the font structure is usable
- */
-int
-mlk_font_ok(const struct mlk_font *font);
-
-/**
  * Render some text using the font and generate a texture.
  *
  * The texture destination must be deallocated once no longer used using