diff --git a/internal/bsp/bsp.go b/internal/packing/packing.go similarity index 98% rename from internal/bsp/bsp.go rename to internal/packing/packing.go index 3dcd669c7..374eb1b3d 100644 --- a/internal/bsp/bsp.go +++ b/internal/packing/packing.go @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -// Package bsp offers binary space partitioning algorithm. -package bsp +// Package packing offers a packing algorithm in 2D space. +package packing import ( "github.com/hajimehoshi/ebiten/internal/sync" diff --git a/internal/bsp/bsp_test.go b/internal/packing/packing_test.go similarity index 98% rename from internal/bsp/bsp_test.go rename to internal/packing/packing_test.go index aef0b00c8..f7e567143 100644 --- a/internal/bsp/bsp_test.go +++ b/internal/packing/packing_test.go @@ -12,12 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. -package bsp_test +package packing_test import ( "testing" - . "github.com/hajimehoshi/ebiten/internal/bsp" + . "github.com/hajimehoshi/ebiten/internal/packing" ) func TestBSP(t *testing.T) { diff --git a/shared.go b/shared.go index ca86a14d7..5b0e30222 100644 --- a/shared.go +++ b/shared.go @@ -15,14 +15,14 @@ package ebiten import ( - "github.com/hajimehoshi/ebiten/internal/bsp" + "github.com/hajimehoshi/ebiten/internal/packing" "github.com/hajimehoshi/ebiten/internal/restorable" "github.com/hajimehoshi/ebiten/internal/sync" ) type sharedImage struct { restorable *restorable.Image - page bsp.Page + page packing.Page } var ( @@ -31,7 +31,7 @@ var ( type sharedImagePart struct { sharedImage *sharedImage - node *bsp.Node + node *packing.Node } func (s *sharedImagePart) image() *restorable.Image { @@ -67,7 +67,7 @@ func newSharedImagePart(width, height int) *sharedImagePart { sharedImageLock.Lock() sharedImageLock.Unlock() - if width > bsp.MaxSize || height > bsp.MaxSize { + if width > packing.MaxSize || height > packing.MaxSize { return nil } for _, s := range theSharedImages { @@ -79,7 +79,7 @@ func newSharedImagePart(width, height int) *sharedImagePart { } } s := &sharedImage{ - restorable: restorable.NewImage(bsp.MaxSize, bsp.MaxSize, false), + restorable: restorable.NewImage(packing.MaxSize, packing.MaxSize, false), } theSharedImages = append(theSharedImages, s)