summaryrefslogtreecommitdiff
path: root/sly/live-reload.scm
diff options
context:
space:
mode:
Diffstat (limited to 'sly/live-reload.scm')
-rw-r--r--sly/live-reload.scm7
1 files changed, 4 insertions, 3 deletions
diff --git a/sly/live-reload.scm b/sly/live-reload.scm
index bb828e8..55e89d7 100644
--- a/sly/live-reload.scm
+++ b/sly/live-reload.scm
@@ -43,14 +43,15 @@ polled for changes, defaulting to two seconds."
(and (every file-exists? files)
(reduce max 0 (map current-mtime files))))
- (let ((asset (make-signal (thunk))))
+ (let ((asset (make-signal #f)))
(coroutine
+ ;; Wait for the game to start.
+ (while (not (signal-ref game-started?)) (wait 1))
+ (signal-set! asset (thunk)) ; initialize!
(let loop ((last-mtime (max-current-mtime)))
(wait polling-interval)
(let ((mtime (max-current-mtime)))
(when (cond
- ;; Game hasn't started yet.
- ((not (signal-ref game-started?)) #f)
;; Some files do not exist anymore, can't reload.
((not mtime) #f)
;; Some files were missing, but are back now.