mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 02:38:53 +01:00
graphics: Reduce calling TextureQuad.Len()
This commit is contained in:
parent
169d57936c
commit
d99ddab6f8
@ -48,10 +48,11 @@ func drawTexture(c *opengl.Context, texture opengl.Texture, projectionMatrix *[4
|
||||
shadersInitialized = true
|
||||
}
|
||||
|
||||
if quads.Len() == 0 {
|
||||
l := quads.Len()
|
||||
if l == 0 {
|
||||
return nil
|
||||
}
|
||||
if quadsMaxNum < quads.Len() {
|
||||
if quadsMaxNum < l {
|
||||
return errors.New(fmt.Sprintf("len(quads) must be equal to or less than %d", quadsMaxNum))
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user