From: Javier Sancho Date: Tue, 15 May 2012 18:52:26 +0000 (+0200) Subject: New function to get properties of a texture. X-Git-Url: https://git.jsancho.org/?a=commitdiff_plain;h=da6bfdfbda727ff10cfed908bc496638c1ab755c;p=gacela.git New function to get properties of a texture. --- diff --git a/src/gacela.scm b/src/gacela.scm index ab0748b..f3e69e2 100644 --- a/src/gacela.scm +++ b/src/gacela.scm @@ -53,6 +53,7 @@ lambda-mob define-checking-mobs) #:re-export (get-current-color + get-texture-properties set-current-color with-color progn-textures diff --git a/src/video.scm b/src/video.scm index 726694a..4b211e9 100644 --- a/src/video.scm +++ b/src/video.scm @@ -47,6 +47,7 @@ progn-textures draw load-texture + get-texture-properties draw-texture draw-line draw-quad @@ -286,6 +287,9 @@ (set-texture-size! texture real-w real-h) texture)))))) +(define (get-texture-properties texture) + `((width . ,(texture-w texture)) (height . ,(texture-h texture)))) + (define* (draw-texture texture #:optional (zoom 1)) (cond (texture (let ((width (texture-w texture))