hedgewars/uGears.pas
changeset 1939 4b8e4cd9e7c0
parent 1918 975d5061712f
child 1948 1e0e1f03180d
equal deleted inserted replaced
1938:da7f27122fd2 1939:4b8e4cd9e7c0
   654 end;
   654 end;
   655 
   655 
   656 procedure DrawHH(Gear: PGear);
   656 procedure DrawHH(Gear: PGear);
   657 var t: LongInt;
   657 var t: LongInt;
   658 	amt: TAmmoType;
   658 	amt: TAmmoType;
   659 	hx, hy, cx, cy, tx, ty, sx, sy, m: LongInt;  // hedgehog, crosshair, temp, sprite`
   659 	hx, hy, cx, cy, tx, ty, sx, sy, m: LongInt;  // hedgehog, crosshair, temp, sprite
   660 	lx, ly, dx, dy, ax, ay, aAngle, dAngle: real;  // laser, change
   660 	lx, ly, dx, dy, ax, ay, aAngle, dAngle: real;  // laser, change
   661 	defaultPos, HatVisible: boolean;
   661 	defaultPos, HatVisible: boolean;
   662     VertexBuffer: array [0..1] of TVertex2f;
   662     VertexBuffer: array [0..1] of TVertex2f;
   663 begin
   663 begin
   664 if (Gear^.State and gstHHDeath) <> 0 then
   664 if (Gear^.State and gstHHDeath) <> 0 then
   879 			amBlowTorch: DrawRotated(sprHandBlowTorch, hx, hy, hwSign(Gear^.dX), aangle);
   879 			amBlowTorch: DrawRotated(sprHandBlowTorch, hx, hy, hwSign(Gear^.dX), aangle);
   880 			amRCPlane: begin
   880 			amRCPlane: begin
   881 				DrawRotated(sprHandPlane, hx, hy, hwSign(Gear^.dX), 0);
   881 				DrawRotated(sprHandPlane, hx, hy, hwSign(Gear^.dX), 0);
   882 				defaultPos:= false
   882 				defaultPos:= false
   883 				end;
   883 				end;
   884 			amGirder: DrawSprite(sprGirder, sx-256, sy-256, 0);
   884 			amGirder: begin
       
   885                 DrawSpriteClipped(sprGirder, 
       
   886                                   sx-256, 
       
   887                                   sy-256, 
       
   888                                   LongInt(topY)+WorldDy, 
       
   889                                   LongInt(rightX)+WorldDx, 
       
   890                                   cWaterLine+WorldDy,
       
   891                                   LongInt(leftX)+WorldDx);
       
   892                 end;
   885 		end;
   893 		end;
   886 
   894 
   887 		case amt of
   895 		case amt of
   888 			amAirAttack,
   896 			amAirAttack,
   889 			amMineStrike: DrawRotated(sprHandAirAttack, sx, hwRound(Gear^.Y) + WorldDy, hwSign(Gear^.dX), 0);
   897 			amMineStrike: DrawRotated(sprHandAirAttack, sx, hwRound(Gear^.Y) + WorldDy, hwSign(Gear^.dX), 0);
  1712 repeat
  1720 repeat
  1713 	x:= Left + LongInt(GetRandom(Delta));
  1721 	x:= Left + LongInt(GetRandom(Delta));
  1714 	repeat
  1722 	repeat
  1715 		inc(x, Delta);
  1723 		inc(x, Delta);
  1716 		cnt:= 0;
  1724 		cnt:= 0;
  1717 		y:= -Gear^.Radius * 2;
  1725         if topY > 1024 then
       
  1726 		    y:= 1024-Gear^.Radius * 2
       
  1727         else 
       
  1728 		    y:= topY-Gear^.Radius * 2;
  1718 		while y < LAND_HEIGHT do
  1729 		while y < LAND_HEIGHT do
  1719 			begin
  1730 			begin
  1720 			repeat
  1731 			repeat
  1721 				inc(y, 2);
  1732 				inc(y, 2);
  1722 			until (y >= LAND_HEIGHT) or (CountNonZeroz(x, y, Gear^.Radius - 1) = 0);
  1733 			until (y >= LAND_HEIGHT) or (CountNonZeroz(x, y, Gear^.Radius - 1) = 0);