# HG changeset patch # User Wuzzy # Date 1531761322 -7200 # Node ID 8935dcc0e1307f3963d2d21e4f7ce1cca8407579 # Parent dbf4f7a677be350a56af77c06c1f647b15ef5530 Always use SDL_Map(A)RGB in SDL_FillRect for color This practice is recommended by official SDL docs. diff -r dbf4f7a677be -r 8935dcc0e130 hedgewars/uRenderUtils.pas --- a/hedgewars/uRenderUtils.pas Mon Jul 16 04:50:23 2018 +0200 +++ b/hedgewars/uRenderUtils.pas Mon Jul 16 19:15:22 2018 +0200 @@ -46,7 +46,7 @@ begin r:= rect^; if Clear then - SDL_FillRect(Surface, @r, 0); + SDL_FillRect(Surface, @r, SDL_MapRGB(Surface^.format, 0, 0, 0)); BorderColor:= SDL_MapRGB(Surface^.format, BorderColor shr 16, BorderColor shr 8, BorderColor and $FF); FillColor:= SDL_MapRGB(Surface^.format, FillColor shr 16, FillColor shr 8, FillColor and $FF); @@ -554,7 +554,7 @@ rect.h:= textHeight + cornerHeight * 2 - edgeHeight * 2; i:= rect.w; j:= rect.h; - SDL_FillRect(finalSurface, @rect, cWhiteColor); + SDL_FillRect(finalSurface, @rect, SDL_MapRGB(finalSurface^.format, cWhiteColor shr 16, cWhiteColor shr 8, cWhiteColor and $FF)); pos:= 1; line:= 0; while GetNextSpeechLine(s, #1, pos, substr) do diff -r dbf4f7a677be -r 8935dcc0e130 hedgewars/uStore.pas --- a/hedgewars/uStore.pas Mon Jul 16 04:50:23 2018 +0200 +++ b/hedgewars/uStore.pas Mon Jul 16 19:15:22 2018 +0200 @@ -975,7 +975,7 @@ r.y:= cFontBorder + 4; r.w:= 32; r.h:= 32; -SDL_FillRect(tmpsurf, @r, $ff000000); +SDL_FillRect(tmpsurf, @r, SDL_MapRGB(tmpsurf^.format, 0, 0, 0)); SDL_UpperBlit(iconsurf, iconrect, tmpsurf, @r); RenderHelpWindow:= Surface2Tex(tmpsurf, true);