314 (Land[ty, tx] = 0) do // TODO: check for constant variable instead |
314 (Land[ty, tx] = 0) do // TODO: check for constant variable instead |
315 begin |
315 begin |
316 lx:= lx + ax; |
316 lx:= lx + ax; |
317 ly:= ly + ay; |
317 ly:= ly + ay; |
318 tx:= round(lx); |
318 tx:= round(lx); |
319 ty:= round(ly) |
319 ty:= round(ly); |
|
320 if (abs(tx-hx) > 1000) or (abs(hy-ty) > 1000) then |
|
321 begin |
|
322 DrawLine(hx, hy, tx, ty, 1.0, $FF, $00, $00, $C0); |
|
323 hx:= tx; |
|
324 hy:= ty |
|
325 end |
320 end; |
326 end; |
321 // reached edge of land. assume infinite beam. Extend it way out past camera |
327 // reached edge of land. assume infinite beam. Extend it way out past camera |
322 if ((ty and LAND_HEIGHT_MASK) <> 0) or ((tx and LAND_WIDTH_MASK) <> 0) then |
328 if ((ty and LAND_HEIGHT_MASK) <> 0) or ((tx and LAND_WIDTH_MASK) <> 0) then |
323 begin |
329 begin |
324 tx:= round(lx + ax * (max(LAND_WIDTH,4096) div 2)); |
330 tx:= round(lx + ax * (max(LAND_WIDTH,4096) div 2)); |
325 ty:= round(ly + ay * (max(LAND_WIDTH,4096) div 2)); |
331 ty:= round(ly + ay * (max(LAND_WIDTH,4096) div 2)); |
326 end; |
332 end; |
327 |
333 |
328 //if (abs(lx-tx)>8) or (abs(ly-ty)>8) then |
334 //if (abs(lx-tx)>8) or (abs(ly-ty)>8) then |
|
335 if (tx <> hx) or (ty <> hy) then |
329 begin |
336 begin |
330 DrawLine(hx, hy, tx, ty, 1.0, $FF, $00, $00, $C0); |
337 DrawLine(hx, hy, tx, ty, 1.0, $FF, $00, $00, $C0); |
331 end; |
338 end; |
332 end; |
339 end; |
333 // draw crosshair |
340 // draw crosshair |