From 4649420f53b50a0feb89960e9dbb864364b7aaaf Mon Sep 17 00:00:00 2001 From: David Thompson Date: Sun, 28 Jan 2018 10:31:32 -0500 Subject: render: texture: Define custom record type printer for texture atlas. * chickadee/render/texture.scm (display-texture): New procedure. --- chickadee/render/texture.scm | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/chickadee/render/texture.scm b/chickadee/render/texture.scm index ba7233a..960b7d0 100644 --- a/chickadee/render/texture.scm +++ b/chickadee/render/texture.scm @@ -269,6 +269,14 @@ magnification. Valid values are 'nearest and 'linear. By default, (texture texture-atlas-texture) (vector texture-atlas-vector)) +(define (display-texture-atlas atlas port) + (format port + "#" + (texture-atlas-texture atlas) + (vector-length (texture-atlas-vector atlas)))) + +(set-record-type-printer! display-texture-atlas) + (define (list->texture-atlas texture rects) "Return a new atlas for TEXTURE containing RECTS, a list of texture coordinate rects denoting the various tiles within." -- cgit v1.2.3