From cd53bb05a0121973dfb68ce1b255aebb75bd501a Mon Sep 17 00:00:00 2001 From: Nao Pross Date: Sat, 22 Dec 2018 03:35:21 +0100 Subject: Skip rendering for blank tiles (value = 0) --- src/graphics.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/graphics.rs b/src/graphics.rs index 8ccdbd3..9af03f4 100644 --- a/src/graphics.rs +++ b/src/graphics.rs @@ -87,6 +87,12 @@ impl Graphics { for layer in &state.map.layers { let tmx_tile = layer.tiles[y as usize][x as usize]; + + // blank tile + if tmx_tile <= 0 { + continue; + } + let tmx_tileset = state.map.get_tileset_by_gid(tmx_tile).unwrap(); // load tileset if not loaded yet -- cgit v1.2.1