X-Git-Url: https://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fgame%2Fg_map.pas;h=b97cc00a24f2a3ed8a6a06dc51b9b10e54b850fd;hb=1ac9fc74d98d56a450774702aae19fa1546f2849;hp=3a97ef4586b2b6572e1a68dff275d0d00f34114d;hpb=46bfd9c48fe4cb640e507ceb88116eb2396579fa;p=d2df-sdl.git diff --git a/src/game/g_map.pas b/src/game/g_map.pas index 3a97ef4..b97cc00 100644 --- a/src/game/g_map.pas +++ b/src/game/g_map.pas @@ -136,8 +136,9 @@ var gdbg_map_use_grid_render: Boolean = true; gdbg_map_use_grid_coldet: Boolean = true; - gdbg_map_use_tree_draw: Boolean = true; + gdbg_map_use_tree_draw: Boolean = false; gdbg_map_use_tree_coldet: Boolean = false; + gdbg_map_dump_coldet_tree_queries: Boolean = false; profMapCollision: TProfiler = nil; //WARNING: FOR DEBUGGING ONLY! implementation @@ -200,9 +201,14 @@ function TDynAABBTreeMap.getFleshAABB (var aabb: AABB2D; flesh: TTreeFlesh): Boo var pan: TPanel; begin - if (flesh = nil) then begin result := false; exit; end; + result := false; + if (flesh = nil) then exit; pan := (flesh as TPanel); + if (pan.Width < 1) or (pan.Height < 1) then exit; aabb := AABB2D.Create(pan.X, pan.Y, pan.X+pan.Width, pan.Y+pan.Height); + //if (pan.Width = 1) then aabb.maxX += 1; + //if (pan.Height = 1) then aabb.maxY += 1; + if not aabb.valid then raise Exception.Create('wutafuuuuuuu?!'); //e_WriteLog(Format('getFleshAABB(%d;%d) AABB:(%f,%f)-(%f,%f); valid=%d; volume=%f; x=%d; y=%d; w=%d; h=%d', [pan.tag, pan.ArrIdx, aabb.minX, aabb.minY, aabb.maxX, aabb.maxY, Integer(aabb.valid), aabb.volume, pan.X, pan.Y, pan.Width, pan.Height]), MSG_NOTIFY); result := aabb.valid; end; @@ -2264,12 +2270,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