From 02014eee2eeed9f9b8dfa8b69c2fead669b59a6d Mon Sep 17 00:00:00 2001 From: Ketmar Dark Date: Fri, 18 Aug 2017 20:56:43 +0300 Subject: [PATCH] "t_dump_node_queries" (temp debug, DO NOT TOUCH) --- src/game/g_console.pas | 2 ++ src/game/g_game.pas | 11 +++++++++++ src/game/g_map.pas | 8 ++++---- src/game/z_aabbtree.pas | 2 +- 4 files changed, 18 insertions(+), 5 deletions(-) diff --git a/src/game/g_console.pas b/src/game/g_console.pas index 909e7ed..397d68f 100644 --- a/src/game/g_console.pas +++ b/src/game/g_console.pas @@ -394,6 +394,8 @@ begin 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 27be556..2d3fb58 100644 --- a/src/game/g_game.pas +++ b/src/game/g_game.pas @@ -5064,6 +5064,17 @@ begin 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 3a97ef4..1a7a4d8 100644 --- a/src/game/g_map.pas +++ b/src/game/g_map.pas @@ -138,6 +138,7 @@ var 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 @@ -2264,12 +2265,11 @@ begin 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 diff --git a/src/game/z_aabbtree.pas b/src/game/z_aabbtree.pas index a168a60..5ebc885 100644 --- a/src/game/z_aabbtree.pas +++ b/src/game/z_aabbtree.pas @@ -15,7 +15,7 @@ *) {$INCLUDE ../shared/a_modes.inc} {.$DEFINE aabbtree_many_asserts} -{.$DEFINE aabbtree_query_count} +{$DEFINE aabbtree_query_count} {.$DEFINE aabbtree_use_floats} unit z_aabbtree; -- 2.29.2