diff -r 42af3bfc832c -r 408803ca951a hedgewars/uChat.pas --- a/hedgewars/uChat.pas Sat Jan 03 00:28:33 2015 +0300 +++ b/hedgewars/uChat.pas Sat Jan 03 15:25:42 2015 -0500 @@ -32,7 +32,7 @@ procedure SendHogSpeech(s: shortstring); implementation -uses SDLh, uInputHandler, uTypes, uVariables, uCommands, uUtils, uTextures, uRender, uIO, uScript; +uses SDLh, uInputHandler, uTypes, uVariables, uCommands, uUtils, uTextures, uRender, uIO, uScript, uRenderUtils; const MaxStrIndex = 27; @@ -91,8 +91,6 @@ dstrect : TSDL_Rect; // destination rectangle for blitting font : THWFont; const - shadowcolor: TSDL_Color = (r:$00; g:$00; b:$00; a:$FF); - //shadowcolor: TSDL_Color = (r:$00; g:$00; b:$00; a:$80); shadowint = $80 shl AShift; begin @@ -117,23 +115,11 @@ // draw background SDL_FillRect(resSurface, @dstrect, shadowint); -dstrect.x:= Padding + 1; -dstrect.y:= Padding + 1; -// doesn't matter if .w and .h still include padding, SDL_UpperBlit will clip - - -// create and blit text shadow -strSurface:= TTF_RenderUTF8_Solid(Fontz[font].Handle, Str2PChar(str), shadowcolor); -SDL_UpperBlit(strSurface, nil, resSurface, @dstrect); -SDL_FreeSurface(strSurface); - -// non-shadow text starts at padding -dstrect.x:= Padding; -dstrect.y:= Padding; // create and blit text strSurface:= TTF_RenderUTF8_Blended(Fontz[font].Handle, Str2PChar(str), cl.color); -SDL_UpperBlit(strSurface, nil, resSurface, @dstrect); +//SDL_UpperBlit(strSurface, nil, resSurface, @dstrect); +if strSurface <> nil then copyTOXY(strSurface, resSurface, Padding, Padding); SDL_FreeSurface(strSurface); cl.Tex:= Surface2Tex(resSurface, false);