diff --git a/src/lib.rs b/src/lib.rs index 4d133b4..57f6f1b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -49,9 +49,9 @@ lazy_static! { ); } -fn tile_name(prefix: &Option, index: &u32) -> Option { +fn tile_name(prefix: &Option, x: &u32, y: &u32) -> Option { if let Some(prefix) = prefix { - Some(format!("{} {}", prefix, index)) + Some(format!("{} ({},{})", prefix, x, y)) } else { None } @@ -303,7 +303,7 @@ pub fn add_room() -> String { let tile = Tile { // "0" will get overwritten to a new, safe tile ID id: "0".to_string(), - name: tile_name(&state.room_name, &((row * SD) + column + 1)), + name: tile_name(&state.room_name, &row, &column), wall: None, animation_frames: vec![Image { pixels }], colour_id: None diff --git a/src/test-resources/expected.bitsy b/src/test-resources/expected.bitsy index 9614757..93504e1 100644 --- a/src/test-resources/expected.bitsy +++ b/src/test-resources/expected.bitsy @@ -70,7 +70,7 @@ TIL 1 00011000 00011000 00111100 -NAME test 3 +NAME test (0,2) TIL 2 00111100 @@ -81,7 +81,7 @@ TIL 2 00110000 01100000 01111110 -NAME test 5 +NAME test (0,4) TIL 3 00111100 @@ -92,7 +92,7 @@ TIL 3 01100110 01100110 00111100 -NAME test 7 +NAME test (0,6) SPR A 00011000