47 function TestCollisionY(Gear: PGear; Dir: LongInt): boolean; |
47 function TestCollisionY(Gear: PGear; Dir: LongInt): boolean; |
48 |
48 |
49 function TestCollisionXwithXYShift(Gear: PGear; ShiftX: hwFloat; ShiftY: LongInt; Dir: LongInt): boolean; |
49 function TestCollisionXwithXYShift(Gear: PGear; ShiftX: hwFloat; ShiftY: LongInt; Dir: LongInt): boolean; |
50 function TestCollisionYwithXYShift(Gear: PGear; ShiftX, ShiftY: LongInt; Dir: LongInt): boolean; |
50 function TestCollisionYwithXYShift(Gear: PGear; ShiftX, ShiftY: LongInt; Dir: LongInt): boolean; |
51 |
51 |
52 function calcSlopeTangent(Gear: PGear; collisionX, collisionY: LongInt; var deltaX, deltaY: LongInt; TestWord: LongWord): Boolean; |
52 function calcSlopeTangent(Gear: PGear; collisionX, collisionY: LongInt; var outDeltaX, outDeltaY: LongInt; TestWord: LongWord): Boolean; |
53 |
53 |
54 implementation |
54 implementation |
55 uses uMisc, uConsts, uLand, uLandGraphics; |
55 uses uMisc, uConsts, uLand, uLandGraphics; |
56 |
56 |
57 type TCollisionEntry = record |
57 type TCollisionEntry = record |
313 Gear^.X:= Gear^.X - int2hwFloat(ShiftX); |
313 Gear^.X:= Gear^.X - int2hwFloat(ShiftX); |
314 Gear^.Y:= Gear^.Y - int2hwFloat(ShiftY) |
314 Gear^.Y:= Gear^.Y - int2hwFloat(ShiftY) |
315 end; |
315 end; |
316 |
316 |
317 |
317 |
318 function calcSlopeTangent(Gear: PGear; collisionX, collisionY: LongInt; var deltaX, deltaY: LongInt; TestWord: LongWord): boolean; |
318 function calcSlopeTangent(Gear: PGear; collisionX, collisionY: LongInt; var outDeltaX, outDeltaY: LongInt; TestWord: LongWord): boolean; |
319 var ldx, ldy, rdx, rdy: LongInt; |
319 var ldx, ldy, rdx, rdy: LongInt; |
320 i, j, mx, my, li, ri, jfr, jto, tmpo : ShortInt; |
320 i, j, mx, my, li, ri, jfr, jto, tmpo : ShortInt; |
321 tmpx, tmpy: LongWord; |
321 tmpx, tmpy: LongWord; |
322 dx, dy: hwFloat; |
322 dx, dy: hwFloat; |
323 offset: Array[0..7,0..1] of ShortInt; |
323 offset: Array[0..7,0..1] of ShortInt; |