jak-project/goal_src/engine/anim/aligner-h.gc
water111 e251f8b2d9
Support Behaviors (#678)
* temp

* working, but type pass got really slow

* clean up

* changelog and flip order

* clean up and add tests

* fix zero size array

* handle lambdas correctly

* another windows fix
2021-07-04 16:54:07 -04:00

48 lines
1.4 KiB
Common Lisp

;;-*-Lisp-*-
(in-package goal)
;; name: aligner-h.gc
;; name in dgo: aligner-h
;; dgos: GAME, ENGINE
(deftype align-control (basic)
((flags uint32 :offset-assert 4)
(process process :offset-assert 8)
(frame-group basic :offset-assert 12)
(frame-num float :offset-assert 16)
(matrix matrix 2 :inline :offset-assert 32)
(transform transform 2 :inline :offset-assert 160)
(delta transformq :inline :offset-assert 256)
(last-speed float :offset-assert 304) ;; meters
(align transformq :inline :offset 160)
)
:method-count-assert 14
:size-assert #x134
:flag-assert #xe00000134
(:methods
(new (symbol type process) _type_ :behavior process-drawable 0)
(dummy-9 () none 9)
(dummy-10 () none 10)
(dummy-11 () none 11)
(dummy-12 () none 12)
(dummy-13 () none 13)
)
)
(defmethod new align-control ((allocation symbol) (type-to-make type) (proc process))
(let ((obj (object-new allocation type-to-make (the-as int (-> type-to-make size)))))
(when (zero? obj)
(go process-drawable-art-error "memory")
(return (the align-control 0))
)
(set! (-> obj process) proc)
obj
)
)