summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--chickadee/game-loop.scm14
1 files changed, 7 insertions, 7 deletions
diff --git a/chickadee/game-loop.scm b/chickadee/game-loop.scm
index 6a14fab..1d0c679 100644
--- a/chickadee/game-loop.scm
+++ b/chickadee/game-loop.scm
@@ -72,7 +72,7 @@
;; the game on a fixed timestep like this yields a
;; stable simulation.
(let loop ((previous-time (time))
- (buffer 0))
+ (buffer 0.0))
(let* ((current-time (time))
(delta (- current-time previous-time)))
(let update-loop ((buffer (+ buffer delta)))
@@ -82,17 +82,17 @@
;; order to discard the undefined amount of time
;; that was spent handling the error.
(if (with-error-handling error (update timestep))
- (loop (time) 0)
- (begin
- (usleep 1)
- (update-loop (- buffer timestep))))
+ (loop (time) 0.0)
+ (update-loop (- buffer timestep)))
(begin
;; We render upon every iteration of the loop, and
;; thus rendering is decoupled from updating.
;; It's possible to render multiple times before
;; an update is performed.
- (if (with-error-handling error (render (/ buffer timestep)))
- (loop (time) 0)
+ (if (with-error-handling error
+ (render (/ buffer timestep))
+ (usleep 1))
+ (loop (time) 0.0)
(loop current-time buffer))))))))
(lambda (cont callback)
#f))))