DEADSOFTWARE

adaptive profiler history length (not really)
[d2df-sdl.git] / src / game / g_map.pas
index b84bf3aaca6170f165147659879aa9e2971c8f28..29750c92009aeb5a36a4bb13fd2601bf22c521ff 100644 (file)
@@ -200,14 +200,14 @@ var
 
 procedure g_Map_ProfilersBegin ();
 begin
-  if (profMapCollision = nil) then profMapCollision := TProfiler.Create('MAP COLLISION');
+  if (profMapCollision = nil) then profMapCollision := TProfiler.Create('MAP COLLISION', g_profile_history_size);
   profMapCollision.mainBegin(g_profile_collision);
   // create sections
   if g_profile_collision then
   begin
-    profMapCollision.sectionBeginAccum('wall coldet');
+    profMapCollision.sectionBegin('wall coldet');
     profMapCollision.sectionEnd();
-    profMapCollision.sectionBeginAccum('liquid coldet');
+    profMapCollision.sectionBegin('liquid coldet');
     profMapCollision.sectionEnd();
   end;
 end;
@@ -2280,15 +2280,15 @@ begin
   //TODO: detailed profile?
   if (profMapCollision <> nil) then profMapCollision.sectionBeginAccum('liquid coldet');
   try
-    if not gdbg_map_use_grid_coldet then
-    begin
-      result := g_Map_CollideLiquid_TextureOld(X, Y, Width, Height);
-    end
-    else
+    if gdbg_map_use_grid_coldet then
     begin
       texid := TEXTURE_NONE;
       gMapGrid.forEachInAABB(X, Y, Width, Height, checker);
       result := texid;
+    end
+    else
+    begin
+      result := g_Map_CollideLiquid_TextureOld(X, Y, Width, Height);
     end;
   finally
     if (profMapCollision <> nil) then profMapCollision.sectionEnd();