mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-23 17:32:02 +01:00
shareable: Improve panic messages
This commit is contained in:
parent
a5421de8ab
commit
815f2a6b35
@ -220,10 +220,10 @@ func (i *Image) DrawImage(img *Image, vertices []float32, indices []uint16, colo
|
|||||||
defer backendsM.Unlock()
|
defer backendsM.Unlock()
|
||||||
|
|
||||||
if img.disposed {
|
if img.disposed {
|
||||||
panic("shareable: the drawing source image must not be disposed")
|
panic("shareable: the drawing source image must not be disposed (DrawImage)")
|
||||||
}
|
}
|
||||||
if i.disposed {
|
if i.disposed {
|
||||||
panic("shareable: the drawing target image must not be disposed")
|
panic("shareable: the drawing target image must not be disposed (DrawImage)")
|
||||||
}
|
}
|
||||||
if img.backend == nil {
|
if img.backend == nil {
|
||||||
img.allocate(true)
|
img.allocate(true)
|
||||||
@ -262,7 +262,7 @@ var emptyImage = NewImage(16, 16)
|
|||||||
func (i *Image) Fill(r, g, b, a uint8) {
|
func (i *Image) Fill(r, g, b, a uint8) {
|
||||||
backendsM.Lock()
|
backendsM.Lock()
|
||||||
if i.disposed {
|
if i.disposed {
|
||||||
panic("shareable: the drawing target image must not be disposed")
|
panic("shareable: the drawing target image must not be disposed (Fill)")
|
||||||
}
|
}
|
||||||
i.ensureNotShared()
|
i.ensureNotShared()
|
||||||
backendsM.Unlock()
|
backendsM.Unlock()
|
||||||
@ -293,7 +293,7 @@ func (i *Image) ReplacePixels(p []byte) {
|
|||||||
|
|
||||||
func (i *Image) replacePixels(p []byte) {
|
func (i *Image) replacePixels(p []byte) {
|
||||||
if i.disposed {
|
if i.disposed {
|
||||||
panic("shareable: the image must not be disposed")
|
panic("shareable: the image must not be disposed at replacePixels")
|
||||||
}
|
}
|
||||||
if i.backend == nil {
|
if i.backend == nil {
|
||||||
if p == nil {
|
if p == nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user