From 8caeeade6709a2a7633620effe73dd88e918c332 Mon Sep 17 00:00:00 2001 From: Agent X <44549182+AgentXLP@users.noreply.github.com> Date: Sun, 5 Jan 2025 21:09:15 -0500 Subject: [PATCH] Bug fixes --- mods/char-select-extra-chars/main.lua | 2 +- src/pc/djui/djui_text.c | 16 ++++++++-------- src/pc/djui/djui_unicode.c | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/mods/char-select-extra-chars/main.lua b/mods/char-select-extra-chars/main.lua index 6f77e994c..b0cdc6297 100644 --- a/mods/char-select-extra-chars/main.lua +++ b/mods/char-select-extra-chars/main.lua @@ -33,7 +33,7 @@ extraCharacters = { [SHIRT] = { r = 0xFF, g = 0x00, b = 0x00 }, [GLOVES] = { r = 0xFF, g = 0xFF, b = 0xFF }, [SHOES] = { r = 0x68, g = 0x40, b = 0x1B }, - [HAIR] = { r = 0xFF, g = 0x00, b = 0x00 }, + [HAIR] = { r = 0x73, g = 0x06, b = 0x00 }, [SKIN] = { r = 0xFE, g = 0xD5, b = 0xA1 }, [CAP] = { r = 0xF3, g = 0x00, b = 0x80 }, [EMBLEM] = { r = 0xF3, g = 0x00, b = 0x80 } diff --git a/src/pc/djui/djui_text.c b/src/pc/djui/djui_text.c index 3d7d0edca..48f362aac 100644 --- a/src/pc/djui/djui_text.c +++ b/src/pc/djui/djui_text.c @@ -65,16 +65,16 @@ static void djui_text_translate(f32 x, f32 y) { } static void djui_text_render_single_char(struct DjuiText* text, char* c) { - // struct DjuiBaseRect* comp = &text->base.comp; + struct DjuiBaseRect* comp = &text->base.comp; - // f32 dX = comp->x + sTextRenderX * text->fontScale; - // f32 dY = comp->y + sTextRenderY * text->fontScale; - // f32 dW = text->font->charWidth * text->fontScale; - // f32 dH = text->font->charHeight * text->fontScale; + f32 dX = comp->x + sTextRenderX * text->fontScale; + f32 dY = comp->y + sTextRenderY * text->fontScale; + f32 dW = text->font->charWidth * text->fontScale; + f32 dH = text->font->charHeight * text->fontScale; - // if (djui_gfx_add_clipping_specific(&text->base, dX, dY, dW, dH)) { - // return; - // } + if (djui_gfx_add_clipping_specific(&text->base, dX, dY, dW, dH)) { + return; + } create_dl_translation_matrix(DJUI_MTX_NOPUSH, sTextRenderX - sTextRenderLastX, (sTextRenderY - sTextRenderLastY) * -1.0f, 0); text->font->render_char(c); diff --git a/src/pc/djui/djui_unicode.c b/src/pc/djui/djui_unicode.c index 1eae4859c..e97cd8551 100644 --- a/src/pc/djui/djui_unicode.c +++ b/src/pc/djui/djui_unicode.c @@ -403,7 +403,7 @@ char djui_unicode_get_base_char(char* text) { if (!sCharMap) { return '?'; } u64 key = convert_unicode_char_to_u64(text); struct SmCodeGlyph* glyph = hmap_get(sCharMap, key); - return (glyph != NULL || ((u8)glyph->base < (u8)'!')) ? glyph->base : '?'; + return (glyph == NULL) ? '?' : glyph->base; } void djui_unicode_get_char(char* text, char* output) {