import SpineShadersStructs import Foundation extension RenderCommand { func getVertices() -> [SpineVertex] { var vertices = [SpineVertex]() let indices = indices let numVertices = numVertices let positions = positions(numVertices: numVertices) let uvs = uvs(numVertices: numVertices) let colors = colors(numVertices: numVertices) vertices.reserveCapacity(indices.count) for i in 0.. vector_float4 { guard color != -1 else { return vector_float4(1.0, 1.0, 1.0, 1.0) } let alpha = (color >> 24) & 0xFF let red = (color >> 16) & 0xFF let green = (color >> 8) & 0xFF let blue = color & 0xFF return vector_float4(Float(red)/255, Float(green)/255, Float(blue)/255, (Float(alpha)/255)) } }