From 7868d600f40b80177add61e9b865f66405fd77f3 Mon Sep 17 00:00:00 2001 From: Fancy2209 <64917206+Fancy2209@users.noreply.github.com> Date: Mon, 23 Dec 2024 20:25:22 -0100 Subject: [PATCH] [rtext] Fix default font alpha on Big Endian systems (#4624) * Fix rtext default font alpha on Big Endian * Endian Indepence --- src/rtext.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/rtext.c b/src/rtext.c index 005568dbf..b60c8cb1d 100644 --- a/src/rtext.c +++ b/src/rtext.c @@ -247,7 +247,11 @@ extern void LoadFontDefault(void) // we must consider data as little-endian order (alpha + gray) ((unsigned short *)imFont.data)[i + j] = 0xffff; } - else ((unsigned short *)imFont.data)[i + j] = 0x00ff; + else + { + ((unsigned char *)imFont.data)[(i + j)*sizeof(short)] = 0xFF; + ((unsigned char *)imFont.data)[(i + j)*sizeof(short) + 1] = 0x00; + } } counter++;