hedgewars/uGearsRender.pas
changeset 8854 31133afaa025
parent 8733 b6002f1956d5
child 9041 aefe46d64dd9
equal deleted inserted replaced
8851:e9a97845e4f2 8854:31133afaa025
   350                     (Land[ty, tx] = 0) do // TODO: check for constant variable instead
   350                     (Land[ty, tx] = 0) do // TODO: check for constant variable instead
   351                     begin
   351                     begin
   352                     lx:= lx + ax;
   352                     lx:= lx + ax;
   353                     ly:= ly + ay;
   353                     ly:= ly + ay;
   354                     tx:= round(lx);
   354                     tx:= round(lx);
   355                     ty:= round(ly);
   355                     ty:= round(ly)
   356                     if (abs(tx-hx) > 1000) or (abs(hy-ty) > 1000) then
       
   357                         begin
       
   358                         DrawLine(hx, hy, tx, ty, 1.0, $FF, $00, $00, $C0);
       
   359                         hx:= tx;
       
   360                         hy:= ty
       
   361                         end
       
   362                     end;
   356                     end;
   363                 // reached edge of land. assume infinite beam. Extend it way out past camera
   357                 // reached edge of land. assume infinite beam. Extend it way out past camera
   364                 if ((ty and LAND_HEIGHT_MASK) <> 0) or ((tx and LAND_WIDTH_MASK) <> 0) then
   358                 if ((ty and LAND_HEIGHT_MASK) <> 0) or ((tx and LAND_WIDTH_MASK) <> 0) then
   365                     begin
   359                     begin
   366                     tx:= round(lx + ax * (max(LAND_WIDTH,4096) div 2));
   360                     tx:= round(lx + ax * (max(LAND_WIDTH,4096) div 2));
   367                     ty:= round(ly + ay * (max(LAND_WIDTH,4096) div 2));
   361                     ty:= round(ly + ay * (max(LAND_WIDTH,4096) div 2));
   368                     end;
   362                     end;
   369 
   363 
   370                 //if (abs(lx-tx)>8) or (abs(ly-ty)>8) then
   364                 //if (abs(lx-tx)>8) or (abs(ly-ty)>8) then
   371                 if (tx <> hx) or (ty <> hy) then
       
   372                     begin
   365                     begin
   373                     DrawLine(hx, hy, tx, ty, 1.0, $FF, $00, $00, $C0);
   366                     DrawLine(hx, hy, tx, ty, 1.0, $FF, $00, $00, $C0);
   374                     end;
   367                     end;
   375                 end;
   368                 end;
   376             // draw crosshair
   369             // draw crosshair