X-Git-Url: http://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fgame%2Fg_grid.pas;h=d7263f36e0c244dedd9a8424e113e41e397e1981;hb=1a0deddcb78946c8f7eba838d00fec5d6192501f;hp=17ad2fceed471807171d121fac437b57837e099c;hpb=17c43bf44dcda54fa7d87e278357c803eb3eea2f;p=d2df-sdl.git diff --git a/src/game/g_grid.pas b/src/game/g_grid.pas index 17ad2fc..d7263f3 100644 --- a/src/game/g_grid.pas +++ b/src/game/g_grid.pas @@ -20,7 +20,7 @@ {.$DEFINE D2F_DEBUG_XXQ} {.$DEFINE D2F_DEBUG_MOVER} {$ENDIF} -{$DEFINE GRID_USE_ORTHO_ACCEL} +{.$DEFINE GRID_USE_ORTHO_ACCEL} unit g_grid; interface @@ -199,6 +199,8 @@ type // return `false` if we're still inside at the end // line should be either strict horizontal, or strict vertical, otherwise an exception will be thrown + // `true`: endpoint will point at the last "inside" pixel + // `false`: endpoint will be (ax1, ay1) function traceOrthoRayWhileIn (out ex, ey: Integer; ax0, ay0, ax1, ay1: Integer; tagmask: Integer=-1): Boolean; //WARNING: don't modify grid while any query is in progress (no checks are made!) @@ -2559,7 +2561,7 @@ begin else begin // down - while (y0 <= celly1) and (filled[y1-celly0] <> 0) do begin Inc(y0); Inc(ay0); end; + while (y0 <= celly1) and (filled[y0-celly0] <> 0) do begin Inc(y0); Inc(ay0); end; if (ay0 >= ay1) then begin ey := ay1; result := false; exit; end; if (y0 <= celly1) then begin ey := ay0-1; result := true; exit; end; end;