hedgewars/uCollisions.pas
changeset 9291 15f7bb217b66
parent 9247 68bbe56badcc
child 9305 8e5140875ab5
equal deleted inserted replaced
9289:6bc1df062f04 9291:15f7bb217b66
    31         end;
    31         end;
    32 
    32 
    33 procedure initModule;
    33 procedure initModule;
    34 procedure freeModule;
    34 procedure freeModule;
    35 
    35 
    36 procedure AddGearCI(Gear: PGear);
    36 procedure AddCI(Gear: PGear);
    37 procedure DeleteCI(Gear: PGear);
    37 procedure DeleteCI(Gear: PGear);
    38 
    38 
    39 function  CheckGearsCollision(Gear: PGear): PGearArray;
    39 function  CheckGearsCollision(Gear: PGear): PGearArray;
    40 
    40 
    41 function  TestCollisionXwithGear(Gear: PGear; Dir: LongInt): boolean;
    41 function  TestCollisionXwithGear(Gear: PGear; Dir: LongInt): boolean;
    70 const MAXRECTSINDEX = 1023;
    70 const MAXRECTSINDEX = 1023;
    71 var Count: Longword;
    71 var Count: Longword;
    72     cinfos: array[0..MAXRECTSINDEX] of TCollisionEntry;
    72     cinfos: array[0..MAXRECTSINDEX] of TCollisionEntry;
    73     ga: TGearArray;
    73     ga: TGearArray;
    74 
    74 
    75 procedure AddGearCI(Gear: PGear);
    75 procedure AddCI(Gear: PGear);
    76 var t: PGear;
    76 var t: PGear;
    77 begin
    77 begin
    78 if Gear^.CollisionIndex >= 0 then
    78 if Gear^.CollisionIndex >= 0 then
    79     exit;
    79     exit;
    80 TryDo(Count <= MAXRECTSINDEX, 'Collision rects array overflow', true);
    80 TryDo(Count <= MAXRECTSINDEX, 'Collision rects array overflow', true);