mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-26 18:52:44 +01:00
graphicscomand: Fix comments
This commit is contained in:
parent
90e03a65c0
commit
915aecb960
@ -115,10 +115,9 @@ func (q *commandQueue) appendVertices(vertices []float32, src *Image) {
|
|||||||
n := len(vertices) / graphics.VertexFloatNum
|
n := len(vertices) / graphics.VertexFloatNum
|
||||||
base := q.nvertices / graphics.VertexFloatNum
|
base := q.nvertices / graphics.VertexFloatNum
|
||||||
|
|
||||||
// TODO: If src is nil, elements for texels (the index in between 2 and 7) in the vertices are used for the
|
|
||||||
// first image's information. Fix this.
|
|
||||||
width := float32(1)
|
width := float32(1)
|
||||||
height := float32(1)
|
height := float32(1)
|
||||||
|
// src is nil when a shader is used and there are no images in the uniform variables.
|
||||||
if src != nil {
|
if src != nil {
|
||||||
w, h := src.InternalSize()
|
w, h := src.InternalSize()
|
||||||
width = float32(w)
|
width = float32(w)
|
||||||
@ -156,21 +155,14 @@ func (q *commandQueue) EnqueueDrawTrianglesCommand(dst, src *Image, vertices []f
|
|||||||
split = true
|
split = true
|
||||||
}
|
}
|
||||||
|
|
||||||
const (
|
|
||||||
maxUint = ^uint(0)
|
|
||||||
maxInt = int(maxUint >> 1)
|
|
||||||
)
|
|
||||||
|
|
||||||
if src != nil {
|
if src != nil {
|
||||||
q.appendVertices(vertices, src)
|
q.appendVertices(vertices, src)
|
||||||
} else {
|
} else {
|
||||||
var img *Image
|
var img *Image
|
||||||
id := maxInt
|
for _, v := range uniforms {
|
||||||
for k, v := range uniforms {
|
if i, ok := v.(*Image); ok {
|
||||||
if i, ok := v.(*Image); ok && id > k {
|
|
||||||
img = i
|
img = i
|
||||||
id = k
|
break
|
||||||
continue
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
q.appendVertices(vertices, img)
|
q.appendVertices(vertices, img)
|
||||||
|
Loading…
Reference in New Issue
Block a user