Render queues and some test fixes

This commit is contained in:
BirDt_ 2026-04-02 14:16:25 +08:00
parent 12754b61a3
commit 213dfc67b6
4 changed files with 94 additions and 24 deletions

View file

@ -49,34 +49,34 @@
;; Type safe color constructor
(define (make-color r g b a)
(assert (and (number r) (<= 0 r 1)))
(assert (and (number g) (<= 0 g 1)))
(assert (and (number b) (<= 0 b 1)))
(assert (and (number a) (<= 0 a 1)))
(assert (and (number? r) (<= 0 r 1)))
(assert (and (number? g) (<= 0 g 1)))
(assert (and (number? b) (<= 0 b 1)))
(assert (and (number? a) (<= 0 a 1)))
(int:make-color r g b a))
;; Type safe color setter
(define (set-color-r! color r)
(assert (color? color))
(assert (and (number r) (<= 0 r 1)))
(assert (and (number? r) (<= 0 r 1)))
(int:set-color-r! color r))
;; Type safe color setter
(define (set-color-g! color g)
(assert (color? color))
(assert (and (number g) (<= 0 g 1)))
(assert (and (number? g) (<= 0 g 1)))
(int:set-color-g! color g))
;; Type safe color setter
(define (set-color-b! color b)
(assert (color? color))
(assert (and (number b) (<= 0 b 1)))
(assert (and (number? b) (<= 0 b 1)))
(int:set-color-b! color b))
;; Type safe color setter
(define (set-color-a! color a)
(assert (color? color))
(assert (and (number a) (<= 0 a 1)))
(assert (and (number? a) (<= 0 a 1)))
(int:set-color-a! color a))
;; Screen transform record and exports
@ -98,7 +98,7 @@
(define (make-screen-transform position rotation scale anchor parent)
(assert (vector2? position))
(assert (real? rotation))
(assert (Vector2? scale))
(assert (vector2? scale))
(assert (and (symbol? anchor) (member anchor '(top-left top-middle top-right
center-left center center-right
bottom-left bottom-middle bottom-right))))
@ -118,8 +118,8 @@
(define (set-position! component position)
(assert (record? component))
(cond
((screen-transform? component) (assert (vector2? positon))))
((rtd-mutator (record-rtd component) 'positon) component position))
((screen-transform? component) (assert (vector2? position))))
((rtd-mutator (record-rtd component) 'position) component position))
(define (pivot component)
(assert (record? component))