mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 11:18:54 +01:00
Rename bsp -> packing
This commit is contained in:
parent
50be07355f
commit
7e70d5ca69
@ -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"
|
@ -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) {
|
10
shared.go
10
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)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user