summaryrefslogtreecommitdiff
path: root/2d/texture.scm
diff options
context:
space:
mode:
authorDavid Thompson <dthompson@member.fsf.org>2013-08-26 22:31:15 -0400
committerDavid Thompson <dthompson@member.fsf.org>2013-08-26 22:31:15 -0400
commit72209805b1020ec44a7d0052ff257d74bd2036c8 (patch)
treeb8d08ee8619a3c7db2758433e1e6e4ef31017a5e /2d/texture.scm
parent95d31ad231800026e7b0a44ddda42c584dad5671 (diff)
Create tileset module.
Diffstat (limited to '2d/texture.scm')
-rw-r--r--2d/texture.scm19
1 files changed, 1 insertions, 18 deletions
diff --git a/2d/texture.scm b/2d/texture.scm
index 8df5e51..66d158b 100644
--- a/2d/texture.scm
+++ b/2d/texture.scm
@@ -24,7 +24,6 @@
(define-module (2d texture)
#:use-module (srfi srfi-9)
- #:use-module (srfi srfi-42)
#:use-module (figl gl)
#:use-module (2d wrappers gl)
#:use-module (2d wrappers freeimage)
@@ -42,8 +41,7 @@
texture-s2
texture-t2
surface->texture
- draw-texture
- split-texture))
+ draw-texture))
;;;
;;; Textures
@@ -176,18 +174,3 @@
(gl-vertex x2 y2)
(gl-texture-coordinates s2 t1)
(gl-vertex x2 y)))))
-
-(define* (split-texture texture width height #:optional #:key
- (margin 0) (spacing 0))
- "Splits a texture into a vector of texture regions of width x height
-size."
- (define (build-tile tx ty)
- (let* ((x (+ (* tx (+ width spacing)) margin))
- (y (+ (* ty (+ height spacing)) margin)))
- (make-texture-region texture x y width height)))
-
- (let* ((tw (texture-width texture))
- (th (texture-height texture))
- (rows (/ (- tw margin) (+ width spacing)))
- (columns (/ (- tw margin) (+ height spacing))))
- (vector-ec (: y rows) (: x columns) (build-tile x y))))