summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5f3074c)
raw | patch | inline | side by side (parent: 5f3074c)
author | Ketmar Dark <ketmar@ketmar.no-ip.org> | |
Fri, 18 Aug 2017 19:27:28 +0000 (22:27 +0300) | ||
committer | Ketmar Dark <ketmar@ketmar.no-ip.org> | |
Fri, 18 Aug 2017 19:32:56 +0000 (22:32 +0300) |
src/game/g_map.pas | patch | blob | history | |
src/game/z_aabbtree.pas | patch | blob | history |
diff --git a/src/game/g_map.pas b/src/game/g_map.pas
index b5e457cdc197ecdde00cc5731d2090aaa2968e96..e439d17db2b9643ea8451966dc98354690f15be7 100644 (file)
--- a/src/game/g_map.pas
+++ b/src/game/g_map.pas
@@ -2263,30 +2263,27 @@ function g_Map_CollidePanel(X, Y: Integer; Width, Height: Word; PanelType: Word;
begin
//TODO: detailed profile
if (profMapCollision <> nil) then profMapCollision.sectionBeginAccum('wall coldet');
- try
- if gdbg_map_use_accel_coldet then
+ if gdbg_map_use_accel_coldet then
+ begin
+ if gdbg_map_use_tree_coldet then
begin
- if gdbg_map_use_tree_coldet then
+ result := (mapTree.aabbQuery(X, Y, Width, Height, checker, (GridTagWallDoor or GridTagWater or GridTagAcid1 or GridTagAcid2 or GridTagStep or GridTagLift or GridTagBlockMon)) <> nil);
+ if (gdbg_map_dump_coldet_tree_queries) and (mapTree.nodesVisited <> 0) then
begin
- result := (mapTree.aabbQuery(X, Y, Width, Height, checker, (GridTagWallDoor or GridTagWater or GridTagAcid1 or GridTagAcid2 or GridTagStep or GridTagLift or GridTagBlockMon)) <> nil);
- if (gdbg_map_dump_coldet_tree_queries) and (mapTree.nodesVisited <> 0) then
- begin
- //e_WriteLog(Format('map collision: %d nodes visited (%d deep)', [mapTree.nodesVisited, mapTree.nodesDeepVisited]), MSG_NOTIFY);
- g_Console_Add(Format('map collision: %d nodes visited (%d deep)', [mapTree.nodesVisited, mapTree.nodesDeepVisited]));
- end;
- end
- else
- begin
- result := gMapGrid.forEachInAABB(X, Y, Width, Height, checker, (GridTagWallDoor or GridTagWater or GridTagAcid1 or GridTagAcid2 or GridTagStep or GridTagLift or GridTagBlockMon));
+ //e_WriteLog(Format('map collision: %d nodes visited (%d deep)', [mapTree.nodesVisited, mapTree.nodesDeepVisited]), MSG_NOTIFY);
+ g_Console_Add(Format('map collision: %d nodes visited (%d deep)', [mapTree.nodesVisited, mapTree.nodesDeepVisited]));
end;
end
else
begin
- result := g_Map_CollidePanelOld(X, Y, Width, Height, PanelType, b1x3);
+ result := gMapGrid.forEachInAABB(X, Y, Width, Height, checker, (GridTagWallDoor or GridTagWater or GridTagAcid1 or GridTagAcid2 or GridTagStep or GridTagLift or GridTagBlockMon));
end;
- finally
- if (profMapCollision <> nil) then profMapCollision.sectionEnd();
+ end
+ else
+ begin
+ result := g_Map_CollidePanelOld(X, Y, Width, Height, PanelType, b1x3);
end;
+ if (profMapCollision <> nil) then profMapCollision.sectionEnd();
end;
begin
//TODO: detailed profile?
if (profMapCollision <> nil) then profMapCollision.sectionBeginAccum('liquid coldet');
- try
- if gdbg_map_use_accel_coldet then
+ if gdbg_map_use_accel_coldet then
+ begin
+ texid := TEXTURE_NONE;
+ if gdbg_map_use_tree_coldet then
begin
- texid := TEXTURE_NONE;
- if gdbg_map_use_tree_coldet then
- begin
- mapTree.aabbQuery(X, Y, Width, Height, checker, (GridTagWater or GridTagAcid1 or GridTagAcid2));
- end
- else
- begin
- gMapGrid.forEachInAABB(X, Y, Width, Height, checker, (GridTagWater or GridTagAcid1 or GridTagAcid2));
- end;
- result := texid;
+ mapTree.aabbQuery(X, Y, Width, Height, checker, (GridTagWater or GridTagAcid1 or GridTagAcid2));
end
else
begin
- result := g_Map_CollideLiquid_TextureOld(X, Y, Width, Height);
+ gMapGrid.forEachInAABB(X, Y, Width, Height, checker, (GridTagWater or GridTagAcid1 or GridTagAcid2));
end;
- finally
- if (profMapCollision <> nil) then profMapCollision.sectionEnd();
+ result := texid;
+ end
+ else
+ begin
+ result := g_Map_CollideLiquid_TextureOld(X, Y, Width, Height);
end;
+ if (profMapCollision <> nil) then profMapCollision.sectionEnd();
end;
procedure g_Map_EnableWall(ID: DWORD);
index fcb8f6801d20ea037a5e906b40cc2dcc9cb28c07..5bdb2268fea812f1dc3ca8afc0f76e2335dddf33 100644 (file)
--- a/src/game/z_aabbtree.pas
+++ b/src/game/z_aabbtree.pas
begin
if not assigned(checker) then begin result := -1; exit; end;
//if not assigned(visitor) then begin result := -1; exit; end;
- try
+ //try
{$IFDEF aabbtree_query_count}
mNodesVisited := 0;
mNodesDeepVisited := 0;
{$IFDEF aabbtree_query_count}Inc(mNodesDeepVisited);{$ENDIF}
if ((node.tag and tagmask) <> 0) and assigned(visitor) then
begin
- if (visitor(node.flesh, node.tag)) then begin result := nodeId; exit; end;
+ if (visitor(node.flesh, node.tag)) then begin result := nodeId; bigstack := nil; exit; end;
end;
end
else
end;
result := -1; // oops
- finally
bigstack := nil;
- end;
+ //finally
+ // bigstack := nil;
+ //end;
end;