mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
shareable: Rename variables
This commit is contained in:
parent
b92bc6f21c
commit
b15fb523a8
@ -185,34 +185,34 @@ func NewImage(width, height int) *Image {
|
|||||||
defer backendsM.Unlock()
|
defer backendsM.Unlock()
|
||||||
|
|
||||||
if width > maxSize || height > maxSize {
|
if width > maxSize || height > maxSize {
|
||||||
s := &backend{
|
b := &backend{
|
||||||
restorable: restorable.NewImage(width, height, false),
|
restorable: restorable.NewImage(width, height, false),
|
||||||
}
|
}
|
||||||
return &Image{
|
return &Image{
|
||||||
backend: s,
|
backend: b,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, s := range theBackends {
|
for _, b := range theBackends {
|
||||||
if n := s.page.Alloc(width, height); n != nil {
|
if n := b.page.Alloc(width, height); n != nil {
|
||||||
return &Image{
|
return &Image{
|
||||||
backend: s,
|
backend: b,
|
||||||
node: n,
|
node: n,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
s := &backend{
|
b := &backend{
|
||||||
restorable: restorable.NewImage(maxSize, maxSize, false),
|
restorable: restorable.NewImage(maxSize, maxSize, false),
|
||||||
page: packing.NewPage(maxSize, maxSize), // TODO: Utilize 'Extend' page.
|
page: packing.NewPage(maxSize, maxSize), // TODO: Utilize 'Extend' page.
|
||||||
}
|
}
|
||||||
theBackends = append(theBackends, s)
|
theBackends = append(theBackends, b)
|
||||||
|
|
||||||
n := s.page.Alloc(width, height)
|
n := b.page.Alloc(width, height)
|
||||||
if n == nil {
|
if n == nil {
|
||||||
panic("not reached")
|
panic("not reached")
|
||||||
}
|
}
|
||||||
i := &Image{
|
i := &Image{
|
||||||
backend: s,
|
backend: b,
|
||||||
node: n,
|
node: n,
|
||||||
}
|
}
|
||||||
runtime.SetFinalizer(i, (*Image).Dispose)
|
runtime.SetFinalizer(i, (*Image).Dispose)
|
||||||
|
Loading…
Reference in New Issue
Block a user