From 41a7313ec93cbf3124ce3d0da0d1a32bf68f5ddc Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Thu, 15 Nov 2018 00:37:00 +0100 Subject: shell: Remove frame time calculations. --- engine/shell.scm | 18 ++---------------- 1 file 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 +;;; Copyright © 2018 Ricardo Wurmus ;;; ;;; 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) -- cgit v1.2.3