From 3c640e0d8244f87fec9518a60c7e5e95713d7f78 Mon Sep 17 00:00:00 2001 From: iamcheeseman <[hidden email]> Date: Thu, 15 Jan 2026 12:41:07 -0500 Subject: Fix memory leaks in the asset compiler --- compile_assets.o | 0 src.bin | Bin 0 -> 5524024 bytes src/assets.odin | 4 +--- tools/compile_assets/main.odin | 2 -- tools/compile_assets/tiled.odin | 4 ++-- 5 files changed, 3 insertions(+), 7 deletions(-) create mode 100644 compile_assets.o create mode 100755 src.bin diff --git a/compile_assets.o b/compile_assets.o new file mode 100644 index 0000000..e69de29 diff --git a/src.bin b/src.bin new file mode 100755 index 0000000..819cc0c Binary files /dev/null and b/src.bin differ diff --git a/src/assets.odin b/src/assets.odin index ce5d9c5..b072805 100644 --- a/src/assets.odin +++ b/src/assets.odin @@ -6,8 +6,6 @@ package demonchime // This file is autogenerated by tools/compile_assets // All resource types are defined in 'src/resources.odin'. -import rl "vendor:raylib" - Image_Id :: enum { BULLET, PISTOL, @@ -51,7 +49,7 @@ images: [Image_Id]Image_Resource = { animations: [Animation_Id]Animation_Resource = { .NONE = {frame_count=1, frame_durations={100}, tags={}}, - .PLAYER = {frame_count = 23, frame_durations = {100, 100, 100, 100, 100, 100, 75, 75, 75, 75, 75, 75, 75, 75, 100, 100, 100, 100, 100, 100, 100, 100, 100}, tags = {"jump_up"={from = 14, to = 15}, "run"={from = 6, to = 13}, "jump_trans"={from = 16, to = 16}, "jump_down"={from = 17, to = 18}, "idle"={from = 0, to = 5}, "sleep"={from = 19, to = 22}}}, + .PLAYER = {frame_count = 23, frame_durations = {100, 100, 100, 100, 100, 100, 75, 75, 75, 75, 75, 75, 75, 75, 100, 100, 100, 100, 100, 100, 100, 100, 100}, tags = {"idle"={from = 0, to = 5}, "jump_trans"={from = 16, to = 16}, "run"={from = 6, to = 13}, "jump_down"={from = 17, to = 18}, "jump_up"={from = 14, to = 15}, "sleep"={from = 19, to = 22}}}, } rooms: [Room_Id]Room_Resource = { diff --git a/tools/compile_assets/main.odin b/tools/compile_assets/main.odin index b9c33db..01fdb3f 100644 --- a/tools/compile_assets/main.odin +++ b/tools/compile_assets/main.odin @@ -20,8 +20,6 @@ package demonchime // This file is autogenerated by tools/compile_assets // All resource types are defined in 'src/resources.odin'. -import rl "vendor:raylib" - Image_Id :: enum { } diff --git a/tools/compile_assets/tiled.odin b/tools/compile_assets/tiled.odin index 9305acc..29a6a69 100644 --- a/tools/compile_assets/tiled.odin +++ b/tools/compile_assets/tiled.odin @@ -366,7 +366,7 @@ load_json_tileset :: proc(path: string) { } } - gids := make([]u32, len(local_tiles)) + gids := make([]u32, len(local_tiles), context.temp_allocator) for tile, i in local_tiles { gids[i] = first_gid + u32(i) } @@ -407,7 +407,7 @@ load_json_room :: proc(path: string, file: ^os.File) { gid, exists := gids[tileset_name] if !exists { load_json_tileset(strings.concatenate({ - filepath.dir(path), + filepath.dir(path, context.temp_allocator), "/", tileset.source, })) -- cgit v1.3-2-g0d8e