diff options
-rw-r--r-- | engine/shell.scm | 35 |
1 files changed, 1 insertions, 34 deletions
diff --git a/engine/shell.scm b/engine/shell.scm index ae808b0..4a9f098 100644 --- a/engine/shell.scm +++ b/engine/shell.scm @@ -21,7 +21,6 @@ #:use-module (chickadee math rect) #:use-module (chickadee math vector) #:use-module (chickadee render) - #:use-module (chickadee render font) #:use-module (chickadee render framebuffer) #:use-module (chickadee render sprite) #:use-module (chickadee scripting) @@ -41,22 +40,11 @@ current-scene switch-scene)) -(define-asset shell-font - (load-tile-font "assets/fonts/bubblemad_8x8.png" 8 8 - " !\"©_%❤'()*+,-./0123456789:←<=>?@abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ")) - (define %scale-factor 2) (define %height (* %scale-factor 240)) (define %width (* %scale-factor 320)) (define-class <shell> (<node>) - (debug? #:allocation #:virtual - #:accessor debug? - #:slot-ref (lambda (shell) - (visible? (child-ref shell 'debug-overlay))) - #:slot-set! (lambda (shell show?) - (set! (visible? (child-ref shell 'debug-overlay)) - show?))) (repl #:accessor repl #:init-form #f) (repl-debug #:accessor repl-debug #:init-form #f) (repl-debugging? #:accessor repl-debugging? #:init-form #f) @@ -136,32 +124,11 @@ Enter a debugger for the current game loop error." (set! (current-scene shell) new-scene) (attach shell new-scene)) -(define-method (fps (shell <shell>)) - (exact->inexact (/ 1000 (avg-frame-time shell)))) - -(define-method (populate (shell <shell>)) - (list - (make <node-2d> - #:name 'debug-overlay - #:visible? #f - #:children - (list - (make <label> - #:name 'fps-label - #:font shell-font - #:text "0.0" - #:position (vec2 0.0 232.0)))))) - (define-method (on-start (shell <shell>)) (set! (repl shell) (spawn-coop-repl-server))) (define-method (on-enter (shell <shell>)) - (attach shell (current-scene shell)) - (script - (forever - (sleep 60) - (set! (text (child-ref shell '(debug-overlay fps-label))) - (format #f "~1,2f" (fps shell)))))) + (attach shell (current-scene shell))) (define (reset-game) (switch-scene (root-node) ((reset-thunk (root-node))))) |