mirror of
https://github.com/dscyrescotti/Memola.git
synced 2026-05-17 05:07:11 +02:00
feat: remove guard condition
This commit is contained in:
@@ -174,9 +174,6 @@ extension GraphicContext {
|
|||||||
|
|
||||||
extension GraphicContext: Drawable {
|
extension GraphicContext: Drawable {
|
||||||
func prepare(device: MTLDevice) {
|
func prepare(device: MTLDevice) {
|
||||||
guard vertexBuffer == nil else {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
vertexCount = vertices.count
|
vertexCount = vertices.count
|
||||||
vertexBuffer = device.makeBuffer(bytes: vertices, length: vertexCount * MemoryLayout<ViewPortVertex>.stride, options: [])
|
vertexBuffer = device.makeBuffer(bytes: vertices, length: vertexCount * MemoryLayout<ViewPortVertex>.stride, options: [])
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,9 +30,6 @@ class GridContext {
|
|||||||
|
|
||||||
extension GridContext: Drawable {
|
extension GridContext: Drawable {
|
||||||
func prepare(device: MTLDevice) {
|
func prepare(device: MTLDevice) {
|
||||||
guard vertexBuffer == nil else {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
vertexBuffer = device.makeBuffer(bytes: vertices, length: vertexCount * MemoryLayout<GridVertex>.stride, options: [])
|
vertexBuffer = device.makeBuffer(bytes: vertices, length: vertexCount * MemoryLayout<GridVertex>.stride, options: [])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -36,9 +36,6 @@ class ViewPortContext {
|
|||||||
|
|
||||||
extension ViewPortContext: Drawable {
|
extension ViewPortContext: Drawable {
|
||||||
func prepare(device: MTLDevice) {
|
func prepare(device: MTLDevice) {
|
||||||
guard vertexBuffer == nil else {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
vertexBuffer = device.makeBuffer(bytes: vertices, length: vertexCount * MemoryLayout<ViewPortVertex>.stride, options: [])
|
vertexBuffer = device.makeBuffer(bytes: vertices, length: vertexCount * MemoryLayout<ViewPortVertex>.stride, options: [])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user