DEADSOFTWARE

"t_dump_node_queries" (temp debug, DO NOT TOUCH)
authorKetmar Dark <ketmar@ketmar.no-ip.org>
Fri, 18 Aug 2017 17:56:43 +0000 (20:56 +0300)
committerKetmar Dark <ketmar@ketmar.no-ip.org>
Fri, 18 Aug 2017 18:31:03 +0000 (21:31 +0300)
src/game/g_console.pas
src/game/g_game.pas
src/game/g_map.pas
src/game/z_aabbtree.pas

index 909e7ed0ea87cd94719a57607a6dae990a04ff75..397d68f2b581acd335c2c6ccf3cb7b20f2e7be73 100644 (file)
@@ -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);
 
index 27be5565fddf4ec4b0bd7b49729757dba8c46b1b..2d3fb588db863d074a7e3ae0f7c16c3ae954100e 100644 (file)
@@ -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);
index 3a97ef4586b2b6572e1a68dff275d0d00f34114d..1a7a4d8f18eb54d2add20148f04a97b20c4ec890 100644 (file)
@@ -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
index a168a6028e2e319be6d7c1c766dcd9283a5142a7..5ebc8851c5a087810ba212172b6c5cfbe9e44afb 100644 (file)
@@ -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;