diff options
| author | iamcheeseman <[hidden email]> | 2026-02-28 20:57:58 -0500 |
|---|---|---|
| committer | iamcheeseman <[hidden email]> | 2026-02-28 20:57:58 -0500 |
| commit | ae870b9e6bf9faaf45a1470e64dacaa20084d3fa (patch) | |
| tree | a3fa1ef776650db7ad2ea7aa30ad06de90c55c6a /src/main.odin | |
| parent | 97e7909e4d730524b3ea319fa86520ed3bb3df5c (diff) | |
Use odin's new handle maps in physics too
Diffstat (limited to 'src/main.odin')
| -rw-r--r-- | src/main.odin | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/main.odin b/src/main.odin index e04b477..e1b13d5 100644 --- a/src/main.odin +++ b/src/main.odin @@ -11,6 +11,7 @@ import "phys" import "fw" Handle :: hm.Handle32 + Vec2 :: fw.Vec2 Vec2i :: fw.Vec2i Color :: fw.Color @@ -130,7 +131,8 @@ frame :: proc() { // Draw all collisions body_it: int color := Color{1, 0.25, 0.5, 0.25} - for body in phys.iterate_bodies(&body_it) { + body_iter := hm.iterator_make(&phys.world.bodies) + for _, body in hm.iterate(&body_iter) { rect := phys.get_rect(body) rect.start += phys.get_position(body) fw.draw_rect(rect.start, rect.size, color = color, lines = true) |
