Rename bsp -> packing

This commit is contained in:
Hajime Hoshi 2018-03-06 00:38:56 +09:00
parent 50be07355f
commit 7e70d5ca69
3 changed files with 9 additions and 9 deletions

View File

@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
// Package bsp offers binary space partitioning algorithm. // Package packing offers a packing algorithm in 2D space.
package bsp package packing
import ( import (
"github.com/hajimehoshi/ebiten/internal/sync" "github.com/hajimehoshi/ebiten/internal/sync"

View File

@ -12,12 +12,12 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
package bsp_test package packing_test
import ( import (
"testing" "testing"
. "github.com/hajimehoshi/ebiten/internal/bsp" . "github.com/hajimehoshi/ebiten/internal/packing"
) )
func TestBSP(t *testing.T) { func TestBSP(t *testing.T) {

View File

@ -15,14 +15,14 @@
package ebiten package ebiten
import ( import (
"github.com/hajimehoshi/ebiten/internal/bsp" "github.com/hajimehoshi/ebiten/internal/packing"
"github.com/hajimehoshi/ebiten/internal/restorable" "github.com/hajimehoshi/ebiten/internal/restorable"
"github.com/hajimehoshi/ebiten/internal/sync" "github.com/hajimehoshi/ebiten/internal/sync"
) )
type sharedImage struct { type sharedImage struct {
restorable *restorable.Image restorable *restorable.Image
page bsp.Page page packing.Page
} }
var ( var (
@ -31,7 +31,7 @@ var (
type sharedImagePart struct { type sharedImagePart struct {
sharedImage *sharedImage sharedImage *sharedImage
node *bsp.Node node *packing.Node
} }
func (s *sharedImagePart) image() *restorable.Image { func (s *sharedImagePart) image() *restorable.Image {
@ -67,7 +67,7 @@ func newSharedImagePart(width, height int) *sharedImagePart {
sharedImageLock.Lock() sharedImageLock.Lock()
sharedImageLock.Unlock() sharedImageLock.Unlock()
if width > bsp.MaxSize || height > bsp.MaxSize { if width > packing.MaxSize || height > packing.MaxSize {
return nil return nil
} }
for _, s := range theSharedImages { for _, s := range theSharedImages {
@ -79,7 +79,7 @@ func newSharedImagePart(width, height int) *sharedImagePart {
} }
} }
s := &sharedImage{ s := &sharedImage{
restorable: restorable.NewImage(bsp.MaxSize, bsp.MaxSize, false), restorable: restorable.NewImage(packing.MaxSize, packing.MaxSize, false),
} }
theSharedImages = append(theSharedImages, s) theSharedImages = append(theSharedImages, s)