aboutsummaryrefslogtreecommitdiff
path: root/src/main.odin
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.odin')
-rw-r--r--src/main.odin22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/main.odin b/src/main.odin
index 9bc047e..e04b477 100644
--- a/src/main.odin
+++ b/src/main.odin
@@ -5,10 +5,12 @@ import "base:runtime"
import "core:fmt"
import "core:log"
import "core:mem"
+import hm "core:container/handle_map"
import "phys"
import "fw"
+Handle :: hm.Handle32
Vec2 :: fw.Vec2
Vec2i :: fw.Vec2i
Color :: fw.Color
@@ -28,11 +30,11 @@ state: struct {
camera_target: Vec2,
camera_pos: Vec2,
last_fixed_update: f64,
- prop_list: Entity_List(Prop),
- wiggle_prop_list: Entity_List(Wiggle_Prop),
- platform_list: Entity_List(Platform),
- bullet_list: Entity_List(Bullet),
- rope_list: Entity_List(Rope),
+ prop_list: hm.Dynamic_Handle_Map(Prop, Handle),
+ wiggle_prop_list: hm.Dynamic_Handle_Map(Wiggle_Prop, Handle),
+ platform_list: hm.Dynamic_Handle_Map(Platform, Handle),
+ bullet_list: hm.Dynamic_Handle_Map(Bullet, Handle),
+ rope_list: hm.Dynamic_Handle_Map(Rope, Handle),
}
logger: log.Logger
@@ -150,13 +152,13 @@ frame :: proc() {
cleanup :: proc() {
deinit_player()
- delete_entity_list(state.platform_list)
- delete_entity_list(state.bullet_list)
- delete_entity_list(state.prop_list)
- delete_entity_list(state.wiggle_prop_list)
+ hm.dynamic_destroy(&state.platform_list)
+ hm.dynamic_destroy(&state.bullet_list)
+ hm.dynamic_destroy(&state.prop_list)
+ hm.dynamic_destroy(&state.wiggle_prop_list)
clear_ropes()
- delete_entity_list(state.rope_list)
+ hm.dynamic_destroy(&state.rope_list)
phys.destroy_world()