hedgewars/uWorld.pas
changeset 9656 18422d205080
parent 9654 47332746e6d9
child 9666 8dcb25112d96
equal deleted inserted replaced
9655:e154ccca4dad 9656:18422d205080
  1232 
  1232 
  1233 procedure RenderTeamsHealth;
  1233 procedure RenderTeamsHealth;
  1234 var t, i, h, smallScreenOffset : LongInt;
  1234 var t, i, h, smallScreenOffset : LongInt;
  1235     r: TSDL_Rect;
  1235     r: TSDL_Rect;
  1236     highlight: boolean;
  1236     highlight: boolean;
       
  1237     htex: PTexture;
  1237 begin
  1238 begin
  1238 if TeamsCount * 20 > Longword(cScreenHeight) div 7 then  // take up less screen on small displays
  1239 if TeamsCount * 20 > Longword(cScreenHeight) div 7 then  // take up less screen on small displays
  1239     begin
  1240     begin
  1240     SetScale(1.5);
  1241     SetScale(1.5);
  1241     smallScreenOffset:= cScreenHeight div 6;
  1242     smallScreenOffset:= cScreenHeight div 6;
  1249         begin
  1250         begin
  1250         h:= 0;
  1251         h:= 0;
  1251         highlight:= bShowFinger and (CurrentTeam = TeamsArray[t]) and ((RealTicks mod 1000) < 500);
  1252         highlight:= bShowFinger and (CurrentTeam = TeamsArray[t]) and ((RealTicks mod 1000) < 500);
  1252 
  1253 
  1253         if highlight then
  1254         if highlight then
       
  1255             begin
  1254             Tint(Clan^.Color shl 8 or $FF);
  1256             Tint(Clan^.Color shl 8 or $FF);
       
  1257             htex:= GenericHealthTexture
       
  1258             end
       
  1259         else
       
  1260             htex:= Clan^.HealthTex;
  1255 
  1261 
  1256          // draw name
  1262          // draw name
  1257         DrawTexture(-NameTagTex^.w - 16, cScreenHeight + DrawHealthY + smallScreenOffset, NameTagTex);
  1263         DrawTexture(-NameTagTex^.w - 16, cScreenHeight + DrawHealthY + smallScreenOffset, NameTagTex);
  1258 
  1264 
  1259         // draw flag
  1265         // draw flag
  1261 
  1267 
  1262         // draw health bar
  1268         // draw health bar
  1263         r.x:= 0;
  1269         r.x:= 0;
  1264         r.y:= 0;
  1270         r.y:= 0;
  1265         r.w:= 2 + TeamHealthBarWidth;
  1271         r.w:= 2 + TeamHealthBarWidth;
  1266         r.h:= HealthTex^.h;
  1272         r.h:= htex^.h;
  1267         DrawTextureFromRect(14, cScreenHeight + DrawHealthY + smallScreenOffset, @r, HealthTex);
  1273         DrawTextureFromRect(14, cScreenHeight + DrawHealthY + smallScreenOffset, @r, htex);
  1268 
  1274 
  1269         // draw health bars right border
  1275         // draw health bars right border
  1270         inc(r.x, cTeamHealthWidth + 2);
  1276         inc(r.x, cTeamHealthWidth + 2);
  1271         r.w:= 3;
  1277         r.w:= 3;
  1272         DrawTextureFromRect(TeamHealthBarWidth + 15, cScreenHeight + DrawHealthY + smallScreenOffset, @r, HealthTex);
  1278         DrawTextureFromRect(TeamHealthBarWidth + 15, cScreenHeight + DrawHealthY + smallScreenOffset, @r, htex);
  1273 
  1279 
  1274         if not hasGone then
  1280         if not hasGone then
  1275             for i:= 0 to cMaxHHIndex do
  1281             for i:= 0 to cMaxHHIndex do
  1276                 if Hedgehogs[i].Gear <> nil then
  1282                 if Hedgehogs[i].Gear <> nil then
  1277                     begin
  1283                     begin