Blocks and chunks
This commit is contained in:
@@ -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),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user