render: Refactor sprite rendering.
authorDavid Thompson <dthompson2@worcester.edu>
Wed, 17 Jan 2018 17:01:41 +0000 (12:01 -0500)
committerDavid Thompson <dthompson2@worcester.edu>
Wed, 17 Jan 2018 17:01:41 +0000 (12:01 -0500)
commitfedd9bca3d6397e22e5400e8653879bb77bbff2e
treeff358caf4fb550408685ce851ed4dd6b885a7c05
parent4912d9bd202115e6a2d2a22d3414310f8ac63ff2
render: Refactor sprite rendering.

* chickadee/render/texture.scm (<texture-region>): Delete type.
(<texture>)[width, height, gl-size]: Delete fields.
[parent, rect, gl-rect]: Add fields.
(texture-region?): Rewrite.
(make-texture, null-texture): Use new texture constructor.
(make-texture-region): Rewrite in terms of <texture> type.
(list->texture-atlas, split-texture): Use new texture region
constructor.
* chickadee/render/sprite.scm (draw-sprite*): New procedure.
(draw-sprite): Rewrite in terms of draw-sprite*.
(draw-nine-patch*): New procedure.
(draw-nine-patch): Rewrite in terms of draw-nine-patch*.
* chickadee/render/font.scm (draw-text*): New procedure.
(draw-text): Rewrite in terms of draw-text*.
* doc/api.texi: Update draw-sprite, draw-nine-patch, and draw-text
docs.
chickadee/render/font.scm
chickadee/render/sprite.scm
chickadee/render/texture.scm
doc/api.texi