mirror of https://git.sr.ht/~kikoodx/kble
Custom colors, initialize level with void.
This commit is contained in:
parent
68817ce969
commit
47a05d56f1
|
@ -42,7 +42,7 @@ pub fn init(allocator: *std.mem.Allocator, width: u16, height: u16) !Self {
|
|||
// Fill with default value to avoid undefined behavior.
|
||||
var i: u32 = 0;
|
||||
while (i < size) : (i += 1) {
|
||||
self.content[i] = 1;
|
||||
self.content[i] = 0;
|
||||
self.selection[i] = false;
|
||||
}
|
||||
return self;
|
||||
|
@ -66,8 +66,8 @@ pub fn draw(self: *Self, scale: u16, offset: Vec2) void {
|
|||
while (cy < self.height) {
|
||||
const cell_content: cell_type = self.content[cy * self.width + cx];
|
||||
const color = switch (cell_content) {
|
||||
0 => ray.BLACK,
|
||||
1 => ray.GRAY,
|
||||
0 => ray.Color{ .r = 26, .g = 26, .b = 26, .a = 255 },
|
||||
1 => ray.Color{ .r = 144, .g = 144, .b = 144, .a = 255 },
|
||||
else => ray.PURPLE, //unknown
|
||||
};
|
||||
ray.DrawRectangle(x + 1, y + 1, scale - 2, scale - 2, color);
|
||||
|
|
Loading…
Reference in New Issue