add drawlist size debug

This commit is contained in:
Josh Deprez 2021-09-16 14:56:27 +10:00
parent 7af49d0787
commit 0926d3fc01

View file

@ -14,6 +14,7 @@ import (
"drjosh.dev/gurgle/geom" "drjosh.dev/gurgle/geom"
"github.com/hajimehoshi/ebiten/v2" "github.com/hajimehoshi/ebiten/v2"
"github.com/hajimehoshi/ebiten/v2/ebitenutil"
) )
var _ interface { var _ interface {
@ -110,6 +111,12 @@ func (g *Game) Draw(screen *ebiten.Image) {
} }
d.Draw(screen, &st.opts) d.Draw(screen, &st.opts)
} }
if true {
// Infodump about draw list
ebitenutil.DebugPrintAt(screen, fmt.Sprintf("len(drawList.list) = %d", len(g.drawList.list)), 0, 30)
ebitenutil.DebugPrintAt(screen, fmt.Sprintf("len(drawList.rev) = %d", len(g.drawList.list)), 0, 45)
}
} }
// Layout returns the configured screen width/height. // Layout returns the configured screen width/height.