This commit is contained in:
2025-02-27 13:51:11 -06:00
parent cddba06c25
commit f9ea78d62e
4 changed files with 9 additions and 22 deletions

View File

@@ -7,7 +7,7 @@ import "core:path/filepath"
import "core:mem"
CELL_SIZE :: 16
CHUNK_SIZE :: 5
CHUNK_SIZE :: 32
WORLD_DATA_PATH :: "data/worlds"
World :: struct {
@@ -111,22 +111,6 @@ load_chunk :: proc(pos:Vec2i, w:^World) -> Chunk {
mem.copy(transmute([^]u8)&chunk.position.y, &data[offset], size_of(int))
offset += size_of(int)
// // Load Tiles
// for row in &chunk.tiles {
// for &tile in row {
// mem.copy(transmute([^]u8)tile.tilemap_pos.x, &data[offset], size_of(int))
// offset += size_of(int)
// mem.copy(transmute([^]u8)tile.tilemap_pos.y, &data[offset], size_of(int))
// offset += size_of(int)
// //Color
// tile.color = {}
//
// }
// }
// Load tiles
for row_index := 0; row_index < len(chunk.tiles); row_index += 1 {
for tile_index := 0; tile_index < len(chunk.tiles[row_index]); tile_index += 1 {
@@ -169,11 +153,11 @@ generate_chunk :: proc(pos:Vec2i) -> Chunk {
for x in 0..<CHUNK_SIZE {
for y in 0..<CHUNK_SIZE {
chunk.tiles[x][y] = Tile {
type = .FOLIAGE,
tilemap_pos = {0,2},
type = .NOTHING,
tilemap_pos = {0,0},
interaction = .NOTHING,
resource = .NOTHING,
color = {0,255,0,255}
color = {0,0,0,255}
}
}
}