From b9012fc6ed9b5e8a6f41aeb0ca07ab63726d1948 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Mon, 6 Jun 2022 00:27:42 +0900 Subject: [PATCH] internal/atlas: unify the term 'isolate' and 'independent' to 'isolate' --- internal/atlas/image.go | 18 +++++++++--------- internal/buffered/image.go | 6 +++--- internal/mipmap/mipmap.go | 4 ++-- internal/ui/context.go | 4 ++-- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/internal/atlas/image.go b/internal/atlas/image.go index 33066440a..9b6833ed1 100644 --- a/internal/atlas/image.go +++ b/internal/atlas/image.go @@ -208,12 +208,12 @@ func init() { // Image is a rectangle pixel set that might be on an atlas. type Image struct { - width int - height int - disposed bool - independent bool - volatile bool - screen bool + width int + height int + disposed bool + isolate bool + volatile bool + screen bool backend *backend @@ -711,8 +711,8 @@ func NewImage(width, height int) *Image { } } -func (i *Image) SetIndependent(independent bool) { - i.independent = independent +func (i *Image) SetIsolate(isolate bool) { + i.isolate = isolate } func (i *Image) SetVolatile(volatile bool) { @@ -730,7 +730,7 @@ func (i *Image) canBePutOnAtlas() bool { if minSize == 0 || maxSize == 0 { panic("atlas: minSize or maxSize must be initialized") } - if i.independent { + if i.isolate { return false } if i.volatile { diff --git a/internal/buffered/image.go b/internal/buffered/image.go index 9dfa87415..04e8ca8b0 100644 --- a/internal/buffered/image.go +++ b/internal/buffered/image.go @@ -66,16 +66,16 @@ func (i *Image) initialize() { i.img = atlas.NewImage(i.width, i.height) } -func (i *Image) SetIndependent(independent bool) { +func (i *Image) SetIsolate(isolate bool) { if maybeCanAddDelayedCommand() { if tryAddDelayedCommand(func() error { - i.SetIndependent(independent) + i.SetIsolate(isolate) return nil }) { return } } - i.img.SetIndependent(independent) + i.img.SetIsolate(isolate) } func (i *Image) SetVolatile(volatile bool) { diff --git a/internal/mipmap/mipmap.go b/internal/mipmap/mipmap.go index 5bab06df3..e2990b521 100644 --- a/internal/mipmap/mipmap.go +++ b/internal/mipmap/mipmap.go @@ -51,8 +51,8 @@ func NewScreenFramebufferMipmap(width, height int) *Mipmap { } } -func (m *Mipmap) SetIndependent(independent bool) { - m.orig.SetIndependent(independent) +func (m *Mipmap) SetIsolate(isolate bool) { + m.orig.SetIsolate(isolate) } func (m *Mipmap) SetVolatile(volatile bool) { diff --git a/internal/ui/context.go b/internal/ui/context.go index e4aea1aa5..19a348873 100644 --- a/internal/ui/context.go +++ b/internal/ui/context.go @@ -245,11 +245,11 @@ func (c *context) layoutGame(outsideWidth, outsideHeight float64, deviceScaleFac if c.offscreen == nil { 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. // An image on an atlas is surrounded by a transparent edge, // and the shader program unexpectedly picks the pixel on the edges. - c.offscreen.mipmap.SetIndependent(true) + c.offscreen.mipmap.SetIsolate(true) } return ow, oh