From c6af61de5e50608fc66f2041bc6e487b55cf7b3c Mon Sep 17 00:00:00 2001 From: Clownacy Date: Tue, 15 Sep 2020 20:49:24 +0100 Subject: [PATCH] Chars aren't guaranteed to overflow at 256 --- src/Font.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Font.cpp b/src/Font.cpp index 467306f7..bf0540a5 100644 --- a/src/Font.cpp +++ b/src/Font.cpp @@ -1138,7 +1138,7 @@ void DrawText(Font *font, RenderBackend_Surface *surface, int x, int y, unsigned { if (font != NULL && surface != NULL) { - RenderBackend_PrepareToDrawGlyphs(font->atlas, surface, (unsigned char)colour, (unsigned char)(colour >> 8), (unsigned char)(colour >> 16)); + RenderBackend_PrepareToDrawGlyphs(font->atlas, surface, colour & 0xFF, (colour >> 8) & 0xFF, (colour >> 16) & 0xFF); size_t pen_x = 0;