summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--chickadee/math/grid.scm7
1 files changed, 3 insertions, 4 deletions
diff --git a/chickadee/math/grid.scm b/chickadee/math/grid.scm
index 58232fc..9982f90 100644
--- a/chickadee/math/grid.scm
+++ b/chickadee/math/grid.scm
@@ -114,7 +114,7 @@ needed to make the rectangles no longer overlap."
(define* (make-grid #:optional (cell-size 64.0))
"Create new grid partitioned by CELL-SIZE."
(%make-grid (f32vector cell-size)
- (make-hash-table)
+ (make-hash-table 1000)
(make-hash-table)
(make-rect 0.0 0.0 0.0 0.0)
(make-array-list)
@@ -238,7 +238,7 @@ POSITION may be modified to resolve the colliding objects."
(collisions (grid-buffer grid))
(visited (grid-visited grid)))
(define (to-cell n)
- (inexact->exact (floor (/ n cell-size))))
+ (inexact->exact* (floor (/ n cell-size))))
(define (collision? rect1 rect2 goal)
(let ((goal-x (vec2-x goal))
(goal-y (vec2-y goal)))
@@ -321,8 +321,7 @@ POSITION may be modified to resolve the colliding objects."
(when (<= cx maxx)
(let ((cell (row-column-ref row cx)))
(hash-for-each (lambda (other unused)
- (check other (grid-rect-ref grid other))
- #f)
+ (check other (grid-rect-ref grid other)))
(cell-items cell)))
(xloop (+ cx 1)))))
(yloop (+ cy 1))))