hedgewars/uWorld.pas
changeset 7374 514138949c76
parent 7304 8b3575750cd2
parent 7368 20448801e86a
child 11317 62287d4044e7
equal deleted inserted replaced
7304:8b3575750cd2 7374:514138949c76
  1344             DrawTextureFromRect(-12, cScreenHeight + DrawHealthY + smallScreenOffset + 2, @r, FlagTex);
  1344             DrawTextureFromRect(-12, cScreenHeight + DrawHealthY + smallScreenOffset + 2, @r, FlagTex);
  1345             // draw health bar
  1345             // draw health bar
  1346             r.w:= TeamHealthBarWidth + 1;
  1346             r.w:= TeamHealthBarWidth + 1;
  1347             r.h:= HealthTex^.h - 4;
  1347             r.h:= HealthTex^.h - 4;
  1348             DrawTextureFromRect(16, cScreenHeight + DrawHealthY + smallScreenOffset + 2, @r, HealthTex);
  1348             DrawTextureFromRect(16, cScreenHeight + DrawHealthY + smallScreenOffset + 2, @r, HealthTex);
       
  1349             if not hasGone and (TeamHealth > 1) then
       
  1350                 begin
       
  1351                 Tint(Clan^.Color shl 8 or $FF);
       
  1352                 for i:= 0 to cMaxHHIndex do
       
  1353                     if Hedgehogs[i].Gear <> nil then
       
  1354                         begin
       
  1355                         inc(h,Hedgehogs[i].Gear^.Health);
       
  1356                         if h < TeamHealth then DrawTexture(15 + h*TeamHealthBarWidth div TeamHealth, cScreenHeight + DrawHealthY + smallScreenOffset + 1, SpritesData[sprSlider].Texture);
       
  1357                         end;
       
  1358                 if TeamsCount * 20 > Longword(cScreenHeight) div 5 then
       
  1359                     Tint($FF,$FF,$FF,$80)
       
  1360                 else Tint($FF, $FF, $FF, $FF);
       
  1361                 end;
  1349             end;
  1362             end;
  1350         end;
  1363         end;
  1351 if smallScreenOffset <> 0 then
  1364 if smallScreenOffset <> 0 then
  1352     begin
  1365     begin
  1353     SetScale(cDefaultZoomLevel);
  1366     SetScale(cDefaultZoomLevel);
  1566         end
  1579         end
  1567     end;
  1580     end;
  1568 isFirstFrame:= false
  1581 isFirstFrame:= false
  1569 end;
  1582 end;
  1570 
  1583 
       
  1584 var PrevSentPointTime: LongWord = 0;
       
  1585 
  1571 procedure MoveCamera;
  1586 procedure MoveCamera;
  1572 var EdgesDist, wdy, shs,z: LongInt;
  1587 var EdgesDist, wdy, shs,z: LongInt;
  1573     PrevSentPointTime: LongWord = 0;
       
  1574 begin
  1588 begin
  1575 {$IFNDEF MOBILE}
  1589 {$IFNDEF MOBILE}
  1576 if (not (CurrentTeam^.ExtDriven and isCursorVisible and (not bShowAmmoMenu))) and cHasFocus and (GameState <> gsConfirm) then
  1590 if (not (CurrentTeam^.ExtDriven and isCursorVisible and (not bShowAmmoMenu))) and cHasFocus and (GameState <> gsConfirm) then
  1577     uCursor.updatePosition();
  1591     uCursor.updatePosition();
  1578 {$ENDIF}
  1592 {$ENDIF}
  1579 z:= round(200/zoom);
  1593 z:= round(200/zoom);
  1580 if not PlacingHogs and (FollowGear <> nil) and (not isCursorVisible) and (not bShowAmmoMenu) and (not fastUntilLag) then
  1594 if not PlacingHogs and (FollowGear <> nil) and (not isCursorVisible) and (not bShowAmmoMenu) and (not fastUntilLag) then
  1581     if (not autoCameraOn) then
  1595     if (not autoCameraOn) then
  1582         FollowGear:= nil
  1596         FollowGear:= nil
  1583     else        
  1597     else
  1584     if ((abs(CursorPoint.X - prevPoint.X) + abs(CursorPoint.Y - prevpoint.Y)) > 4) then
  1598     if ((abs(CursorPoint.X - prevPoint.X) + abs(CursorPoint.Y - prevpoint.Y)) > 4) then
  1585         begin
  1599         begin
  1586         FollowGear:= nil;
  1600         FollowGear:= nil;
  1587         prevPoint:= CursorPoint;
  1601         prevPoint:= CursorPoint;
  1588         exit
  1602         exit
  1791     bSelected:= false;
  1805     bSelected:= false;
  1792     bShowFinger:= false;
  1806     bShowFinger:= false;
  1793     Frames:= 0;
  1807     Frames:= 0;
  1794     WorldDx:= -512;
  1808     WorldDx:= -512;
  1795     WorldDy:= -256;
  1809     WorldDy:= -256;
       
  1810     PrevSentPointTime:= 0;
  1796 
  1811 
  1797     FPS:= 0;
  1812     FPS:= 0;
  1798     CountTicks:= 0;
  1813     CountTicks:= 0;
  1799     SoundTimerTicks:= 0;
  1814     SoundTimerTicks:= 0;
  1800     prevPoint.X:= 0;
  1815     prevPoint.X:= 0;