From 4e8c7f0a75bbb4c5263129ed9467e3c017743db9 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Thu, 14 Feb 2019 20:56:38 +0900 Subject: [PATCH] restorable: Rename SizePowerOf2 -> InternalSize --- internal/restorable/image.go | 4 ++-- internal/shareable/shareable.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/restorable/image.go b/internal/restorable/image.go index 9bcdb5758..622eef93c 100644 --- a/internal/restorable/image.go +++ b/internal/restorable/image.go @@ -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) diff --git a/internal/shareable/shareable.go b/internal/shareable/shareable.go index 1d384c2ee..9e843197d 100644 --- a/internal/shareable/shareable.go +++ b/internal/shareable/shareable.go @@ -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)