summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2014-08-28 18:01:21 -0400
committerDavid Thompson <dthompson2@worcester.edu>2014-08-28 18:01:21 -0400
commitb9fa6f8c326dc5cfa2ba3ac3a15f98e6670ddf25 (patch)
tree18b00e17aca43dee273222665292fb3b08676cfd
parentab11771243296039bc4b3f96614446689677087b (diff)
transition: Rewrite in terms of signal-generator.
* sly/transition.scm (transition): Use signal-generator.
-rw-r--r--sly/transition.scm19
1 files changed, 9 insertions, 10 deletions
diff --git a/sly/transition.scm b/sly/transition.scm
index f813828..ae18e84 100644
--- a/sly/transition.scm
+++ b/sly/transition.scm
@@ -152,13 +152,12 @@ transition."
(define (value-at t)
(interpolator start end (ease t duration)))
- (let ((signal (make-signal start)))
- (coroutine
- (let lp ((t 0))
- (if (< t duration)
- (begin
- (wait (min step (- duration t)))
- (signal-set! signal (value-at t))
- (lp (+ t step)))
- (signal-set! signal end))))
- signal)))
+ (signal-generator
+ (let lp ((t 0))
+ (yield start)
+ (if (< t duration)
+ (begin
+ (wait (min step (- duration t)))
+ (yield (value-at t))
+ (lp (+ t step)))
+ (yield end))))))