render: texture: Keep a rect for use with draw-sprite and friends.
authorDavid Thompson <dthompson2@worcester.edu>
Wed, 17 Jan 2018 19:20:14 +0000 (14:20 -0500)
committerDavid Thompson <dthompson2@worcester.edu>
Wed, 17 Jan 2018 19:20:14 +0000 (14:20 -0500)
commit5896bde48b8462e935b4c0c7c51c21eb524b1913
treeabd0384b2b172f3a26edb173023d6b89deedc187
parenteb990ed509b080fd9ccc2edbb8c9cdf629112784
render: texture: Keep a rect for use with draw-sprite and friends.

Easier to calculate it once and hang onto it than to generate it each
time draw-sprite is called.

* chickadee/render/texture.scm (<texture>)[rect]: Delete field.
[x y width height gl-tex-rect]: New fields.
* chickadee/render/sprite.scm (draw-sprite*, draw-sprite,
draw-nine-patch*): Use proper accessors for texture rects.
chickadee/render/sprite.scm
chickadee/render/texture.scm