hedgewars/uGearsRender.pas
changeset 13776 720dc03600c9
parent 13634 73c2a669c1fd
child 13837 6e4e745f42bb
equal deleted inserted replaced
13775:8a7699ccb608 13776:720dc03600c9
   299 var i, t: LongInt;
   299 var i, t: LongInt;
   300     amt: TAmmoType;
   300     amt: TAmmoType;
   301     sign, hx, hy, tx, ty, sx, sy, m: LongInt;  // hedgehog, crosshair, temp, sprite, direction
   301     sign, hx, hy, tx, ty, sx, sy, m: LongInt;  // hedgehog, crosshair, temp, sprite, direction
   302     dx, dy, ax, ay, aAngle, dAngle, hAngle, lx, ly: real;  // laser, change
   302     dx, dy, ax, ay, aAngle, dAngle, hAngle, lx, ly: real;  // laser, change
   303     wraps: LongWord; // numbe of wraps for laser in world wrap
   303     wraps: LongWord; // numbe of wraps for laser in world wrap
   304     defaultPos, HatVisible: boolean;
   304     defaultPos, HatVisible, inWorldBounds: boolean;
   305     HH: PHedgehog;
   305     HH: PHedgehog;
   306     CurWeapon: PAmmo;
   306     CurWeapon: PAmmo;
   307     iceOffset:Longint;
   307     iceOffset:Longint;
   308     r:TSDL_Rect;
   308     r:TSDL_Rect;
   309     curhat: PTexture;
   309     curhat: PTexture;
   442                 tx:= round(lx);
   442                 tx:= round(lx);
   443                 ty:= round(ly);
   443                 ty:= round(ly);
   444                 hx:= tx;
   444                 hx:= tx;
   445                 hy:= ty;
   445                 hy:= ty;
   446                 wraps:= 0;
   446                 wraps:= 0;
   447                 while ((Land[ty, tx] and lfAll) = 0) do
   447                 inWorldBounds := ((ty and LAND_HEIGHT_MASK) or (tx and LAND_WIDTH_MASK)) = 0;
       
   448                 while inWorldBounds and ((Land[ty, tx] and lfAll) = 0) do
   448                     begin
   449                     begin
   449                     if wraps > cMaxLaserSightWraps then
   450                     if wraps > cMaxLaserSightWraps then
   450                         break;
   451                         break;
   451                     lx:= lx + ax;
   452                     lx:= lx + ax;
   452                     ly:= ly + ay;
   453                     ly:= ly + ay;