jak-project/goal_src/engine/gfx/wind-h.gc
water111 5b24e43143
Change syntax for boxed array to support different length and allocated-length (#568)
* change syntax for boxed array

* fix test and make the flava thing kind of work
2021-06-07 20:22:06 -04:00

53 lines
1.5 KiB
Common Lisp

;;-*-Lisp-*-
(in-package goal)
;; name: wind-h.gc
;; name in dgo: wind-h
;; dgos: GAME, ENGINE
(deftype wind-vector (structure)
((wind-pos vector2w :inline :offset-assert 0)
(wind-vel vector2w :inline :offset-assert 8)
)
:method-count-assert 9
:size-assert #x10
:flag-assert #x900000010
)
(define *wind-scales* (new 'static 'boxed-array :type uint8 :length 32
#x2 #x5 #x2 #x3
#x2 #x2 #x3 #x10
#xa #x2 #x4 #x2
#x8 #x2 #x2 #x10
#x2 #x2 #x8 #x2
#x10 #x2 #x4 #x10
#xa #x2 #x4 #x2
#x8 #x2 #x2 #x10
)
)
(deftype wind-work (basic)
((wind-array vector 64 :inline :offset-assert 16)
(wind-normal vector :inline :offset-assert 1040)
(wind-temp vector :inline :offset-assert 1056)
(wind-force float 64 :offset-assert 1072)
(wind-time uint32 :offset-assert 1328)
)
:method-count-assert 9
:size-assert #x534
:flag-assert #x900000534
)
; This was likely originally defined inside `wind-h`
; but the decompiler won't output it, so we have to manually define it
(define-extern *wind-work* wind-work)
(defun wind-get-hashed-index ((arg0 vector))
(logand (+ (the int (-> arg0 data 0))
(the int (-> arg0 data 2))
(the-as int (-> *wind-work* wind-time))
)
#x3f
)
)