]> git.jsancho.org Git - gacela.git/commitdiff
New function to get properties of a texture.
authorJavier Sancho <jsf@jsancho.org>
Tue, 15 May 2012 18:52:26 +0000 (20:52 +0200)
committerJavier Sancho <jsf@jsancho.org>
Tue, 15 May 2012 18:52:26 +0000 (20:52 +0200)
src/gacela.scm
src/video.scm

index ab0748b722e863e364b9ef819b21aec3729dcb3e..f3e69e2756b5b6c0d087fe60085ed04f2139d66c 100644 (file)
@@ -53,6 +53,7 @@
                   lambda-mob
                   define-checking-mobs)
   #:re-export (get-current-color
+              get-texture-properties
               set-current-color
               with-color
               progn-textures
index 726694a79be060e624b2833e95db5c0ac482260b..4b211e92cecc16b3b571cf52a54d08992531a6b2 100644 (file)
@@ -47,6 +47,7 @@
            progn-textures
            draw
            load-texture
+           get-texture-properties
            draw-texture
            draw-line
            draw-quad
             (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))