Files
jak-project/goal_src/engine/gfx/wind-h.gc
T
water111 be74613332 cleanup and bug fix (#1161)
* cleanup and bug fix

* crashing

* fix crash bug

* fix tests
2022-02-13 13:03:30 -05:00

55 lines
1.6 KiB
Common Lisp

;;-*-Lisp-*-
(in-package goal)
;; name: wind-h.gc
;; name in dgo: wind-h
;; dgos: GAME, ENGINE
;; These "wind" types are used in the tie/shrub renderers.
(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
)
)