summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson@vistahigherlearning.com>2019-06-12 09:56:14 -0400
committerDavid Thompson <dthompson@vistahigherlearning.com>2019-06-12 09:56:14 -0400
commitd909f353075aa4c9ee661d356ef2f3c249449c5c (patch)
treeee80b4eb16804bb9fb3a130f59c27718d66bd137
parent810a4a0538eb9e97be2254cf3b6573bc1cb306ba (diff)
Rename update*/render* to update-tree/render-tree.
-rw-r--r--starling/kernel.scm8
-rw-r--r--starling/node-2d.scm8
-rw-r--r--starling/node.scm12
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 <repl> #:name 'repl))))
-(define-method (update* (kernel <kernel>) dt)
+(define-method (update-tree (kernel <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 <kernel>) alpha)
+(define-method (render-tree (kernel <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 <canvas>) alpha)
+(define-method (render-tree (canvas <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 <node-2d>) dt)
+(define-method (update-tree (node <node-2d>) dt)
(vec2-copy! (position node) (last-position node))
(next-method))
-(define-method (render* (node <node-2d>) alpha)
+(define-method (render-tree (node <node-2d>) 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 <node>) dt)
+(define-method (update-tree (node <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 <node>) alpha)
+(define-method (render-tree (node <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 <node>))
"Perform initialization tasks for NODE."