mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 03:08:54 +01:00
internal/atlas: add an assertion at putOnAtlas
This commit is contained in:
parent
9bf5f2188f
commit
7f10744514
@ -323,9 +323,11 @@ func (i *Image) putOnAtlas(graphicsDriver graphicsdriver.Graphics) error {
|
|||||||
if !i.canBePutOnAtlas() {
|
if !i.canBePutOnAtlas() {
|
||||||
panic("atlas: putOnAtlas cannot be called on a image that cannot be on an atlas")
|
panic("atlas: putOnAtlas cannot be called on a image that cannot be on an atlas")
|
||||||
}
|
}
|
||||||
|
if i.volatile {
|
||||||
|
panic("atlas: a volatile image cannot be put on an atlas")
|
||||||
|
}
|
||||||
|
|
||||||
newI := NewImage(i.width, i.height)
|
newI := NewImage(i.width, i.height)
|
||||||
newI.SetVolatile(i.volatile)
|
|
||||||
|
|
||||||
if restorable.NeedsRestoring() {
|
if restorable.NeedsRestoring() {
|
||||||
// If the underlying graphics driver requires restoring from the context lost, the pixel data is
|
// If the underlying graphics driver requires restoring from the context lost, the pixel data is
|
||||||
|
Loading…
Reference in New Issue
Block a user