summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ae3691d)
raw | patch | inline | side by side (parent: ae3691d)
author | Ketmar Dark <ketmar@ketmar.no-ip.org> | |
Fri, 18 Aug 2017 17:56:43 +0000 (20:56 +0300) | ||
committer | Ketmar Dark <ketmar@ketmar.no-ip.org> | |
Fri, 18 Aug 2017 18:31:03 +0000 (21:31 +0300) |
src/game/g_console.pas | patch | blob | history | |
src/game/g_game.pas | patch | blob | history | |
src/game/g_map.pas | patch | blob | history | |
src/game/z_aabbtree.pas | patch | blob | history |
diff --git a/src/game/g_console.pas b/src/game/g_console.pas
index 909e7ed0ea87cd94719a57607a6dae990a04ff75..397d68f2b581acd335c2c6ccf3cb7b20f2e7be73 100644 (file)
--- a/src/game/g_console.pas
+++ b/src/game/g_console.pas
AddCommand('r_gridrender', ProfilerCommands);
AddCommand('dbg_coldet_grid', ProfilerCommands);
+ AddCommand('t_dump_node_queries', ProfilerCommands);
+
AddCommand('sq_use_grid', ProfilerCommands);
AddCommand('sq_use_tree', ProfilerCommands);
diff --git a/src/game/g_game.pas b/src/game/g_game.pas
index 27be5565fddf4ec4b0bd7b49729757dba8c46b1b..2d3fb588db863d074a7e3ae0f7c16c3ae954100e 100644 (file)
--- a/src/game/g_game.pas
+++ b/src/game/g_game.pas
if gdbg_map_use_tree_coldet then g_Console_Add('coldet: tree') else g_Console_Add('coldet: grid');
exit;
end;
+
+ if (cmd = 't_dump_node_queries') then
+ begin
+ case getBool(1) of
+ -1: begin end;
+ 0: gdbg_map_dump_coldet_tree_queries := false;
+ 1: gdbg_map_dump_coldet_tree_queries := true;
+ end;
+ if gdbg_map_dump_coldet_tree_queries then g_Console_Add('grid coldet tree queries: tan') else g_Console_Add('grid coldet tree queries: ona');
+ exit;
+ end;
end;
procedure DebugCommands(P: SArray);
diff --git a/src/game/g_map.pas b/src/game/g_map.pas
index 3a97ef4586b2b6572e1a68dff275d0d00f34114d..1a7a4d8f18eb54d2add20148f04a97b20c4ec890 100644 (file)
--- a/src/game/g_map.pas
+++ b/src/game/g_map.pas
gdbg_map_use_grid_coldet: Boolean = true;
gdbg_map_use_tree_draw: Boolean = true;
gdbg_map_use_tree_coldet: Boolean = false;
+ gdbg_map_dump_coldet_tree_queries: Boolean = false;
profMapCollision: TProfiler = nil; //WARNING: FOR DEBUGGING ONLY!
implementation
if gdbg_map_use_tree_coldet 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 (mapTree.nodesVisited <> 0) then
+ 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);
+ //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
index a168a6028e2e319be6d7c1c766dcd9283a5142a7..5ebc8851c5a087810ba212172b6c5cfbe9e44afb 100644 (file)
--- a/src/game/z_aabbtree.pas
+++ b/src/game/z_aabbtree.pas
*)
{$INCLUDE ../shared/a_modes.inc}
{.$DEFINE aabbtree_many_asserts}
-{.$DEFINE aabbtree_query_count}
+{$DEFINE aabbtree_query_count}
{.$DEFINE aabbtree_use_floats}
unit z_aabbtree;