Skip to content

Commit

Permalink
ebiten: Bug fix: The vertex backend was not flushed when the screen i…
Browse files Browse the repository at this point in the history
…s shrunk

The last parameter of QuadVertices represents whether we can flush
the backend vertices (on Wasm). The problem was that this was
unexpectedly false even though the image is the screen, when the
screen rendering is done with FilterLinear instead of FilterScreen.

Closes hajimehoshi#1479
  • Loading branch information
hajimehoshi committed Jan 31, 2021
1 parent 53c300a commit 321bc6d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion image.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ type Image struct {
original *Image

filter Filter

screen bool
}

func (i *Image) copyCheck() {
Expand Down Expand Up @@ -254,7 +256,7 @@ func (i *Image) DrawImage(img *Image, options *DrawImageOptions) error {
sy0 := float32(bounds.Min.Y)
sx1 := float32(bounds.Max.X)
sy1 := float32(bounds.Max.Y)
vs := graphics.QuadVertices(sx0, sy0, sx1, sy1, a, b, c, d, tx, ty, 1, 1, 1, 1, filter == driver.FilterScreen)
vs := graphics.QuadVertices(sx0, sy0, sx1, sy1, a, b, c, d, tx, ty, 1, 1, 1, 1, i.screen)
is := graphics.QuadIndices()

srcs := [graphics.ShaderImageNum]*mipmap.Mipmap{img.mipmap}
Expand Down Expand Up @@ -849,6 +851,7 @@ func newScreenFramebufferImage(width, height int) *Image {
bounds: image.Rect(0, 0, width, height),
}
i.addr = i
i.screen = true
return i
}

Expand Down

0 comments on commit 321bc6d

Please sign in to comment.