mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
internal/graphicscommand: Refactoring: Do not you 'int' as a variable name
This commit is contained in:
parent
683da479c7
commit
7675e2735b
@ -227,17 +227,17 @@ func (q *commandQueue) flush() error {
|
|||||||
// Instead, align the vertices with about 1/3 pixels.
|
// Instead, align the vertices with about 1/3 pixels.
|
||||||
for idx := 0; idx < 2; idx++ {
|
for idx := 0; idx < 2; idx++ {
|
||||||
x := vs[i*graphics.VertexFloatNum+idx]
|
x := vs[i*graphics.VertexFloatNum+idx]
|
||||||
int := float32(math.Floor(float64(x)))
|
ix := float32(math.Floor(float64(x)))
|
||||||
frac := x - int
|
frac := x - ix
|
||||||
switch {
|
switch {
|
||||||
case frac < 3.0/16.0:
|
case frac < 3.0/16.0:
|
||||||
vs[i*graphics.VertexFloatNum+idx] = int
|
vs[i*graphics.VertexFloatNum+idx] = ix
|
||||||
case frac < 8.0/16.0:
|
case frac < 8.0/16.0:
|
||||||
vs[i*graphics.VertexFloatNum+idx] = int + 5.0/16.0
|
vs[i*graphics.VertexFloatNum+idx] = ix + 5.0/16.0
|
||||||
case frac < 13.0/16.0:
|
case frac < 13.0/16.0:
|
||||||
vs[i*graphics.VertexFloatNum+idx] = int + 11.0/16.0
|
vs[i*graphics.VertexFloatNum+idx] = ix + 11.0/16.0
|
||||||
default:
|
default:
|
||||||
vs[i*graphics.VertexFloatNum+idx] = int + 16.0/16.0
|
vs[i*graphics.VertexFloatNum+idx] = ix + 16.0/16.0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user