summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 462c539)
raw | patch | inline | side by side (parent: 462c539)
author | Ketmar Dark <ketmar@ketmar.no-ip.org> | |
Thu, 18 Jan 2018 12:53:37 +0000 (14:53 +0200) | ||
committer | Ketmar Dark <ketmar@ketmar.no-ip.org> | |
Thu, 18 Jan 2018 12:53:55 +0000 (14:53 +0200) |
src/game/g_grid.pas | patch | blob | history | |
src/game/g_holmes.pas | patch | blob | history | |
src/game/g_panel.pas | patch | blob | history |
diff --git a/src/game/g_grid.pas b/src/game/g_grid.pas
index 87ff77ec360cd5dd32a184ff0409dc853e89fe29..c2d4412ecc73551caad69b4d308dbb5638aaf3b7 100644 (file)
--- a/src/game/g_grid.pas
+++ b/src/game/g_grid.pas
// 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);
// ////////////////////////////////////////////////////////////////////////// //
// 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;
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 142e2be2a4f1933ef463ead57b5256bae6574503..c4eba8b2ee4e718b58e16d8d78ab13c719ca11ee 100644 (file)
--- a/src/game/g_holmes.pas
+++ b/src/game/g_holmes.pas
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 abd27c93f72b23dbaad383e7f0b8b3dbde0aa44c..e88db6b18c7f715304e23662957e504e8984af35 100644 (file)
--- a/src/game/g_panel.pas
+++ b/src/game/g_panel.pas
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
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;
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;