From: jsancho Date: Tue, 14 Jun 2011 16:26:45 +0000 (+0000) Subject: (no commit message) X-Git-Url: https://git.jsancho.org/?a=commitdiff_plain;h=4487eb2a881092ebebd5496e6425fa8f07546c0f;p=gacela.git --- diff --git a/src/gacela_mobs.scm b/src/gacela_mobs.scm index ede4235..555ce0f 100755 --- a/src/gacela_mobs.scm +++ b/src/gacela_mobs.scm @@ -54,10 +54,15 @@ (define-macro (define-mob mob-head . look) (let ((name (car mob-head)) (attr (cdr mob-head))) `(define ,name - (let ((attr ',attr)) - (lambda (option) - (case option - ((#:render) - (glPushMatrix) - ,@(map (lambda (x) (if (string? x) `(draw-image ,x) x)) look) - (glPopMatrix)))))))) + (lambda-mob ,attr ,@look)))) + +(define-macro (lambda-mob attr . look) + (let ((look-code (map (lambda (x) (if (string? x) `(draw-texture ,x) x)) look))) + `(let ((attr ',attr)) + (lambda (option) + (case option + ((#:render) + (glPushMatrix) + ,@look-code +; ,@(map (lambda (x) (if (string? x) `(draw-texture ,x) x)) look) + (glPopMatrix)))))))