From 72209805b1020ec44a7d0052ff257d74bd2036c8 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Mon, 26 Aug 2013 22:31:15 -0400 Subject: Create tileset module. --- 2d/texture.scm | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) (limited to '2d/texture.scm') 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)))) -- cgit v1.2.3