diff options
author | Ricardo Wurmus <rekado@elephly.net> | 2019-07-12 23:07:32 +0200 |
---|---|---|
committer | Ricardo Wurmus <rekado@elephly.net> | 2019-07-12 23:07:32 +0200 |
commit | c8de1a94ed00d8c6f304c2edb73e3a2419b0ce9b (patch) | |
tree | c7f7db5cd355f9f590af8fbb61e6a4b2db665fab /engine | |
parent | bc3d81c004e7edfc2ea7449968eaaf44c8806b88 (diff) |
Update to Chickadee 0.4.0.
* characters/lorenzo.scm (default-shader): Remove.
(lorenzo): Use #:tint instead of #:shader; hide shadow when dead.
* engine/node-2d.scm (<sprite>): Replace SHADER field with TINT.
(draw <sprite>): Remove SHADER case.
* engine/node.scm (run-node): Use RUN-GAME instead of RUN-GAME/SDL.
* scenes/death.scm (ghost-shader): Remove.
(populate): Use DEAD? keyword instead of SHADER.
Diffstat (limited to 'engine')
-rw-r--r-- | engine/node-2d.scm | 14 | ||||
-rw-r--r-- | engine/node.scm | 49 |
2 files changed, 30 insertions, 33 deletions
diff --git a/engine/node-2d.scm b/engine/node-2d.scm index 163a798..3de1597 100644 --- a/engine/node-2d.scm +++ b/engine/node-2d.scm @@ -303,17 +303,13 @@ (define-class <sprite> (<node-2d>) (texture #:accessor texture #:init-keyword #:texture) - (shader #:accessor shader #:init-keyword #:shader #:init-form #f)) + (tint #:accessor tint #:init-keyword #:tint #:init-form white)) (define-method (draw (sprite <sprite>) alpha) - (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)))) + (draw-sprite* (asset-ref (texture sprite)) + (texture-gl-rect (texture sprite)) + (world-matrix sprite) + #:tint (tint sprite))) (define-class <animated-sprite> (<sprite>) (atlas #:accessor atlas #:init-keyword #:atlas) diff --git a/engine/node.scm b/engine/node.scm index 5f2434b..b62d6e4 100644 --- a/engine/node.scm +++ b/engine/node.scm @@ -1,6 +1,6 @@ ;;; Lisp Game Jam 2018 ;;; Copyright © 2018 David Thompson <davet@gnu.org> -;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net> +;;; Copyright © 2018, 2019 Ricardo Wurmus <rekado@elephly.net> ;;; ;;; This program is free software: you can redistribute it and/or ;;; modify it under the terms of the GNU General Public License as @@ -17,6 +17,7 @@ ;;; <http://www.gnu.org/licenses/>. (define-module (engine node) + #:use-module (chickadee) #:use-module (chickadee sdl) #:use-module (chickadee math matrix) #:use-module (chickadee math quaternion) @@ -229,26 +230,26 @@ one." (window-height 480) window-fullscreen? (update-hz 60)) - (run-game/sdl #:window-title window-title - #:window-width window-width - #:window-height window-height - #:window-fullscreen? window-fullscreen? - #:update-hz update-hz - #:load - (lambda () - (set-root-node! (make-root-node))) - #:draw - (cut draw/children *root-node* <>) - #:update - (cut update/children *root-node* <>) - #:quit - (lambda () - (visit-while (cut on-quit <>) *root-node*)) - #:key-press - (lambda (key sc mods repeat?) - (visit-while (cut on-key-press <> key mods repeat?) - *root-node*)) - #:text-input - (lambda (text) - (visit-while (cut on-text-edit <> text) - *root-node*)))) + (run-game #:window-title window-title + #:window-width window-width + #:window-height window-height + #:window-fullscreen? window-fullscreen? + #:update-hz update-hz + #:load + (lambda () + (set-root-node! (make-root-node))) + #:draw + (cut draw/children *root-node* <>) + #:update + (cut update/children *root-node* <>) + #:quit + (lambda () + (visit-while (cut on-quit <>) *root-node*)) + #:key-press + (lambda (key sc mods repeat?) + (visit-while (cut on-key-press <> key mods repeat?) + *root-node*)) + #:text-input + (lambda (text) + (visit-while (cut on-text-edit <> text) + *root-node*)))) |