change maxSize of quad tree's leaf nodes (from a max length of 3 to a max length of 9)

This commit is contained in:
2025-01-31 06:01:02 +00:00
parent e23e2f0997
commit 76c5f9d662
2 changed files with 11 additions and 2 deletions

View File

@@ -262,6 +262,15 @@ struct
, nextPlatID = ~1 , nextPlatID = ~1
} }
val enemies = Vector.fromList [enemy1, enemy2, enemy3, enemy4, enemy5] val enemies = Vector.fromList [enemy1, enemy2, enemy3, enemy4, enemy5]
val startTime = Time.now ()
val startTime = Time.toMicroseconds startTime
val graph = Graph.fromPlatforms (platforms, platformTree)
val finishTime = Time.now ()
val finishTime = Time.toMicroseconds finishTime
val diff = finishTime - startTime
val _ = print ("TIME DIFF = " ^ LargeInt.toString diff ^ "\n")
in in
{ player = player { player = player
, walls = walls , walls = walls
@@ -269,7 +278,7 @@ struct
, platforms = platforms , platforms = platforms
, platformTree = platformTree , platformTree = platformTree
, enemies = enemies , enemies = enemies
, graph = Graph.fromPlatforms (platforms, platformTree) , graph = graph
} }
end end
end end

View File

@@ -35,7 +35,7 @@ struct
type t = QuadTreeType.t type t = QuadTreeType.t
(* max size of vector before we split it further *) (* max size of vector before we split it further *)
val maxSize = 3 val maxSize = 9
fun mkTopLeft (x, y, w, h, items) = fun mkTopLeft (x, y, w, h, items) =
let let