hedgewars/uStore.pas
changeset 549 4278a80140a8
parent 547 b81a055f2d06
child 567 b6de36975a3c
equal deleted inserted replaced
548:ac1e32b538fd 549:4278a80140a8
   142     drY:= cScreenHeight - 4;
   142     drY:= cScreenHeight - 4;
   143     for t:= 0 to Pred(TeamsCount) do
   143     for t:= 0 to Pred(TeamsCount) do
   144      with TeamsArray[t]^ do
   144      with TeamsArray[t]^ do
   145       begin
   145       begin
   146       r.w:= 104;
   146       r.w:= 104;
   147       NameTag:= RenderString(TeamName, Color, Font);
   147       NameTag:= RenderString(TeamName, Clan^.Color, Font);
   148       r.w:= cTeamHealthWidth + 5;
   148       r.w:= cTeamHealthWidth + 5;
   149       r.h:= NameTag^.h;
   149       r.h:= NameTag^.h;
   150       DrawRoundRect(@r, cWhiteColor, cColorNearBlack, StoreSurface, true);
   150       DrawRoundRect(@r, cWhiteColor, cColorNearBlack, StoreSurface, true);
   151       HealthRect:= r;
   151       HealthRect:= r;
   152       rr:= r;
   152       rr:= r;
   153       inc(rr.x, 2); dec(rr.w, 4); inc(rr.y, 2); dec(rr.h, 4);
   153       inc(rr.x, 2); dec(rr.w, 4); inc(rr.y, 2); dec(rr.h, 4);
   154       DrawRoundRect(@rr, AdjColor, AdjColor, StoreSurface, false);
   154       DrawRoundRect(@rr, Clan^.AdjColor, Clan^.AdjColor, StoreSurface, false);
   155       inc(r.y, r.h);
   155       inc(r.y, r.h);
   156       dec(drY, r.h + 2);
   156       dec(drY, r.h + 2);
   157       DrawHealthY:= drY;
   157       DrawHealthY:= drY;
   158       for i:= 0 to 7 do
   158       for i:= 0 to 7 do
   159           with Hedgehogs[i] do
   159           with Hedgehogs[i] do
   160                if Gear <> nil then
   160                if Gear <> nil then
   161                   NameTag:= RenderString(Name, Color, fnt16);
   161                   NameTag:= RenderString(Name, Clan^.Color, fnt16);
   162       end;
   162       end;
   163     end;
   163     end;
   164 
   164 
   165     procedure MakeCrossHairs;
   165     procedure MakeCrossHairs;
   166     var t: LongInt;
   166     var t: LongInt;
   173     for t:= 0 to Pred(TeamsCount) do
   173     for t:= 0 to Pred(TeamsCount) do
   174       with TeamsArray[t]^ do
   174       with TeamsArray[t]^ do
   175       begin
   175       begin
   176       CrosshairSurf:= SDL_CreateRGBSurface(SDL_HWSURFACE, tmpsurf^.w, tmpsurf^.h, cBits, PixelFormat^.RMask, PixelFormat^.GMask, PixelFormat^.BMask, PixelFormat^.AMask);
   176       CrosshairSurf:= SDL_CreateRGBSurface(SDL_HWSURFACE, tmpsurf^.w, tmpsurf^.h, cBits, PixelFormat^.RMask, PixelFormat^.GMask, PixelFormat^.BMask, PixelFormat^.AMask);
   177       TryDo(CrosshairSurf <> nil, errmsgCreateSurface, true);
   177       TryDo(CrosshairSurf <> nil, errmsgCreateSurface, true);
   178       SDL_FillRect(CrosshairSurf, nil, AdjColor);
   178       SDL_FillRect(CrosshairSurf, nil, Clan^.AdjColor);
   179       SDL_UpperBlit(tmpsurf, nil, CrosshairSurf, nil);
   179       SDL_UpperBlit(tmpsurf, nil, CrosshairSurf, nil);
   180       TryDo(SDL_SetColorKey(CrosshairSurf, SDL_SRCCOLORKEY or SDL_RLEACCEL, 0) = 0, errmsgTransparentSet, true);
   180       TryDo(SDL_SetColorKey(CrosshairSurf, SDL_SRCCOLORKEY or SDL_RLEACCEL, 0) = 0, errmsgTransparentSet, true);
   181       end;
   181       end;
   182 
   182 
   183     SDL_FreeSurface(tmpsurf)
   183     SDL_FreeSurface(tmpsurf)
   451 procedure RenderHealth(var Hedgehog: THedgehog);
   451 procedure RenderHealth(var Hedgehog: THedgehog);
   452 var s: shortstring;
   452 var s: shortstring;
   453 begin
   453 begin
   454 str(Hedgehog.Gear^.Health, s);
   454 str(Hedgehog.Gear^.Health, s);
   455 if Hedgehog.HealthTag <> nil then SDL_FreeSurface(Hedgehog.HealthTag);
   455 if Hedgehog.HealthTag <> nil then SDL_FreeSurface(Hedgehog.HealthTag);
   456 Hedgehog.HealthTag:= RenderString(s, Hedgehog.Team^.Color, fnt16)
   456 Hedgehog.HealthTag:= RenderString(s, Hedgehog.Team^.Clan^.Color, fnt16)
   457 end;
   457 end;
   458 
   458 
   459 function  LoadImage(const filename: string; hasAlpha: boolean; critical, setTransparent: boolean): PSDL_Surface;
   459 function  LoadImage(const filename: string; hasAlpha: boolean; critical, setTransparent: boolean): PSDL_Surface;
   460 var tmpsurf: PSDL_Surface;
   460 var tmpsurf: PSDL_Surface;
   461     Result: PSDL_Surface;
   461     Result: PSDL_Surface;