Globalize textures, materials and gui

This commit is contained in:
2026-05-23 01:37:28 +02:00
parent c971443b02
commit 40fcba9323
13 changed files with 195 additions and 242 deletions

View File

@@ -262,12 +262,7 @@ pub fn onMouseDown(self: *Player, button: glfw.MouseButton, game: *Game) void {
},
.right => blk: {
const target_vx = raycast_hit.voxel.add(raycast_hit.side.getSignVector());
const id = game.blocks.getOrLoad(
&game.materials,
&game.textures,
&game.stbi,
blocks[self.block_index],
) catch |err| {
const id = game.blocks.getOrLoad(blocks[self.block_index]) catch |err| {
std.log.err("Error while placing voxel at {f}: {}", .{ target_vx, err });
break :blk;
};