summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2021-04-09 22:39:15 -0400
committerDavid Thompson <dthompson2@worcester.edu>2021-04-09 22:39:39 -0400
commit5c919ae2dfaee36d689b2c2bedee1d2745bd2d6d (patch)
tree1082daaf34a35861a98893331474fc39ee011bdd
parentdb34d810809120ad36a9c53580b55658c4906e95 (diff)
graphics: texture: Add texture-atlas-size procedure.
-rw-r--r--chickadee/graphics/texture.scm5
1 files changed, 5 insertions, 0 deletions
diff --git a/chickadee/graphics/texture.scm b/chickadee/graphics/texture.scm
index fbf5bdc..6debd11 100644
--- a/chickadee/graphics/texture.scm
+++ b/chickadee/graphics/texture.scm
@@ -62,6 +62,7 @@
split-texture
texture-tileset-dimensions
texture-atlas?
+ texture-atlas-size
texture-atlas-texture
texture-atlas-ref
load-tileset))
@@ -323,6 +324,10 @@ coordinate rects denoting the various regions within."
within."
(list->texture-atlas texture rects))
+(define (texture-atlas-size atlas)
+ "Return the size of ATLAS."
+ (vector-length (texture-atlas-vector atlas)))
+
(define (texture-atlas-ref atlas index)
"Return the texture region associated with INDEX in
ATLAS."