diff --git a/examples/sprites/main.go b/examples/sprites/main.go index e7b5472ad..83a89e20d 100644 --- a/examples/sprites/main.go +++ b/examples/sprites/main.go @@ -105,13 +105,13 @@ var sprites = &Sprites{make([]*Sprite, MaxSprites), 500} func update(screen *ebiten.Image) error { if ebiten.IsKeyPressed(ebiten.KeyLeft) { - sprites.num -= 100 + sprites.num -= 20 if sprites.num < MinSprites { sprites.num = MinSprites } } if ebiten.IsKeyPressed(ebiten.KeyRight) { - sprites.num += 100 + sprites.num += 20 if MaxSprites < sprites.num { sprites.num = MaxSprites } diff --git a/internal/graphics/command.go b/internal/graphics/command.go index a5c603014..162724fe0 100644 --- a/internal/graphics/command.go +++ b/internal/graphics/command.go @@ -58,6 +58,9 @@ func (q *commandQueue) Enqueue(command command) { q.commands = append(q.commands, command) } +// commandGroups separates q.commands into some groups. +// The number of quads of drawImageCommand in one groups must be equal to or less than +// its limit (maxQuads). func (q *commandQueue) commandGroups() [][]command { cs := make([]command, len(q.commands)) copy(cs, q.commands)