mirror of
https://github.com/open-goal/jak-project.git
synced 2024-10-20 21:27:52 -04:00
d400ec3b2d
* decomp: Almost finished `mood`, but confused over the `mood-context` type! * only function that remains involves vftoi / ppach instructions * stash * decomp: fix inline array access issue * decomp: finalize `mood` * linting
109 lines
3.7 KiB
Common Lisp
109 lines
3.7 KiB
Common Lisp
;;-*-Lisp-*-
|
|
(in-package goal)
|
|
|
|
;; name: mood-h.gc
|
|
;; name in dgo: mood-h
|
|
;; dgos: GAME, ENGINE
|
|
|
|
(deftype mood-fog (structure)
|
|
((fog-color vector :inline :offset-assert 0)
|
|
(fog-dists vector :inline :offset-assert 16)
|
|
(fog-start meters :offset 16)
|
|
(fog-end meters :offset 20)
|
|
(fog-max float :offset 24)
|
|
(fog-min float :offset 28)
|
|
(erase-color vector :inline :offset-assert 32)
|
|
)
|
|
:method-count-assert 9
|
|
:size-assert #x30
|
|
:flag-assert #x900000030
|
|
)
|
|
|
|
(deftype mood-fog-table (structure)
|
|
((data mood-fog 8 :inline :offset-assert 0)
|
|
)
|
|
:method-count-assert 9
|
|
:size-assert #x180
|
|
:flag-assert #x900000180
|
|
)
|
|
|
|
(deftype mood-lights (structure)
|
|
((direction vector :inline :offset-assert 0)
|
|
(lgt-color vector :inline :offset-assert 16)
|
|
(prt-color vector :inline :offset-assert 32)
|
|
(amb-color vector :inline :offset-assert 48)
|
|
(shadow vector :inline :offset-assert 64)
|
|
)
|
|
:method-count-assert 9
|
|
:size-assert #x50
|
|
:flag-assert #x900000050
|
|
)
|
|
|
|
(deftype mood-lights-table (structure)
|
|
((data mood-lights 8 :inline :offset-assert 0)
|
|
)
|
|
:method-count-assert 9
|
|
:size-assert #x280
|
|
:flag-assert #x900000280
|
|
)
|
|
|
|
(deftype mood-sun (structure)
|
|
((sun-color vector :inline :offset-assert 0)
|
|
(env-color vector :inline :offset-assert 16)
|
|
)
|
|
:method-count-assert 9
|
|
:size-assert #x20
|
|
:flag-assert #x900000020
|
|
)
|
|
|
|
(deftype mood-sun-table (structure)
|
|
((data mood-sun 8 :inline :offset-assert 0)
|
|
)
|
|
:method-count-assert 9
|
|
:size-assert #x100
|
|
:flag-assert #x900000100
|
|
)
|
|
|
|
(deftype mood-context (basic)
|
|
((mood-fog-table mood-fog-table :offset-assert 4)
|
|
(mood-lights-table mood-lights-table :offset-assert 8)
|
|
(mood-sun-table mood-sun-table :offset-assert 12)
|
|
(fog-interp sky-color-day :offset-assert 16)
|
|
(palette-interp sky-color-day :offset-assert 20)
|
|
(sky-texture-interp sky-color-day :offset-assert 24)
|
|
(current-fog mood-fog :inline :offset-assert 32)
|
|
(current-sun mood-sun :inline :offset-assert 80)
|
|
(current-prt-color vector :inline :offset-assert 112)
|
|
(current-shadow vector :inline :offset-assert 128)
|
|
(current-shadow-color vector :inline :offset-assert 144)
|
|
(light-group light-group 8 :inline :offset-assert 160)
|
|
(times vector 8 :inline :offset-assert 1696)
|
|
(sky-times float 8 :offset-assert 1824)
|
|
(itimes vector4w 4 :inline :offset-assert 1856)
|
|
(state uint8 16 :offset-assert 1920)
|
|
(num-stars float :offset-assert 1936)
|
|
(some-byte uint8 :offset 1939)
|
|
)
|
|
(:methods
|
|
(new (symbol type) _type_ 0)
|
|
)
|
|
:method-count-assert 9
|
|
:size-assert #x794
|
|
:flag-assert #x900000794
|
|
)
|
|
|
|
|
|
(defmethod new mood-context ((allocation symbol) (type-to-make type))
|
|
(let ((v0-0 (object-new allocation type-to-make (the-as int (-> type-to-make size)))))
|
|
(set-vector! (-> v0-0 times 0) 1.0 1.0 1.0 0.0)
|
|
(set-vector! (-> v0-0 times 1) 1.0 1.0 1.0 0.0)
|
|
(set-vector! (-> v0-0 times 2) 1.0 1.0 1.0 0.0)
|
|
(set-vector! (-> v0-0 times 3) 1.0 1.0 1.0 0.0)
|
|
(set-vector! (-> v0-0 times 4) 1.0 1.0 1.0 0.0)
|
|
(set-vector! (-> v0-0 times 5) 1.0 1.0 1.0 0.0)
|
|
(set-vector! (-> v0-0 times 6) 1.0 1.0 1.0 0.0)
|
|
(set-vector! (-> v0-0 times 7) 1.0 1.0 1.0 0.0)
|
|
v0-0
|
|
)
|
|
)
|