Chars aren't guaranteed to overflow at 256

This commit is contained in:
Clownacy 2020-09-15 20:49:24 +01:00
parent 52c2a5ceee
commit c6af61de5e

View file

@ -1138,7 +1138,7 @@ void DrawText(Font *font, RenderBackend_Surface *surface, int x, int y, unsigned
{ {
if (font != NULL && surface != NULL) 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; size_t pen_x = 0;