summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2014-12-06 18:59:33 -0500
committerDavid Thompson <dthompson2@worcester.edu>2014-12-06 18:59:33 -0500
commit020f04e9e7d5b2681035cc290c2182d0a52ac3a3 (patch)
tree8c91b3ac9aa92fb378dc64797cfb7c561c4fcbb9
parenta4209554bc8f256abf5a85d80724fc72d5710de8 (diff)
render: sprite: Remove make-animated-sprite.
* sly/render/sprite.scm (make-animated-sprite): Delete.
-rw-r--r--sly/render/sprite.scm24
1 files changed, 1 insertions, 23 deletions
diff --git a/sly/render/sprite.scm b/sly/render/sprite.scm
index 9bd487a..e57eaef 100644
--- a/sly/render/sprite.scm
+++ b/sly/render/sprite.scm
@@ -36,11 +36,9 @@
#:use-module (sly render mesh)
#:use-module (sly render model)
#:use-module (sly render shader)
- #:use-module (sly signal)
#:use-module (sly render texture)
#:use-module (sly math vector)
- #:export (make-sprite sprite load-sprite
- make-animated-sprite))
+ #:export (make-sprite sprite load-sprite))
;;;
;;; Sprites
@@ -84,23 +82,3 @@ custom SHADER can be specified."
"Return a sprite mesh for the texture loaded from FILE-NAME.
Optionally, a custom SHADER can be specified."
(make-sprite (load-texture file-name) #:shader shader #:anchor anchor))
-
-(define* (make-animated-sprite textures frame-duration #:optional #:key
- (loop? #t)
- (shader (load-default-shader)))
- "Return a signal that iterates through the list TEXTURES and
-displays them each for FRAME-DURATION ticks. The optional LOOP? flag
-specifies if the animation should play once or indefinitely.
-Optionally, a SHADER can be specified, otherwise the default mesh
-shader is used."
- (let ((frames (map (cut make-sprite <> #:shader shader) textures)))
- (signal-generator
- (define (animate)
- (for-each (lambda (frame)
- (yield frame)
- (wait frame-duration))
- frames))
-
- (if loop?
- (forever (animate))
- (animate)))))