Added InlineArray pattern overloads to the library to optimize for macOS 26.
This commit is contained in:
@@ -244,6 +244,17 @@ public final class Sprite {
|
||||
}
|
||||
}
|
||||
|
||||
/// Sets an 8×8 stencil pattern (8 rows of image data).
|
||||
@available(macOS 26, *)
|
||||
public func setStencilPattern(_ rows: [8 of UInt8]) {
|
||||
// The C side copies the pattern, so passing the array's storage
|
||||
// directly is safe.
|
||||
rows.span.withUnsafeBufferPointer { buffer in
|
||||
spriteAPI.pointee.setStencilPattern.unsafelyUnwrapped(
|
||||
pointer, UnsafeMutablePointer(mutating: buffer.baseAddress))
|
||||
}
|
||||
}
|
||||
|
||||
public func clearStencil() {
|
||||
retainedStencil = nil
|
||||
spriteAPI.pointee.clearStencil.unsafelyUnwrapped(pointer)
|
||||
|
||||
Reference in New Issue
Block a user