From d909f353075aa4c9ee661d356ef2f3c249449c5c Mon Sep 17 00:00:00 2001 From: David Thompson Date: Wed, 12 Jun 2019 09:56:14 -0400 Subject: Rename update*/render* to update-tree/render-tree. --- starling/kernel.scm | 8 ++++---- starling/node-2d.scm | 8 ++++---- starling/node.scm | 12 ++++++------ 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/starling/kernel.scm b/starling/kernel.scm index 25fb8a0..2325cdc 100644 --- a/starling/kernel.scm +++ b/starling/kernel.scm @@ -113,7 +113,7 @@ ;; Start REPL server. (attach-to kernel (make #:name 'repl)))) -(define-method (update* (kernel ) dt) +(define-method (update-tree (kernel ) dt) (define (invert-y y) ;; SDL's origin is the top-left, but our origin is the bottom ;; left so we need to invert Y coordinates that SDL gives us. @@ -208,7 +208,7 @@ ;; Free any GPU resources that have been GC'd. (gpu-reap!)) -(define-method (render* (kernel ) alpha) +(define-method (render-tree (kernel ) alpha) (let ((start-time (elapsed-time))) ;; Switch to the null viewport to ensure that ;; the default viewport will be re-applied and @@ -273,8 +273,8 @@ (parameterize ((current-kernel kernel)) (activate kernel) (push-scene kernel (thunk)) - (run-game* #:update (lambda (dt) (update* kernel dt)) - #:render (lambda (alpha) (render* kernel alpha)) + (run-game* #:update (lambda (dt) (update-tree kernel dt)) + #:render (lambda (alpha) (render-tree kernel alpha)) #:error (lambda (stack key args) (on-error kernel stack key args)) #:time elapsed-time diff --git a/starling/node-2d.scm b/starling/node-2d.scm index cc0c85c..b9d5e2b 100644 --- a/starling/node-2d.scm +++ b/starling/node-2d.scm @@ -237,12 +237,12 @@ (update (camera view) dt)) (views canvas))) -(define-method (render* (canvas ) alpha) +(define-method (render-tree (canvas ) alpha) ;; Draw scene from the viewpoint of each camera. (for-each (lambda (view) (with-camera (camera view) (for-each (lambda (child) - (render* child alpha)) + (render-tree child alpha)) (children canvas)))) (views canvas)) (render canvas alpha)) @@ -414,11 +414,11 @@ ;; Events -(define-method (update* (node ) dt) +(define-method (update-tree (node ) dt) (vec2-copy! (position node) (last-position node)) (next-method)) -(define-method (render* (node ) alpha) +(define-method (render-tree (node ) alpha) (when (visible? node) ;; Compute the linearly interpolated rendering position, in the case ;; that node has moved since the last update. diff --git a/starling/node.scm b/starling/node.scm index 73125da..d3dc129 100644 --- a/starling/node.scm +++ b/starling/node.scm @@ -41,9 +41,9 @@ show hide update - update* + update-tree render - render* + render-tree child-ref & attach-to @@ -89,11 +89,11 @@ "Advance simulation of NODE by the time delta DT." #t) -(define-method (update* (node ) dt) +(define-method (update-tree (node ) dt) "Update NODE and all of its children. DT is the amount of time passed since the last update, in milliseconds." ;; Update children first, recursively. - (for-each-child (lambda (child) (update* child dt)) node) + (for-each-child (lambda (child) (update-tree child dt)) node) ;; Update script, then "physics" (or whatever the update method is ;; doing). (with-agenda (agenda node) @@ -105,13 +105,13 @@ passed since the last update, in milliseconds." the next update represented as a ratio in the range [0, 1]." #t) -(define-method (render* (node ) alpha) +(define-method (render-tree (node ) alpha) "Render NODE and all of its children, recursively. ALPHA is the distance between the previous update and the next update represented as a ratio in the range [0, 1]." (when (visible? node) (render node alpha) - (for-each-child (lambda (child) (render* child alpha)) node))) + (for-each-child (lambda (child) (render-tree child alpha)) node))) (define-method (on-boot (node )) "Perform initialization tasks for NODE." -- cgit v1.2.3