summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--starling/node-2d.scm23
1 files changed, 5 insertions, 18 deletions
diff --git a/starling/node-2d.scm b/starling/node-2d.scm
index d0be0a2..c0cb243 100644
--- a/starling/node-2d.scm
+++ b/starling/node-2d.scm
@@ -157,28 +157,15 @@
(define-class <view-2d> ()
(camera #:accessor camera #:init-keyword #:camera)
- (area #:getter area #:init-keyword #:area)
- (viewport #:accessor viewport))
-
-(define-method (initialize (view <view-2d>) initargs)
- (define (to-int x)
- (inexact->exact (round x)))
- (next-method)
- (let ((r (area view)))
- (set! (viewport view)
- (make-viewport (to-int (rect-x r))
- (to-int (rect-y r))
- (to-int (rect-width r))
- (to-int (rect-height r))))))
+ (area #:getter area #:init-keyword #:area))
(define %identity-matrix (make-identity-matrix4))
(define-method (render (view <view-2d>))
- (with-viewport (viewport view)
- (with-projection (projection-matrix (camera view))
- (draw-sprite* (framebuffer-texture (framebuffer (camera view)))
- (area view)
- %identity-matrix))))
+ (with-projection (projection-matrix (camera view))
+ (draw-sprite* (framebuffer-texture (framebuffer (camera view)))
+ (area view)
+ %identity-matrix)))
;;;