More-efficient scenario draw call
This commit is contained in:
@@ -100,13 +100,12 @@ func (s *Scenario) renderCell(x, y, z int, screen *ebiten.Image, counter map[str
|
||||
// counter[spr.ID] = 0
|
||||
// }
|
||||
// counter[spr.ID] = counter[spr.ID] + 1
|
||||
op := ebiten.DrawImageOptions{GeoM: iso}
|
||||
op.GeoM.Translate(float64(spr.XOffset), float64(spr.YOffset))
|
||||
|
||||
iso.Translate(float64(spr.XOffset), float64(spr.YOffset))
|
||||
|
||||
if err := screen.DrawImage(spr.Image, &ebiten.DrawImageOptions{GeoM: iso}); err != nil {
|
||||
if err := screen.DrawImage(spr.Image, &op); err != nil {
|
||||
return err
|
||||
}
|
||||
iso.Translate(float64(-spr.XOffset), float64(-spr.YOffset))
|
||||
}
|
||||
|
||||
return nil
|
||||
|
Reference in New Issue
Block a user