mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-26 11:48:55 +01:00
shareable: Bug fix: volatile or screen must not use shareable texture
This commit is contained in:
parent
d10d319d7e
commit
5beaf843a6
@ -93,6 +93,8 @@ type Image struct {
|
|||||||
|
|
||||||
node *packing.Node
|
node *packing.Node
|
||||||
countForShare int
|
countForShare int
|
||||||
|
|
||||||
|
neverShared bool
|
||||||
}
|
}
|
||||||
|
|
||||||
func (i *Image) moveTo(dst *Image) {
|
func (i *Image) moveTo(dst *Image) {
|
||||||
@ -337,6 +339,9 @@ func NewImage(width, height int) *Image {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (i *Image) shareable() bool {
|
func (i *Image) shareable() bool {
|
||||||
|
if i.neverShared {
|
||||||
|
return false
|
||||||
|
}
|
||||||
return i.width <= maxSize && i.height <= maxSize
|
return i.width <= maxSize && i.height <= maxSize
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -396,6 +401,7 @@ func NewVolatileImage(width, height int) *Image {
|
|||||||
backend: &backend{
|
backend: &backend{
|
||||||
restorable: r,
|
restorable: r,
|
||||||
},
|
},
|
||||||
|
neverShared: true,
|
||||||
}
|
}
|
||||||
runtime.SetFinalizer(i, (*Image).Dispose)
|
runtime.SetFinalizer(i, (*Image).Dispose)
|
||||||
return i
|
return i
|
||||||
@ -412,6 +418,7 @@ func NewScreenFramebufferImage(width, height int) *Image {
|
|||||||
backend: &backend{
|
backend: &backend{
|
||||||
restorable: r,
|
restorable: r,
|
||||||
},
|
},
|
||||||
|
neverShared: true,
|
||||||
}
|
}
|
||||||
runtime.SetFinalizer(i, (*Image).Dispose)
|
runtime.SetFinalizer(i, (*Image).Dispose)
|
||||||
return i
|
return i
|
||||||
|
Loading…
Reference in New Issue
Block a user