Blocks and chunks

This commit is contained in:
2025-11-28 23:24:22 +01:00
parent 2541dee18d
commit 81a56f393e
32 changed files with 714 additions and 113 deletions

View File

@@ -19,6 +19,7 @@ pub const capacity = std.math.maxInt(std.meta.Tag(Id));
pub const Key = struct { atom: atoms.Atom };
pub const Id = enum(u16) {
empty,
_,
pub fn next(self: Id) Id {
@@ -55,10 +56,12 @@ pub fn init(engine: *Engine, allocator: std.mem.Allocator) !Materials {
});
errdefer material_buffer.deinit(engine);
// TODO Add "error" material to represent the empty value (it shouldn't be rendered, so it's good to know when it is).
return .{
.map = map,
.material_buffer = material_buffer,
.next_id = @enumFromInt(0),
.next_id = @enumFromInt(1),
};
}