Nov 26, 2024, 11:02 PM

This commit is contained in:
kace 2024-11-27 05:02:34 +00:00
parent 764c507457
commit 517f121479

View file

@ -3959,7 +3959,7 @@ static int nk_love_style_set_font(lua_State *L)
nk_love_assert_argc(L, lua_gettop(L) == 2);
struct nk_love_context *ctx = nk_love_checkcontext(L, 1);
nk_love_checkFont(L, 2, &ctx->fonts[ctx->font_count]);
nk_style_set_font(&ctx->nkctx, &ctx->fonts[ctx->font_count++]);
nk_style_set_font(&ctx->nkctx, (const struct nk_user_font *)&ctx->fonts[ctx->font_count++]);
return 0;
}
@ -4066,7 +4066,7 @@ static int nk_love_style_push_font(lua_State *L, const struct nk_user_font **fie
{
struct nk_love_context *ctx = nk_love_checkcontext(L, 1);
nk_love_checkFont(L, -1, &context->fonts[context->font_count]);
int success = nk_style_push_font(&ctx->nkctx, &context->fonts[context->font_count++]);
int success = nk_style_push_font(&ctx->nkctx, (const struct nk_user_font *)&context->fonts[context->font_count++]);
if (success)
{
lua_pushstring(L, "font");
@ -4759,7 +4759,7 @@ static int nk_love_text(lua_State *L)
float line_thickness;
struct nk_color color;
nk_love_getGraphics(L, &line_thickness, &color);
nk_draw_text(&context->nkctx.current->buffer, nk_rect(x, y, w, h), text, strlen(text), &context->fonts[context->font_count++], nk_rgba(0, 0, 0, 0), color);
nk_draw_text(&context->nkctx.current->buffer, nk_rect(x, y, w, h), text, strlen(text), (const struct nk_user_font *)&context->fonts[context->font_count++], nk_rgba(0, 0, 0, 0), color);
return 0;
}