From 6cca316d31765ba773f3b8e52e743bf8747f6236 Mon Sep 17 00:00:00 2001 From: Max Bradbury Date: Sun, 19 Jul 2020 14:30:45 +0100 Subject: [PATCH] don't duplicate background tile --- src/lib.rs | 2 +- src/test-resources/expected.bitsy | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index c3165d0..171a721 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -66,7 +66,7 @@ pub fn add_tiles(game_data: String, image: String, prefix: String) -> String { colour_id: None }; - if !game.tiles.contains(&tile) { + if tile != bitsy_parser::mock::tile_background() && !game.tiles.contains(&tile) { game.add_tile(tile); tile_index += 1; diff --git a/src/test-resources/expected.bitsy b/src/test-resources/expected.bitsy index b47d55a..0931f2b 100644 --- a/src/test-resources/expected.bitsy +++ b/src/test-resources/expected.bitsy @@ -41,7 +41,7 @@ TIL a 11111111 NAME block -TIL 2 +TIL 1 00011000 00111000 00011000 @@ -51,7 +51,7 @@ TIL 2 00011000 00111100 -TIL 3 +TIL 2 00111100 01100110 01100110 @@ -61,7 +61,7 @@ TIL 3 01100000 01111110 -TIL 4 +TIL 3 00111100 01100110 01100110