diff options
-rw-r--r-- | engine/shell.scm | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/engine/shell.scm b/engine/shell.scm index 4a9f098..3182483 100644 --- a/engine/shell.scm +++ b/engine/shell.scm @@ -1,5 +1,6 @@ ;;; Lisp Game Jam 2018 ;;; Copyright © 2018 David Thompson <davet@gnu.org> +;;; Copyright © 2018 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 @@ -62,9 +63,7 @@ (projection #:getter projection #:init-form (orthographic-projection 0 (/ %width %scale-factor) - (/ %height %scale-factor) 0 0 1)) - (frame-start-time #:accessor frame-start-time) - (avg-frame-time #:accessor avg-frame-time #:init-value 0.0)) + (/ %height %scale-factor) 0 0 1))) (define (error-string stack key args) (call-with-output-string @@ -106,19 +105,6 @@ Enter a debugger for the current game loop error." (start-repl #:debug (repl-debug shell)) (set! (repl-debugging? shell) #f))) -(define-method (before-draw) - (set! (frame-start-time (root-node)) (sdl-ticks))) - -(define-method (after-draw) - (let ((end (sdl-ticks)) - (start (frame-start-time (root-node))) - (last (avg-frame-time (root-node)))) - (set! (avg-frame-time (root-node)) - (+ (* (- end start) 0.1) (* last 0.9))))) - -(add-hook! before-draw-hook before-draw) -(add-hook! after-draw-hook after-draw) - (define (switch-scene shell new-scene) (detach (current-scene shell)) (set! (current-scene shell) new-scene) |