mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 02:38:53 +01:00
internal/ui: remove an error returning value from Game.Draw
This commit is contained in:
parent
3ae4e873e6
commit
8e40b2562e
@ -73,7 +73,7 @@ func (c *gameForUI) Update() error {
|
||||
return c.game.Update()
|
||||
}
|
||||
|
||||
func (c *gameForUI) Draw(screenScale float64, offsetX, offsetY float64, needsClearingScreen bool, framebufferYDirection graphicsdriver.YDirection, clearScreenEveryFrame, filterEnabled bool) error {
|
||||
func (c *gameForUI) Draw(screenScale float64, offsetX, offsetY float64, needsClearingScreen bool, framebufferYDirection graphicsdriver.YDirection, clearScreenEveryFrame, filterEnabled bool) {
|
||||
c.offscreen.image.SetVolatile(clearScreenEveryFrame)
|
||||
|
||||
// Even though updateCount == 0, the offscreen is cleared and Draw is called.
|
||||
@ -119,5 +119,4 @@ func (c *gameForUI) Draw(screenScale float64, offsetX, offsetY float64, needsCle
|
||||
op.Filter = FilterLinear
|
||||
}
|
||||
c.screen.DrawImage(c.offscreen, op)
|
||||
return nil
|
||||
}
|
||||
|
@ -32,7 +32,7 @@ const DefaultTPS = 60
|
||||
type Game interface {
|
||||
Layout(outsideWidth, outsideHeight float64, deviceScaleFactor float64) (int, int)
|
||||
Update() error
|
||||
Draw(screenScale float64, offsetX, offsetY float64, needsClearingScreen bool, framebufferYDirection graphicsdriver.YDirection, screenClearedEveryFrame, filterEnabled bool) error
|
||||
Draw(screenScale float64, offsetX, offsetY float64, needsClearingScreen bool, framebufferYDirection graphicsdriver.YDirection, screenClearedEveryFrame, filterEnabled bool)
|
||||
}
|
||||
|
||||
type context struct {
|
||||
@ -121,9 +121,7 @@ func (c *context) updateFrameImpl(graphicsDriver graphicsdriver.Graphics, update
|
||||
|
||||
// Draw the game.
|
||||
screenScale, offsetX, offsetY := c.screenScaleAndOffsets(deviceScaleFactor)
|
||||
if err := c.game.Draw(screenScale, offsetX, offsetY, graphicsDriver.NeedsClearingScreen(), graphicsDriver.FramebufferYDirection(), theGlobalState.isScreenClearedEveryFrame(), theGlobalState.isScreenFilterEnabled()); err != nil {
|
||||
return err
|
||||
}
|
||||
c.game.Draw(screenScale, offsetX, offsetY, graphicsDriver.NeedsClearingScreen(), graphicsDriver.FramebufferYDirection(), theGlobalState.isScreenClearedEveryFrame(), theGlobalState.isScreenFilterEnabled())
|
||||
|
||||
// All the vertices data are consumed at the end of the frame, and the data backend can be
|
||||
// available after that. Until then, lock the vertices backend.
|
||||
|
Loading…
Reference in New Issue
Block a user