restorable: Rename SizePowerOf2 -> InternalSize

This commit is contained in:
Hajime Hoshi 2019-02-14 20:56:38 +09:00
parent a6d3a1e0cb
commit 4e8c7f0a75
2 changed files with 4 additions and 4 deletions

View File

@ -227,8 +227,8 @@ func (i *Image) Size() (int, int) {
return i.image.Size()
}
// SizePowerOf2 returns the next power of 2 values for the size.
func (i *Image) SizePowerOf2() (int, int) {
// InternalSize returns the size of the internal texture.
func (i *Image) InternalSize() (int, int) {
if i.w2 == 0 || i.h2 == 0 {
w, h := i.image.Size()
i.w2 = graphics.NextPowerOf2Int(w)

View File

@ -190,7 +190,7 @@ func (i *Image) QuadVertices(sx0, sy0, sx1, sy1 int, a, b, c, d, tx, ty float32,
i.allocate(true)
}
ox, oy, _, _ := i.region()
w, h := i.backend.restorable.SizePowerOf2()
w, h := i.backend.restorable.InternalSize()
return graphics.QuadVertices(w, h, sx0+ox, sy0+oy, sx1+ox, sy1+oy, a, b, c, d, tx, ty, cr, cg, cb, ca)
}
@ -201,7 +201,7 @@ func (i *Image) PutVertex(dest []float32, dx, dy, sx, sy float32, bx0, by0, bx1,
}
ox, oy, _, _ := i.region()
oxf, oyf := float32(ox), float32(oy)
w, h := i.backend.restorable.SizePowerOf2()
w, h := i.backend.restorable.InternalSize()
su := (sx + oxf) / float32(w)
sv := (sy + oyf) / float32(h)