hedgewars/uRenderUtils.pas
changeset 13490 8935dcc0e130
parent 12591 7bae1fab444b
child 14655 b055360684bd
equal deleted inserted replaced
13489:dbf4f7a677be 13490:8935dcc0e130
    44 procedure DrawRoundRect(rect: PSDL_Rect; BorderColor, FillColor: Longword; Surface: PSDL_Surface; Clear: boolean);
    44 procedure DrawRoundRect(rect: PSDL_Rect; BorderColor, FillColor: Longword; Surface: PSDL_Surface; Clear: boolean);
    45 var r: TSDL_Rect;
    45 var r: TSDL_Rect;
    46 begin
    46 begin
    47     r:= rect^;
    47     r:= rect^;
    48     if Clear then
    48     if Clear then
    49         SDL_FillRect(Surface, @r, 0);
    49         SDL_FillRect(Surface, @r, SDL_MapRGB(Surface^.format, 0, 0, 0));
    50 
    50 
    51     BorderColor:= SDL_MapRGB(Surface^.format, BorderColor shr 16, BorderColor shr 8, BorderColor and $FF);
    51     BorderColor:= SDL_MapRGB(Surface^.format, BorderColor shr 16, BorderColor shr 8, BorderColor and $FF);
    52     FillColor:= SDL_MapRGB(Surface^.format, FillColor shr 16, FillColor shr 8, FillColor and $FF);
    52     FillColor:= SDL_MapRGB(Surface^.format, FillColor shr 16, FillColor shr 8, FillColor and $FF);
    53 
    53 
    54     r.y:= rect^.y + cFontBorder div 2;
    54     r.y:= rect^.y + cFontBorder div 2;
   552     rect.y:= edgeHeight;
   552     rect.y:= edgeHeight;
   553     rect.w:= rect.w - edgeHeight * 2;
   553     rect.w:= rect.w - edgeHeight * 2;
   554     rect.h:= textHeight + cornerHeight * 2 - edgeHeight * 2;
   554     rect.h:= textHeight + cornerHeight * 2 - edgeHeight * 2;
   555     i:= rect.w;
   555     i:= rect.w;
   556     j:= rect.h;
   556     j:= rect.h;
   557     SDL_FillRect(finalSurface, @rect, cWhiteColor);
   557     SDL_FillRect(finalSurface, @rect, SDL_MapRGB(finalSurface^.format, cWhiteColor shr 16, cWhiteColor shr 8, cWhiteColor and $FF));
   558 
   558 
   559     pos:= 1; line:= 0;
   559     pos:= 1; line:= 0;
   560     while GetNextSpeechLine(s, #1, pos, substr) do
   560     while GetNextSpeechLine(s, #1, pos, substr) do
   561         begin
   561         begin
   562         tmpsurf:= TTF_RenderUTF8_Blended(Fontz[Font].Handle, PChar(substr), cNearBlackColorChannels);
   562         tmpsurf:= TTF_RenderUTF8_Blended(Fontz[Font].Handle, PChar(substr), cNearBlackColorChannels);