Skip to content

Commit

Permalink
Remove the use of PreparePass
Browse files Browse the repository at this point in the history
  • Loading branch information
imthatgin committed Apr 5, 2024
1 parent 5719a0a commit 2c03a85
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions pass.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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,
}
}

0 comments on commit 2c03a85

Please sign in to comment.