mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
internal/atlas: add special backends to theBackends for consistency
This commit is contained in:
parent
fe0b33db58
commit
fdf36026ae
@ -94,6 +94,9 @@ type backend struct {
|
||||
}
|
||||
|
||||
func (b *backend) tryAlloc(width, height int) (*packing.Node, bool) {
|
||||
if b.page == nil {
|
||||
return nil, false
|
||||
}
|
||||
n := b.page.Alloc(width, height)
|
||||
if n == nil {
|
||||
// The page can't be extended anymore. Return as failure.
|
||||
@ -643,6 +646,7 @@ func (i *Image) allocate(forbiddenBackends []*backend, asSource bool) {
|
||||
i.backend = &backend{
|
||||
restorable: restorable.NewImage(i.width, i.height, restorable.ImageTypeScreen),
|
||||
}
|
||||
theBackends = append(theBackends, i.backend)
|
||||
return
|
||||
}
|
||||
|
||||
@ -658,6 +662,7 @@ func (i *Image) allocate(forbiddenBackends []*backend, asSource bool) {
|
||||
restorable: restorable.NewImage(wp, hp, restorable.ImageTypeRegular),
|
||||
source: asSource && i.imageType == ImageTypeRegular,
|
||||
}
|
||||
theBackends = append(theBackends, i.backend)
|
||||
return
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user