summaryrefslogtreecommitdiff
path: root/starling/node-2d.scm
diff options
context:
space:
mode:
Diffstat (limited to 'starling/node-2d.scm')
-rw-r--r--starling/node-2d.scm22
1 files changed, 11 insertions, 11 deletions
diff --git a/starling/node-2d.scm b/starling/node-2d.scm
index d54edf9..576cc3f 100644
--- a/starling/node-2d.scm
+++ b/starling/node-2d.scm
@@ -434,13 +434,13 @@
(define-generic texture)
(define-method (texcoords (sprite <base-sprite>))
- (texture-gl-tex-rect (asset-ref (texture sprite))))
+ (texture-gl-tex-rect (texture sprite)))
(define-method (source-rect (sprite <base-sprite>))
- (texture-gl-rect (asset-ref (texture sprite))))
+ (texture-gl-rect (texture sprite)))
(define-method (render (sprite <base-sprite>) alpha)
- (let* ((tex (asset-ref (texture sprite)))
+ (let* ((tex (texture sprite))
(rect (source-rect sprite))
(batch (batch sprite))
(tint (tint sprite))
@@ -459,7 +459,7 @@
;;;
(define-class <sprite> (<base-sprite>)
- (texture #:getter texture #:init-keyword #:texture)
+ (texture #:getter texture #:init-keyword #:texture #:asset? #t)
(texcoords #:init-keyword #:texcoords #:init-form #f)
(source-rect #:init-keyword #:source-rect #:init-form #f))
@@ -477,11 +477,11 @@
;;;
(define-class <atlas-sprite> (<base-sprite>)
- (atlas #:accessor atlas #:init-keyword #:atlas)
+ (atlas #:accessor atlas #:init-keyword #:atlas #:asset? #t)
(index #:accessor index #:init-keyword #:index))
(define-method (texture (sprite <atlas-sprite>))
- (texture-atlas-ref (asset-ref (atlas sprite)) (index sprite)))
+ (texture-atlas-ref (atlas sprite) (index sprite)))
;;;
@@ -566,7 +566,7 @@
;;;
(define-class <label> (<node-2d>)
- (font #:accessor font #:init-keyword #:font #:init-thunk default-font)
+ (font #:accessor font #:init-keyword #:font #:init-thunk default-font #:asset? #t)
(text #:accessor text #:init-form "" #:init-keyword #:text)
(align #:accessor align #:init-value 'left #:init-keyword #:align)
(vertical-align #:accessor vertical-align #:init-value 'bottom
@@ -581,7 +581,7 @@
(realign label))
(define-method (realign (label <label>))
- (let ((font (asset-ref (font label))))
+ (let ((font (font label)))
(set-vec2! (origin label)
(match (align label)
('left 0.0)
@@ -594,7 +594,7 @@
(dirty! label))
(define-method (render (label <label>) alpha)
- (draw-text* (asset-ref (font label)) (text label) (world-matrix label)))
+ (draw-text* (font label) (text label) (world-matrix label)))
;;;
@@ -602,14 +602,14 @@
;;;
(define-class <tile-map> (<node-2d>)
- (tile-map #:accessor tile-map #:init-keyword #:map)
+ (tile-map #:accessor tile-map #:init-keyword #:map #:asset? #t)
(layers #:accessor layers #:init-keyword #:layers #:init-form #f))
(define-method (initialize (node <tile-map>) initargs)
(next-method))
(define-method (render (node <tile-map>) alpha)
- (let ((m (asset-ref (tile-map node))))
+ (let ((m (tile-map node)))
(draw-tile-map* m (world-matrix node) (tile-map-rect m)
#:layers (layers node))))