From da6bfdfbda727ff10cfed908bc496638c1ab755c Mon Sep 17 00:00:00 2001 From: Javier Sancho Date: Tue, 15 May 2012 20:52:26 +0200 Subject: [PATCH 1/1] New function to get properties of a texture. --- src/gacela.scm | 1 + src/video.scm | 4 ++++ 2 files changed, 5 insertions(+) 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)) -- 2.39.5