diff options
Diffstat (limited to 'engine/node-2d.scm')
-rw-r--r-- | engine/node-2d.scm | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/engine/node-2d.scm b/engine/node-2d.scm index d5d9234..163a798 100644 --- a/engine/node-2d.scm +++ b/engine/node-2d.scm @@ -302,12 +302,18 @@ ;;; (define-class <sprite> (<node-2d>) - (texture #:accessor texture #:init-keyword #:texture)) + (texture #:accessor texture #:init-keyword #:texture) + (shader #:accessor shader #:init-keyword #:shader #:init-form #f)) (define-method (draw (sprite <sprite>) alpha) - (draw-sprite* (asset-ref (texture sprite)) - (texture-gl-rect (texture sprite)) - (world-matrix sprite))) + (if (shader sprite) + (draw-sprite* (asset-ref (texture sprite)) + (texture-gl-rect (texture sprite)) + (world-matrix sprite) + #:shader (force (shader sprite))) + (draw-sprite* (asset-ref (texture sprite)) + (texture-gl-rect (texture sprite)) + (world-matrix sprite)))) (define-class <animated-sprite> (<sprite>) (atlas #:accessor atlas #:init-keyword #:atlas) |