summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/tilemap.scm14
1 files changed, 7 insertions, 7 deletions
diff --git a/examples/tilemap.scm b/examples/tilemap.scm
index 259bfed..070793e 100644
--- a/examples/tilemap.scm
+++ b/examples/tilemap.scm
@@ -69,13 +69,13 @@
(define map #f)
(define (tiles->texture-regions width height tileset tiles)
- (list->array
- 2
- (list-ec
- (: y height)
- (list-ec
- (: x width)
- (vector-ref tileset (array-ref tiles y x))))))
+ (define (texture-region-at x y)
+ (vector-ref tileset (array-ref tiles y x)))
+
+ (let ((regions (list-ec (: y height)
+ (list-ec (: x width)
+ (texture-region-at x y)))))
+ (list->array 2 regions)))
(define (key-down key mod unicode)
(cond ((any-equal? key (keycode escape) (keycode q))