hedgewars/uCollisions.pas
changeset 62 c3eda0c68cd6
parent 57 e1a77ae57065
child 64 9df467527ae5
equal deleted inserted replaced
61:505691a09dee 62:c3eda0c68cd6
    75 with cinfos[Count] do
    75 with cinfos[Count] do
    76      begin
    76      begin
    77      X:= round(Gear.X);
    77      X:= round(Gear.X);
    78      Y:= round(Gear.Y);
    78      Y:= round(Gear.Y);
    79      Radius:= Gear.Radius;
    79      Radius:= Gear.Radius;
    80      FillRoundInLand(X, Y, Radius, $FF);
    80      FillRoundInLand(X, Y, Radius-1, $FF);
    81      cGear:= Gear
    81      cGear:= Gear
    82      end;
    82      end;
    83 Gear.CollIndex:= Count;
    83 Gear.CollIndex:= Count;
    84 inc(Count)
    84 inc(Count)
    85 end;
    85 end;
    86 
    86 
    87 procedure DeleteCI(Gear: PGear);
    87 procedure DeleteCI(Gear: PGear);
    88 begin
    88 begin
    89 if Gear.CollIndex < Count then
    89 if Gear.CollIndex < Count then
    90    begin
    90    begin
    91    with cinfos[Gear.CollIndex] do FillRoundInLand(X, Y, Radius, 0);
    91    with cinfos[Gear.CollIndex] do FillRoundInLand(X, Y, Radius-1, 0);
    92    cinfos[Gear.CollIndex]:= cinfos[Pred(Count)];
    92    cinfos[Gear.CollIndex]:= cinfos[Pred(Count)];
    93    cinfos[Gear.CollIndex].cGear.CollIndex:= Gear.CollIndex;
    93    cinfos[Gear.CollIndex].cGear.CollIndex:= Gear.CollIndex;
    94    Gear.CollIndex:= High(Longword);
    94    Gear.CollIndex:= High(Longword);
    95    dec(Count)
    95    dec(Count)
    96    end;
    96    end;