Adopted Span for the setTiles wrapper in the library to adapt to Swift 6.4.

This commit is contained in:
2026-09-18 12:22:06 +02:00
parent 07c4fce37b
commit c050ba293e
3 changed files with 42 additions and 5 deletions
+10
View File
@@ -99,6 +99,16 @@ struct WrapperTests {
#expect(visited == 1)
}
@Test func tileMapSetTilesPassesTheCallersStorageWithoutCopying() {
let tileMap = Graphics.TileMap()
let indexes: [UInt16] = [1, 2, 3, 4, 5, 6]
tileMap.setTiles(indexes, rowWidth: 3)
#expect(Mock.events.contains("setTiles(6,3)"))
let storage = indexes.withUnsafeBufferPointer { $0.baseAddress }
#expect(UnsafePointer(Mock.tilesPointer) == storage)
}
// MARK: Sprite
@Test func spriteUserdataRecoversWrapperInCallbacks() {