From cfdc1f5f2890544d922a7e0a034bbc6603410ebf Mon Sep 17 00:00:00 2001 From: veclavtalica Date: Mon, 7 Oct 2024 12:32:06 +0300 Subject: [PATCH] twn_rendering.c: rename font_path parameter to font --- apps/lua/game.c | 12 ++++++------ include/twn_rendering.h | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/apps/lua/game.c b/apps/lua/game.c index bb9b91a..1b039c9 100644 --- a/apps/lua/game.c +++ b/apps/lua/game.c @@ -193,7 +193,7 @@ static int b_rectangle(lua_State *L) { * position [table] * height_px [number], optional, defaults to 22 * color [table], optional, defaults to black - * font_path [string] + * font [string] */ static int b_text(lua_State *L) { luaL_checktype(L, 1, LUA_TTABLE); @@ -222,12 +222,12 @@ static int b_text(lua_State *L) { if (lua_istable(L, -1)) color = table_to_color(L, -1); - lua_getfield(L, 1, "font_path"); - const char *font_path = lua_tostring(L, -1); - if (font_path == NULL) - luaL_error(L, "bad field 'font_path' in 'data' (string expected, got %s)", luaL_typename(L, -1)); + lua_getfield(L, 1, "font"); + const char *font = lua_tostring(L, -1); + if (font == NULL) + luaL_error(L, "bad field 'font' in 'data' (string expected, got %s)", luaL_typename(L, -1)); - push_text(string, (Vec2) { x, y }, height_px, color, font_path); + push_text(string, (Vec2) { x, y }, height_px, color, font); return 0; } diff --git a/include/twn_rendering.h b/include/twn_rendering.h index b99f779..6972476 100644 --- a/include/twn_rendering.h +++ b/include/twn_rendering.h @@ -33,8 +33,8 @@ TWN_API void push_rectangle(Rect rect, Color color); /* pushes a filled circle onto the circle render queue */ TWN_API void push_circle(Vec2 position, float radius, Color color); -TWN_API void push_text(char *string, Vec2 position, int height_px, Color color, const char *font_path); -TWN_API int text_get_width(char *string, int height_px, const char *font_path); +TWN_API void push_text(char *string, Vec2 position, int height_px, Color color, const char *font); +TWN_API int text_get_width(char *string, int height_px, const char *font); TWN_API void push_9slice(char *texture_path, int texture_w, int texture_h, int border_thickness, Rect rect, Color color);