From ab7301984a8d373d272c9687177c4eba52d00d99 Mon Sep 17 00:00:00 2001 From: Paulo Medeiros Date: Sat, 21 Dec 2024 15:12:23 -0100 Subject: [PATCH] Endian Indepence --- src/rtext.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/rtext.c b/src/rtext.c index 2adb3fdb3..b60c8cb1d 100644 --- a/src/rtext.c +++ b/src/rtext.c @@ -247,11 +247,11 @@ extern void LoadFontDefault(void) // we must consider data as little-endian order (alpha + gray) ((unsigned short *)imFont.data)[i + j] = 0xffff; } - #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ - else ((unsigned short *)imFont.data)[i + j] = 0x00ff; - #else - else ((unsigned short *)imFont.data)[i + j] = 0xff00; - #endif + else + { + ((unsigned char *)imFont.data)[(i + j)*sizeof(short)] = 0xFF; + ((unsigned char *)imFont.data)[(i + j)*sizeof(short) + 1] = 0x00; + } } counter++;