mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-26 11:48:55 +01:00
vector: Rename AppendVerticesAndIndices to AppendVerticesAndIndicesForFilling
Updates #844
This commit is contained in:
parent
e24eecd4a6
commit
cea0aa72cb
@ -112,7 +112,7 @@ func drawEbitenText(screen *ebiten.Image) {
|
|||||||
op := &ebiten.DrawTrianglesOptions{
|
op := &ebiten.DrawTrianglesOptions{
|
||||||
EvenOdd: true,
|
EvenOdd: true,
|
||||||
}
|
}
|
||||||
vs, is := path.AppendVerticesAndIndices(nil, nil)
|
vs, is := path.AppendVerticesAndIndicesForFilling(nil, nil)
|
||||||
for i := range vs {
|
for i := range vs {
|
||||||
vs[i].SrcX = 1
|
vs[i].SrcX = 1
|
||||||
vs[i].SrcY = 1
|
vs[i].SrcY = 1
|
||||||
@ -152,7 +152,7 @@ func drawEbitenLogo(screen *ebiten.Image, x, y int) {
|
|||||||
op := &ebiten.DrawTrianglesOptions{
|
op := &ebiten.DrawTrianglesOptions{
|
||||||
EvenOdd: true,
|
EvenOdd: true,
|
||||||
}
|
}
|
||||||
vs, is := path.AppendVerticesAndIndices(nil, nil)
|
vs, is := path.AppendVerticesAndIndicesForFilling(nil, nil)
|
||||||
for i := range vs {
|
for i := range vs {
|
||||||
vs[i].SrcX = 1
|
vs[i].SrcX = 1
|
||||||
vs[i].SrcY = 1
|
vs[i].SrcY = 1
|
||||||
@ -195,7 +195,7 @@ func drawWave(screen *ebiten.Image, counter int) {
|
|||||||
op := &ebiten.DrawTrianglesOptions{
|
op := &ebiten.DrawTrianglesOptions{
|
||||||
EvenOdd: true,
|
EvenOdd: true,
|
||||||
}
|
}
|
||||||
vs, is := path.AppendVerticesAndIndices(nil, nil)
|
vs, is := path.AppendVerticesAndIndicesForFilling(nil, nil)
|
||||||
for i := range vs {
|
for i := range vs {
|
||||||
vs[i].SrcX = 1
|
vs[i].SrcX = 1
|
||||||
vs[i].SrcY = 1
|
vs[i].SrcY = 1
|
||||||
|
@ -127,15 +127,15 @@ func (p *Path) cubicTo(x1, y1, x2, y2, x3, y3 float32, level int) {
|
|||||||
p.cubicTo(x123, y123, x23, y23, x3, y3, level+1)
|
p.cubicTo(x123, y123, x23, y23, x3, y3, level+1)
|
||||||
}
|
}
|
||||||
|
|
||||||
// AppendVerticesAndIndices appends vertices and indices for this path and returns them.
|
// AppendVerticesAndIndicesForFilling appends vertices and indices to fill this path and returns them.
|
||||||
// AppendVerticesAndIndices works in a similar way to the built-in append function.
|
// AppendVerticesAndIndicesForFilling works in a similar way to the built-in append function.
|
||||||
// If the arguments are nils, AppendVerticesAndIndices returns new slices.
|
// If the arguments are nils, AppendVerticesAndIndices returns new slices.
|
||||||
//
|
//
|
||||||
// The returned vertice's SrcX and SrcY are 0, and ColorR, ColorG, ColorB, and ColorA are 1.
|
// The returned vertice's SrcX and SrcY are 0, and ColorR, ColorG, ColorB, and ColorA are 1.
|
||||||
//
|
//
|
||||||
// The returned values are intended to be passed to DrawTriangles or DrawTrianglesShader with EvenOdd option
|
// The returned values are intended to be passed to DrawTriangles or DrawTrianglesShader with EvenOdd option
|
||||||
// in order to render a complex polygon like a concave polygon, a polygon with holes, or a self-intersecting polygon.
|
// in order to render a complex polygon like a concave polygon, a polygon with holes, or a self-intersecting polygon.
|
||||||
func (p *Path) AppendVerticesAndIndices(vertices []ebiten.Vertex, indices []uint16) ([]ebiten.Vertex, []uint16) {
|
func (p *Path) AppendVerticesAndIndicesForFilling(vertices []ebiten.Vertex, indices []uint16) ([]ebiten.Vertex, []uint16) {
|
||||||
// TODO: Add tests.
|
// TODO: Add tests.
|
||||||
|
|
||||||
var base uint16
|
var base uint16
|
||||||
|
Loading…
Reference in New Issue
Block a user