hedgewars/uStore.pas
changeset 189 33d147c69a83
parent 183 57c2ef19f719
child 190 206aabea2229
equal deleted inserted replaced
188:a7c2a61524c2 189:33d147c69a83
   102 Result.x:= X;
   102 Result.x:= X;
   103 Result.y:= Y;
   103 Result.y:= Y;
   104 Result.w:= w + 6;
   104 Result.w:= w + 6;
   105 Result.h:= h + 2;
   105 Result.h:= h + 2;
   106 DrawRoundRect(@Result, cWhiteColor, cColorNearBlack, Surface);
   106 DrawRoundRect(@Result, cWhiteColor, cColorNearBlack, Surface);
   107 SDL_GetRGB(Color, Surface.format, @clr.r, @clr.g, @clr.b);
   107 clr.r:= Color shr 16;
       
   108 clr.g:= (Color shr 8) and $FF;
       
   109 clr.b:= Color and $FF;
       
   110 clr.a:= 0;
   108 tmpsurf:= TTF_RenderUTF8_Blended(Fontz[Font].Handle, PChar(s), clr);
   111 tmpsurf:= TTF_RenderUTF8_Blended(Fontz[Font].Handle, PChar(s), clr);
   109 Result.x:= X + 3;
   112 Result.x:= X + 3;
   110 Result.y:= Y + 1;
   113 Result.y:= Y + 1;
   111 SDL_UpperBlit(tmpsurf, nil, Surface, @Result);
   114 SDL_UpperBlit(tmpsurf, nil, Surface, @Result);
   112 SDL_FreeSurface(tmpsurf);
   115 SDL_FreeSurface(tmpsurf);
   141       r.h:= Team.NameTag.h;
   144       r.h:= Team.NameTag.h;
   142       DrawRoundRect(@r, cWhiteColor, cColorNearBlack, StoreSurface);
   145       DrawRoundRect(@r, cWhiteColor, cColorNearBlack, StoreSurface);
   143       Team.HealthRect:= r;
   146       Team.HealthRect:= r;
   144       rr:= r;
   147       rr:= r;
   145       inc(rr.x, 2); dec(rr.w, 4); inc(rr.y, 2); dec(rr.h, 4);
   148       inc(rr.x, 2); dec(rr.w, 4); inc(rr.y, 2); dec(rr.h, 4);
   146       DrawRoundRect(@rr, Team.Color, Team.Color, StoreSurface, false);
   149       DrawRoundRect(@rr, Team.AdjColor, Team.AdjColor, StoreSurface, false);
   147       inc(r.y, r.h);
   150       inc(r.y, r.h);
   148       dec(drY, r.h + 2);
   151       dec(drY, r.h + 2);
   149       Team.DrawHealthY:= drY;
   152       Team.DrawHealthY:= drY;
   150       for i:= 0 to 7 do
   153       for i:= 0 to 7 do
   151           with Team.Hedgehogs[i] do
   154           with Team.Hedgehogs[i] do
   172     TryDo(SDL_SetColorKey(tmpsurf, SDL_SRCCOLORKEY, TransColor) = 0, errmsgTransparentSet, true);
   175     TryDo(SDL_SetColorKey(tmpsurf, SDL_SRCCOLORKEY, TransColor) = 0, errmsgTransparentSet, true);
   173 
   176 
   174     Team:= TeamsList;
   177     Team:= TeamsList;
   175     while Team<>nil do
   178     while Team<>nil do
   176       begin
   179       begin
   177       SDL_FillRect(StoreSurface, @r, Team.Color);
   180       SDL_FillRect(StoreSurface, @r, Team.AdjColor);
   178       SDL_UpperBlit(tmpsurf, nil, StoreSurface, @r);
   181       SDL_UpperBlit(tmpsurf, nil, StoreSurface, @r);
   179       Team.CrossHairRect:= r;
   182       Team.CrossHairRect:= r;
   180       inc(r.x, 16);
   183       inc(r.x, 16);
   181       Team:= Team.Next
   184       Team:= Team.Next
   182       end;
   185       end;
   374     tmpsurf: PSDL_Surface;
   377     tmpsurf: PSDL_Surface;
   375     r: TSDL_Rect;
   378     r: TSDL_Rect;
   376 begin
   379 begin
   377 r.x:= X;
   380 r.x:= X;
   378 r.y:= Y;
   381 r.y:= Y;
   379 SDL_GetRGB(cWhiteColor, PixelFormat, @clr.r, @clr.g, @clr.b);
   382 clr.r:= $FF;
       
   383 clr.g:= $FF;
       
   384 clr.b:= $FF;
       
   385 clr.a:= 0;
   380 tmpsurf:= TTF_RenderUTF8_Solid(Fontz[Font].Handle, PChar(s), clr);
   386 tmpsurf:= TTF_RenderUTF8_Solid(Fontz[Font].Handle, PChar(s), clr);
   381 SDL_UpperBlit(tmpsurf, nil, Surface, @r);
   387 SDL_UpperBlit(tmpsurf, nil, Surface, @r);
   382 SDL_FreeSurface(tmpsurf)
   388 SDL_FreeSurface(tmpsurf)
   383 end;
   389 end;
   384 
   390