hedgewars/uWorld.pas
changeset 6999 486db9d26e4b
parent 6992 b8f3d8991e92
child 7013 54db061b5710
equal deleted inserted replaced
6998:f2524a80eea2 6999:486db9d26e4b
  1230 if (TargetPoint.X <> NoPointX) and (CurrentTeam <> nil) and (CurrentHedgehog <> nil) then
  1230 if (TargetPoint.X <> NoPointX) and (CurrentTeam <> nil) and (CurrentHedgehog <> nil) then
  1231     begin
  1231     begin
  1232     with PHedgehog(CurrentHedgehog)^ do
  1232     with PHedgehog(CurrentHedgehog)^ do
  1233         begin
  1233         begin
  1234         if CurAmmoType = amBee then
  1234         if CurAmmoType = amBee then
  1235             DrawRotatedF(sprTargetBee, TargetPoint.X + WorldDx, TargetPoint.Y + WorldDy, 0, 0, (RealTicks shr 3) mod 360)
  1235             DrawSpriteRotatedF(sprTargetBee, TargetPoint.X + WorldDx, TargetPoint.Y + WorldDy, 0, 0, (RealTicks shr 3) mod 360)
  1236         else
  1236         else
  1237             DrawRotatedF(sprTargetP, TargetPoint.X + WorldDx, TargetPoint.Y + WorldDy, 0, 0, (RealTicks shr 3) mod 360)
  1237             DrawSpriteRotatedF(sprTargetP, TargetPoint.X + WorldDx, TargetPoint.Y + WorldDy, 0, 0, (RealTicks shr 3) mod 360)
  1238         end
  1238         end
  1239     end;
  1239     end;
  1240 {$WARNINGS ON}
  1240 {$WARNINGS ON}
  1241 
  1241 
  1242 // this scale is used to keep the various widgets at the same dimension at all zoom levels
  1242 // this scale is used to keep the various widgets at the same dimension at all zoom levels
  1316         // draw health bar
  1316         // draw health bar
  1317         r.x:= 0;
  1317         r.x:= 0;
  1318         r.y:= 0;
  1318         r.y:= 0;
  1319         r.w:= 2 + TeamHealthBarWidth;
  1319         r.w:= 2 + TeamHealthBarWidth;
  1320         r.h:= HealthTex^.h;
  1320         r.h:= HealthTex^.h;
  1321         DrawFromRect(14, cScreenHeight + DrawHealthY + smallScreenOffset, @r, HealthTex);
  1321         DrawTextureFromRect(14, cScreenHeight + DrawHealthY + smallScreenOffset, @r, HealthTex);
  1322 
  1322 
  1323         // draw health bars right border
  1323         // draw health bars right border
  1324         inc(r.x, cTeamHealthWidth + 2);
  1324         inc(r.x, cTeamHealthWidth + 2);
  1325         if TeamHealth = 0 then inc(r.x);
  1325         if TeamHealth = 0 then inc(r.x);
  1326         r.w:= 3;
  1326         r.w:= 3;
  1327         DrawFromRect(TeamHealthBarWidth + 16, cScreenHeight + DrawHealthY + smallScreenOffset, @r, HealthTex);
  1327         DrawTextureFromRect(TeamHealthBarWidth + 16, cScreenHeight + DrawHealthY + smallScreenOffset, @r, HealthTex);
  1328 
  1328 
  1329         if not highlight and not hasGone and (TeamHealth > 1) then
  1329         if not highlight and not hasGone and (TeamHealth > 1) then
  1330             for i:= 0 to cMaxHHIndex do
  1330             for i:= 0 to cMaxHHIndex do
  1331                 if Hedgehogs[i].Gear <> nil then
  1331                 if Hedgehogs[i].Gear <> nil then
  1332                     begin
  1332                     begin
  1351             // draw name
  1351             // draw name
  1352             r.x:= 2;
  1352             r.x:= 2;
  1353             r.y:= 2;
  1353             r.y:= 2;
  1354             r.w:= NameTagTex^.w - 4;
  1354             r.w:= NameTagTex^.w - 4;
  1355             r.h:= NameTagTex^.h - 4;
  1355             r.h:= NameTagTex^.h - 4;
  1356             DrawFromRect(-NameTagTex^.w - 14, cScreenHeight + DrawHealthY + smallScreenOffset + 2, @r, NameTagTex);
  1356             DrawTextureFromRect(-NameTagTex^.w - 14, cScreenHeight + DrawHealthY + smallScreenOffset + 2, @r, NameTagTex);
  1357             // draw flag
  1357             // draw flag
  1358             r.w:= 22;
  1358             r.w:= 22;
  1359             r.h:= 15;
  1359             r.h:= 15;
  1360             DrawFromRect(-12, cScreenHeight + DrawHealthY + smallScreenOffset + 2, @r, FlagTex);
  1360             DrawTextureFromRect(-12, cScreenHeight + DrawHealthY + smallScreenOffset + 2, @r, FlagTex);
  1361             // draw health bar
  1361             // draw health bar
  1362             r.w:= TeamHealthBarWidth + 1;
  1362             r.w:= TeamHealthBarWidth + 1;
  1363             r.h:= HealthTex^.h - 4;
  1363             r.h:= HealthTex^.h - 4;
  1364             DrawFromRect(16, cScreenHeight + DrawHealthY + smallScreenOffset + 2, @r, HealthTex);
  1364             DrawTextureFromRect(16, cScreenHeight + DrawHealthY + smallScreenOffset + 2, @r, HealthTex);
  1365             end;
  1365             end;
  1366         end;
  1366         end;
  1367 if smallScreenOffset <> 0 then
  1367 if smallScreenOffset <> 0 then
  1368     begin
  1368     begin
  1369     SetScale(cDefaultZoomLevel);
  1369     SetScale(cDefaultZoomLevel);
  1434 // Chat
  1434 // Chat
  1435 DrawChat;
  1435 DrawChat;
  1436 
  1436 
  1437 // various captions
  1437 // various captions
  1438 if fastUntilLag then
  1438 if fastUntilLag then
  1439     DrawCentered(0, (cScreenHeight shr 1), SyncTexture);
  1439     DrawTextureCentered(0, (cScreenHeight shr 1), SyncTexture);
  1440 if isPaused then
  1440 if isPaused then
  1441     DrawCentered(0, (cScreenHeight shr 1), PauseTexture);
  1441     DrawTextureCentered(0, (cScreenHeight shr 1), PauseTexture);
  1442 if not isFirstFrame and (missionTimer <> 0) or isPaused or fastUntilLag or (GameState = gsConfirm) then
  1442 if not isFirstFrame and (missionTimer <> 0) or isPaused or fastUntilLag or (GameState = gsConfirm) then
  1443     begin
  1443     begin
  1444     if (ReadyTimeLeft = 0) and (missionTimer > 0) then
  1444     if (ReadyTimeLeft = 0) and (missionTimer > 0) then
  1445         dec(missionTimer, Lag);
  1445         dec(missionTimer, Lag);
  1446     if missionTimer < 0 then
  1446     if missionTimer < 0 then
  1447         missionTimer:= 0; // avoid subtracting below 0
  1447         missionTimer:= 0; // avoid subtracting below 0
  1448     if missionTex <> nil then
  1448     if missionTex <> nil then
  1449         DrawCentered(0, Min((cScreenHeight shr 1) + 100, cScreenHeight - 48 - missionTex^.h), missionTex);
  1449         DrawTextureCentered(0, Min((cScreenHeight shr 1) + 100, cScreenHeight - 48 - missionTex^.h), missionTex);
  1450     end;
  1450     end;
  1451 
  1451 
  1452 // fps
  1452 // fps
  1453 {$IFDEF USE_TOUCH_INTERFACE}
  1453 {$IFDEF USE_TOUCH_INTERFACE}
  1454 offsetX:= pauseButton.frame.y + pauseButton.frame.h + 12;
  1454 offsetX:= pauseButton.frame.y + pauseButton.frame.h + 12;
  1521       AddCaption(Format(trmsg[sidVolume], s), cWhiteColor, capgrpVolume)
  1521       AddCaption(Format(trmsg[sidVolume], s), cWhiteColor, capgrpVolume)
  1522       end
  1522       end
  1523    end;
  1523    end;
  1524 
  1524 
  1525 if GameState = gsConfirm then
  1525 if GameState = gsConfirm then
  1526     DrawCentered(0, (cScreenHeight shr 1), ConfirmTexture);
  1526     DrawTextureCentered(0, (cScreenHeight shr 1), ConfirmTexture);
  1527 
  1527 
  1528 if ScreenFade <> sfNone then
  1528 if ScreenFade <> sfNone then
  1529     begin
  1529     begin
  1530     if not isFirstFrame then
  1530     if not isFirstFrame then
  1531         case ScreenFade of
  1531         case ScreenFade of