From 2c03a85f62a9eceb2ec1c9f4701ae742ac8fc0da Mon Sep 17 00:00:00 2001 From: imthatgin Date: Fri, 5 Apr 2024 22:57:49 +0200 Subject: [PATCH] Remove the use of PreparePass --- pass.go | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/pass.go b/pass.go index 882252d..e6296f4 100644 --- a/pass.go +++ b/pass.go @@ -8,10 +8,6 @@ type Pass struct { canvas bool } -func (p *Pass) PreparePass(screen *ebiten.Image) { - p.Surface = screen -} - func (p *Pass) Draw(image *ebiten.Image, ops *ebiten.DrawImageOptions) { // If we're in canvas mode, we draw the image as it should be at the correct position already. if p.canvas { @@ -25,13 +21,15 @@ func (p *Pass) Draw(image *ebiten.Image, ops *ebiten.DrawImageOptions) { func NewRenderPass(camera *Camera) *Pass { return &Pass{ - camera: camera, + Surface: ebiten.NewImage(camera.Width, camera.Height), + camera: camera, } } func NewCanvasRenderPass(camera *Camera) *Pass { return &Pass{ - camera: camera, - canvas: true, + Surface: ebiten.NewImage(camera.Width, camera.Height), + camera: camera, + canvas: true, } }