hedgewars/uGearsHandlers.pas
changeset 7398 2b7b939014b5
parent 7370 d50b874e7ee8
child 7402 d5a710b3a2d7
equal deleted inserted replaced
7397:833fc211ca2d 7398:2b7b939014b5
    27 
    27 
    28 implementation
    28 implementation
    29 
    29 
    30 uses SDLh, uFloat, uCollisions;
    30 uses SDLh, uFloat, uCollisions;
    31 
    31 
       
    32 
       
    33 
    32 const dirs: array[0..3] of TPoint =   ((X: 0; Y: -1), (X: 1; Y: 0),(X: 0; Y: 1),(X: -1; Y: 0));
    34 const dirs: array[0..3] of TPoint =   ((X: 0; Y: -1), (X: 1; Y: 0),(X: 0; Y: 1),(X: -1; Y: 0));
    33 
    35 
    34 procedure PrevAngle(Gear: PGear; dA: LongInt); inline;
    36 procedure PrevAngle(Gear: PGear; dA: LongInt); inline;
    35 begin
    37 begin
    36     Gear^.Angle := (LongInt(Gear^.Angle) + 4 - dA) mod 4
    38     Gear^.Angle := (LongInt(Gear^.Angle) + 4 - dA) mod 4
    37 end;
    39 end;
    38 
    40 
    39 procedure NextAngle(Gear: PGear; dA: LongInt); inline;
    41 procedure NextAngle(Gear: PGear; dA: LongInt); inline;
    40 begin
    42 begin
    41     Gear^.Angle := (LongInt(Gear^.Angle) + 4 + dA) mod 4
    43     Gear^.Angle := (LongInt(Gear^.Angle)     + dA) mod 4
    42 end;
    44 end;
    43 
    45 
    44 procedure cakeStep(Gear: PGear);
    46 procedure cakeStep(Gear: PGear);
    45 var
    47 var
    46     xx, yy, xxn, yyn: LongInt;
    48     xx, yy, xxn, yyn: LongInt;