Merge: gamnit: fix integer overflow when there's more than 16,383 sprites
authorJean Privat <jean@pryen.org>
Wed, 28 Jun 2017 19:39:25 +0000 (15:39 -0400)
committerJean Privat <jean@pryen.org>
Wed, 28 Jun 2017 19:39:25 +0000 (15:39 -0400)
commitdb3820679f423b5c28ee0d546084bd6d7e538e7d
tree9cb79c2349badead8cdfd538fa8ef61c9dae4c34
parent86e2cc16921c1fe9cbfd611edc229545a047d653
parentfdc3d2b9f2e7f8f8572a596db63f231057cc2b63
Merge: gamnit: fix integer overflow when there's more than 16,383 sprites

This PR fixes a problem when more than 16,383 sprites used the same texture, thus shared a buffer. This was caused by a `short int` overflow in the vertices indices passed to OpenGL ES. Now, large groups of sprites are simply broken up into smaller groups and buffers.

In the future, if there are too many such groups we could use a larger integer.

Pull-Request: #2519
lib/gamnit/flat.nit