Only visible tiles update

This commit is contained in:
2026-02-15 22:35:49 -06:00
parent 7e8ab5e180
commit 175f44692a
8 changed files with 65 additions and 22 deletions

View File

@@ -21,7 +21,7 @@ main :: proc() {
TILEMAP_TILE_SIZE,
TILEMAP_TILE_SIZE,
)
grid = create_tile_grid(1500, 1500)
grid = create_tile_grid(5000, 5000)
player = {
position = {1500, 500},
@@ -61,7 +61,13 @@ main :: proc() {
@(private = "file")
update :: proc(delta: f32) {
update_player(&player, delta)
update_tile_grid(grid, delta)
update_tile_grid(
grid,
&player.camera,
f32(tilemap_sheet.tile_width),
f32(tilemap_sheet.tile_height),
delta,
)
}
@(private = "file")