hedgewars/uStore.pas
changeset 2666 2b8c8f16421e
parent 2665 50b4e544c163
child 2669 4eec706e86b0
equal deleted inserted replaced
2665:50b4e544c163 2666:2b8c8f16421e
   121 TTF_SizeUTF8(Fontz[Font].Handle, Str2PChar(s), w, h);
   121 TTF_SizeUTF8(Fontz[Font].Handle, Str2PChar(s), w, h);
   122 Result.x:= X;
   122 Result.x:= X;
   123 Result.y:= Y;
   123 Result.y:= Y;
   124 Result.w:= w + FontBorder * 2 + 4;
   124 Result.w:= w + FontBorder * 2 + 4;
   125 Result.h:= h + FontBorder * 2;
   125 Result.h:= h + FontBorder * 2;
   126 DrawRoundRect(@Result, cWhiteColor, cNearBlackColor.value, Surface, true);
   126 DrawRoundRect(@Result, cWhiteColor, cNearBlackColorChannels.value, Surface, true);
   127 clr.r:= Color shr 16;
   127 clr.r:= Color shr 16;
   128 clr.g:= (Color shr 8) and $FF;
   128 clr.g:= (Color shr 8) and $FF;
   129 clr.b:= Color and $FF;
   129 clr.b:= Color and $FF;
   130 tmpsurf:= TTF_RenderUTF8_Blended(Fontz[Font].Handle, Str2PChar(s), clr);
   130 tmpsurf:= TTF_RenderUTF8_Blended(Fontz[Font].Handle, Str2PChar(s), clr);
   131 tmpsurf:= doSurfaceConversion(tmpsurf);
   131 tmpsurf:= doSurfaceConversion(tmpsurf);
   164 
   164 
   165 		texsurf:= SDL_CreateRGBSurface(SDL_SWSURFACE, r.w, r.h, 32, RMask, GMask, BMask, AMask);
   165 		texsurf:= SDL_CreateRGBSurface(SDL_SWSURFACE, r.w, r.h, 32, RMask, GMask, BMask, AMask);
   166 		TryDo(texsurf <> nil, errmsgCreateSurface, true);
   166 		TryDo(texsurf <> nil, errmsgCreateSurface, true);
   167 		TryDo(SDL_SetColorKey(texsurf, SDL_SRCCOLORKEY, 0) = 0, errmsgTransparentSet, true);
   167 		TryDo(SDL_SetColorKey(texsurf, SDL_SRCCOLORKEY, 0) = 0, errmsgTransparentSet, true);
   168 
   168 
   169 		DrawRoundRect(@r, cWhiteColor, cNearBlackColor.value, texsurf, true);
   169 		DrawRoundRect(@r, cWhiteColor, cNearBlackColorChannels.value, texsurf, true);
   170 		rr:= r;
   170 		rr:= r;
   171 		inc(rr.x, 2); dec(rr.w, 4); inc(rr.y, 2); dec(rr.h, 4);
   171 		inc(rr.x, 2); dec(rr.w, 4); inc(rr.y, 2); dec(rr.h, 4);
   172 		DrawRoundRect(@rr, Clan^.Color, Clan^.Color, texsurf, false);
   172 		DrawRoundRect(@rr, Clan^.Color, Clan^.Color, texsurf, false);
   173 		HealthTex:= Surface2Tex(texsurf, false);
   173 		HealthTex:= Surface2Tex(texsurf, false);
   174 		SDL_FreeSurface(texsurf);
   174 		SDL_FreeSurface(texsurf);
   933         if s[pos] <> #1 then inc(pos);
   933         if s[pos] <> #1 then inc(pos);
   934         while s[prevpos+1] = ' 'do inc(prevpos);
   934         while s[prevpos+1] = ' 'do inc(prevpos);
   935         substr:= copy(s, prevpos+1, pos-prevpos-1);
   935         substr:= copy(s, prevpos+1, pos-prevpos-1);
   936         if Length(substr) <> 0 then
   936         if Length(substr) <> 0 then
   937            begin
   937            begin
   938            tmpsurf:= TTF_RenderUTF8_Blended(Fontz[Font].Handle, Str2PChar(substr), cNearBlackColor);
   938            tmpsurf:= TTF_RenderUTF8_Blended(Fontz[Font].Handle, Str2PChar(substr), cNearBlackColorChannels);
   939            rect.x:= edgeHeight + 1 + ((i - w) div 2);
   939            rect.x:= edgeHeight + 1 + ((i - w) div 2);
   940            // trying to more evenly position the text, vertically
   940            // trying to more evenly position the text, vertically
   941            rect.y:= edgeHeight + ((j-(numLines*h)) div 2) + line * h;
   941            rect.y:= edgeHeight + ((j-(numLines*h)) div 2) + line * h;
   942            SDLTry(tmpsurf <> nil, true);
   942            SDLTry(tmpsurf <> nil, true);
   943            SDL_UpperBlit(tmpsurf, nil, Result, @rect);
   943            SDL_UpperBlit(tmpsurf, nil, Result, @rect);