hedgewars/GSHandlers.inc
changeset 4798 84fb1ff0a1c0
parent 4797 15a443eec371
child 4799 0f408159a33f
equal deleted inserted replaced
4797:15a443eec371 4798:84fb1ff0a1c0
   175 end;
   175 end;
   176 
   176 
   177 procedure CheckCollision(Gear: PGear); inline;
   177 procedure CheckCollision(Gear: PGear); inline;
   178 begin
   178 begin
   179     if TestCollisionXwithGear(Gear, hwSign(Gear^.X)) or TestCollisionYwithGear(Gear, hwSign(Gear^.Y)
   179     if TestCollisionXwithGear(Gear, hwSign(Gear^.X)) or TestCollisionYwithGear(Gear, hwSign(Gear^.Y)
       
   180        )
       
   181         then Gear^.State := Gear^.State or      gstCollision
       
   182     else Gear^.State := Gear^.State and not gstCollision
       
   183 end;
       
   184 
       
   185 procedure CheckCollisionWithLand(Gear: PGear); inline;
       
   186 begin
       
   187     if TestCollisionX(Gear, hwSign(Gear^.X)) or TestCollisionY(Gear, hwSign(Gear^.Y)
   180        )
   188        )
   181         then Gear^.State := Gear^.State or      gstCollision
   189         then Gear^.State := Gear^.State or      gstCollision
   182     else Gear^.State := Gear^.State and not gstCollision
   190     else Gear^.State := Gear^.State and not gstCollision
   183 end;
   191 end;
   184 
   192 
  1583             ty := ty + Gear^.dY + Gear^.dY;
  1591             ty := ty + Gear^.dY + Gear^.dY;
  1584             tt := tt - _2;
  1592             tt := tt - _2;
  1585             end;
  1593             end;
  1586         end;
  1594         end;
  1587 
  1595 
  1588     if ((hwRound(Gear^.Y) and LAND_HEIGHT_MASK) = 0) and ((hwRound(Gear^.X) and LAND_WIDTH_MASK) = 0) and ((Land[hwRound(Gear^.Y), hwRound(Gear^.X)] and $FF00) <> 0) then
  1596     CheckCollisionWithLand(Gear);
  1589         Gear^.State:= Gear^.State or gstCollision
       
  1590     else Gear^.State:= Gear^.State and not gstCollision;
       
  1591 
  1597 
  1592     if (Gear^.State and gstCollision) <> 0 then
  1598     if (Gear^.State and gstCollision) <> 0 then
  1593         if Gear^.Elasticity < _10 then
  1599         if Gear^.Elasticity < _10 then
  1594             Gear^.Elasticity := _10000
  1600             Gear^.Elasticity := _10000
  1595     else
  1601     else