hedgewars/uWorld.pas
changeset 13145 e330feceb662
parent 13023 0248cf0da834
child 13161 26f0c3669b4e
equal deleted inserted replaced
13144:674b76f2d64a 13145:e330feceb662
  1028 
  1028 
  1029 procedure RenderTeamsHealth;
  1029 procedure RenderTeamsHealth;
  1030 var t, i,  h, smallScreenOffset, TeamHealthBarWidth : LongInt;
  1030 var t, i,  h, smallScreenOffset, TeamHealthBarWidth : LongInt;
  1031     r: TSDL_Rect;
  1031     r: TSDL_Rect;
  1032     highlight: boolean;
  1032     highlight: boolean;
       
  1033     hasVisibleHog: boolean;
  1033     htex: PTexture;
  1034     htex: PTexture;
  1034 begin
  1035 begin
  1035 if TeamsCount * 20 > Longword(cScreenHeight) div 7 then  // take up less screen on small displays
  1036 if TeamsCount * 20 > Longword(cScreenHeight) div 7 then  // take up less screen on small displays
  1036     begin
  1037     begin
  1037     SetScale(1.5);
  1038     SetScale(1.5);
  1040         Tint($FF,$FF,$FF,$80);
  1041         Tint($FF,$FF,$FF,$80);
  1041     end
  1042     end
  1042 else smallScreenOffset:= 0;
  1043 else smallScreenOffset:= 0;
  1043 for t:= 0 to Pred(TeamsCount) do
  1044 for t:= 0 to Pred(TeamsCount) do
  1044     with TeamsArray[t]^ do
  1045     with TeamsArray[t]^ do
  1045       if TeamHealth > 0 then
  1046       begin
       
  1047       hasVisibleHog:= false;
       
  1048       for i:= 0 to cMaxHHIndex do
       
  1049           if (Hedgehogs[i].Gear <> nil) then
       
  1050               hasVisibleHog:= true;
       
  1051       if (TeamHealth > 0) and hasVisibleHog then
  1046         begin
  1052         begin
  1047         highlight:= bShowFinger and (CurrentTeam = TeamsArray[t]) and ((RealTicks mod 1000) < 500);
  1053         highlight:= bShowFinger and (CurrentTeam = TeamsArray[t]) and ((RealTicks mod 1000) < 500);
  1048 
  1054 
  1049         if highlight then
  1055         if highlight then
  1050             begin
  1056             begin
  1141             if OwnerTex <> nil then
  1147             if OwnerTex <> nil then
  1142                 h:= h - OwnerTex^.w - 4;
  1148                 h:= h - OwnerTex^.w - 4;
  1143             DrawSpriteRotatedF(sprFinger, h, cScreenHeight + DrawHealthY + smallScreenOffset + 2 + SpritesData[sprFinger].Width div 4, 0, 1, -90);
  1149             DrawSpriteRotatedF(sprFinger, h, cScreenHeight + DrawHealthY + smallScreenOffset + 2 + SpritesData[sprFinger].Width div 4, 0, 1, -90);
  1144             end;
  1150             end;
  1145         end;
  1151         end;
       
  1152       end;
  1146 if smallScreenOffset <> 0 then
  1153 if smallScreenOffset <> 0 then
  1147     begin
  1154     begin
  1148     SetScale(cDefaultZoomLevel);
  1155     SetScale(cDefaultZoomLevel);
  1149     if TeamsCount * 20 > Longword(cScreenHeight) div 5 then
  1156     if TeamsCount * 20 > Longword(cScreenHeight) div 5 then
  1150         untint;
  1157         untint;