summaryrefslogtreecommitdiff
path: root/engine
diff options
context:
space:
mode:
authorRicardo Wurmus <rekado@elephly.net>2018-07-25 15:21:17 +0200
committerRicardo Wurmus <rekado@elephly.net>2018-07-27 17:15:48 +0200
commitdaec916bb542f282cbcd43c3cf9eb1444e6b1236 (patch)
tree341f6c1c09c22f7d112eba925a4b7e90b8275955 /engine
parent4e50fbe48ab53c8e42131593ad876931cd6eb722 (diff)
engine: Remove debug/fps stuff from shell.
Diffstat (limited to 'engine')
-rw-r--r--engine/shell.scm35
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)))))