From: Ketmar Dark Date: Thu, 18 Jan 2018 12:53:37 +0000 (+0200) Subject: no more callback in `Grid.traceBox()` (it wasn't used anyway) X-Git-Url: http://deadsoftware.ru/gitweb?a=commitdiff_plain;h=f25b549325cfbd9a89e323d1fb9ece51aee1f347;p=d2df-sdl.git no more callback in `Grid.traceBox()` (it wasn't used anyway) --- diff --git a/src/game/g_grid.pas b/src/game/g_grid.pas index 87ff77e..c2d4412 100644 --- a/src/game/g_grid.pas +++ b/src/game/g_grid.pas @@ -242,7 +242,7 @@ type // trace box with the given velocity; return object hit (if any) // `cb` is used unconvetionally here: if it returns `false`, tracer will ignore the object //WARNING: don't change tags in callbacks here! - function traceBox (out ex, ey: Integer; const ax0, ay0, aw, ah: Integer; const dx, dy: Integer; cb: TGridQueryCB; tagmask: Integer=-1): ITP; + function traceBox (out ex, ey: Integer; const ax0, ay0, aw, ah: Integer; const dx, dy: Integer; tagmask: Integer=-1): ITP; // debug procedure forEachBodyCell (body: TBodyProxyId; cb: TCellQueryCB); @@ -1621,7 +1621,7 @@ end; // ////////////////////////////////////////////////////////////////////////// // // trace box with the given velocity; return object hit (if any) // `cb` is used unconvetionally here: if it returns `false`, tracer will ignore the object -function TBodyGridBase.traceBox (out ex, ey: Integer; const ax0, ay0, aw, ah: Integer; const dx, dy: Integer; cb: TGridQueryCB; tagmask: Integer=-1): ITP; +function TBodyGridBase.traceBox (out ex, ey: Integer; const ax0, ay0, aw, ah: Integer; const dx, dy: Integer; tagmask: Integer=-1): ITP; var gx, gy: Integer; ccidx: Integer; @@ -1685,10 +1685,6 @@ begin if ((ptag and TagDisabled) = 0) and ((ptag and tagmask) <> 0) and (px.mQueryMark <> lq) then begin px.mQueryMark := lq; // mark as processed - if assigned(cb) then - begin - if not cb(px.mObj, ptag) then continue; - end; if not sweepAABB(ax0, ay0, aw, ah, dx, dy, px.mX, px.mY, px.mWidth, px.mHeight, @u0) then continue; if (minu0 > u0) then begin diff --git a/src/game/g_holmes.pas b/src/game/g_holmes.pas index 142e2be..c4eba8b 100644 --- a/src/game/g_holmes.pas +++ b/src/game/g_holmes.pas @@ -951,7 +951,7 @@ procedure plrDebugDraw (); pdy := pmsCurMapY-(py+ph div 2); hlmContext.color := TGxRGBA.Create(255, 0, 255, 200); hlmContext.line(px+pw div 2, py+ph div 2, px+pw div 2+pdx, py+ph div 2+pdy); - pan := mapGrid.traceBox(ex, ey, px, py, pw, ph, pdx, pdy, nil, GridTagObstacle); + pan := mapGrid.traceBox(ex, ey, px, py, pw, ph, pdx, pdy, GridTagObstacle); if (pan = nil) then begin hlmContext.color := TGxRGBA.Create(255, 255, 255, 180); diff --git a/src/game/g_panel.pas b/src/game/g_panel.pas index abd27c9..e88db6b 100644 --- a/src/game/g_panel.pas +++ b/src/game/g_panel.pas @@ -586,7 +586,7 @@ var begin if (ontop <> nil) then ontop^ := true; // yes, move with it; but skip steps (no need to process size change here, 'cause platform top cannot be changed with it) - mapGrid.traceBox(tex, tey, px, py, pw, ph, pdx, pdy, nil, (GridTagWall or GridTagDoor)); + mapGrid.traceBox(tex, tey, px, py, pw, ph, pdx, pdy, (GridTagWall or GridTagDoor)); end else begin @@ -614,7 +614,7 @@ var trtag := (GridTagWall or GridTagDoor); // if we're moving down, consider steps too if (szdy > 0) then trtag := trtag or GridTagStep; - mapGrid.traceBox(tex, tey, px, py, pw, ph, szdx, szdy, nil, trtag); + mapGrid.traceBox(tex, tey, px, py, pw, ph, szdx, szdy, trtag); end; end; end; @@ -633,7 +633,7 @@ var trtag := (GridTagWall or GridTagDoor); // if we're moving down, consider steps too if (pdy > 0) then trtag := trtag or GridTagStep; - mapGrid.traceBox(tex, tey, px, py, pw, ph, pdx, pdy, nil, trtag); + mapGrid.traceBox(tex, tey, px, py, pw, ph, pdx, pdy, trtag); end; end; end;