mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-27 04:08:53 +01:00
restorable: Avoid unneeded discarding images
This commit is contained in:
parent
dca60a2520
commit
8ef0f1ac6a
@ -172,11 +172,11 @@ func (i *Image) ReplacePixels(pixels []byte) {
|
|||||||
|
|
||||||
// DrawImage draws a given image img to the image.
|
// DrawImage draws a given image img to the image.
|
||||||
func (i *Image) DrawImage(img *Image, sx0, sy0, sx1, sy1 int, geom *affine.GeoM, colorm *affine.ColorM, mode opengl.CompositeMode, filter graphics.Filter) {
|
func (i *Image) DrawImage(img *Image, sx0, sy0, sx1, sy1 int, geom *affine.GeoM, colorm *affine.ColorM, mode opengl.CompositeMode, filter graphics.Filter) {
|
||||||
theImages.makeStaleIfDependingOn(i)
|
|
||||||
vs := img.vertices(sx0, sy0, sx1, sy1, geom)
|
vs := img.vertices(sx0, sy0, sx1, sy1, geom)
|
||||||
if vs == nil {
|
if vs == nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
theImages.makeStaleIfDependingOn(i)
|
||||||
if img.stale || img.volatile || !IsRestoringEnabled() {
|
if img.stale || img.volatile || !IsRestoringEnabled() {
|
||||||
i.makeStale()
|
i.makeStale()
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user