From 5c919ae2dfaee36d689b2c2bedee1d2745bd2d6d Mon Sep 17 00:00:00 2001 From: David Thompson Date: Fri, 9 Apr 2021 22:39:15 -0400 Subject: graphics: texture: Add texture-atlas-size procedure. --- chickadee/graphics/texture.scm | 5 +++++ 1 file changed, 5 insertions(+) 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." -- cgit v1.2.3