Exemplo n.º 1
0
func buildVertexSafe(b *builder.Buffer, v *chunkVertex) {
	b.Float(v.X)
	b.Float(v.Y)
	b.Float(v.Z)
	b.UnsignedShort(v.TX)
	b.UnsignedShort(v.TY)
	b.UnsignedShort(v.TW)
	b.UnsignedShort(v.TH)
	b.Short(v.TOffsetX)
	b.Short(v.TOffsetY)
	b.Short(v.TAtlas)
	b.Short(0)
	b.UnsignedByte(v.R)
	b.UnsignedByte(v.G)
	b.UnsignedByte(v.B)
	b.UnsignedByte(255)
	b.UnsignedShort(v.BlockLight)
	b.UnsignedShort(v.SkyLight)
	b.UnsignedShort(0)
	b.UnsignedShort(0)
}
Exemplo n.º 2
0
// builder.Struct works by reflection which is to slow for this
// as its called so often.
func buildVertex(b *builder.Buffer, v *chunkVertex) {
	b.Write((*[1 << 28]byte)(unsafe.Pointer(v))[:vertexSize])
}