internal/atlas: unify the term 'isolate' and 'independent' to 'isolate'

This commit is contained in:
Hajime Hoshi 2022-06-06 00:27:42 +09:00
parent 6ce8f77c53
commit b9012fc6ed
4 changed files with 16 additions and 16 deletions

View File

@ -211,7 +211,7 @@ type Image struct {
width int width int
height int height int
disposed bool disposed bool
independent bool isolate bool
volatile bool volatile bool
screen bool screen bool
@ -711,8 +711,8 @@ func NewImage(width, height int) *Image {
} }
} }
func (i *Image) SetIndependent(independent bool) { func (i *Image) SetIsolate(isolate bool) {
i.independent = independent i.isolate = isolate
} }
func (i *Image) SetVolatile(volatile bool) { func (i *Image) SetVolatile(volatile bool) {
@ -730,7 +730,7 @@ func (i *Image) canBePutOnAtlas() bool {
if minSize == 0 || maxSize == 0 { if minSize == 0 || maxSize == 0 {
panic("atlas: minSize or maxSize must be initialized") panic("atlas: minSize or maxSize must be initialized")
} }
if i.independent { if i.isolate {
return false return false
} }
if i.volatile { if i.volatile {

View File

@ -66,16 +66,16 @@ func (i *Image) initialize() {
i.img = atlas.NewImage(i.width, i.height) i.img = atlas.NewImage(i.width, i.height)
} }
func (i *Image) SetIndependent(independent bool) { func (i *Image) SetIsolate(isolate bool) {
if maybeCanAddDelayedCommand() { if maybeCanAddDelayedCommand() {
if tryAddDelayedCommand(func() error { if tryAddDelayedCommand(func() error {
i.SetIndependent(independent) i.SetIsolate(isolate)
return nil return nil
}) { }) {
return return
} }
} }
i.img.SetIndependent(independent) i.img.SetIsolate(isolate)
} }
func (i *Image) SetVolatile(volatile bool) { func (i *Image) SetVolatile(volatile bool) {

View File

@ -51,8 +51,8 @@ func NewScreenFramebufferMipmap(width, height int) *Mipmap {
} }
} }
func (m *Mipmap) SetIndependent(independent bool) { func (m *Mipmap) SetIsolate(isolate bool) {
m.orig.SetIndependent(independent) m.orig.SetIsolate(isolate)
} }
func (m *Mipmap) SetVolatile(volatile bool) { func (m *Mipmap) SetVolatile(volatile bool) {

View File

@ -245,11 +245,11 @@ func (c *context) layoutGame(outsideWidth, outsideHeight float64, deviceScaleFac
if c.offscreen == nil { if c.offscreen == nil {
c.offscreen = c.game.NewOffscreenImage(ow, oh) c.offscreen = c.game.NewOffscreenImage(ow, oh)
// Keep the offscreen an independent image from an atlas (#1938). // Keep the offscreen an isolate image from an atlas (#1938).
// The shader program for the screen is special and doesn't work well with an image on an atlas. // The shader program for the screen is special and doesn't work well with an image on an atlas.
// An image on an atlas is surrounded by a transparent edge, // An image on an atlas is surrounded by a transparent edge,
// and the shader program unexpectedly picks the pixel on the edges. // and the shader program unexpectedly picks the pixel on the edges.
c.offscreen.mipmap.SetIndependent(true) c.offscreen.mipmap.SetIsolate(true)
} }
return ow, oh return ow, oh