jak-project/goal_src/jak2/engine/gfx/mood/mood-h.gc
Tyler Wilding dd0a8a17b2
docs - first chunk of work documenting the files I glossed over (#2130)
- started documenting the files I glossed over, some are totally done,
others are just partially done
- I changed the decompiler to automatically initialize the
art-group-info from the json file. This makes updating gsrc, even a
single file at a time, have consistent naming
- Though I disabled this functionality for jak 1, as I have no idea if
using the ntsc art groups will cause a regression for different versions
- fix indentation for docstrings -- it still doesn't look great, but
this is now a formatting concern, rather than the docstring having a
bunch of happen-stance leading whitespace.
2023-01-15 11:33:39 -05:00

274 lines
8.6 KiB
Common Lisp

;;-*-Lisp-*-
(in-package goal)
;; name: mood-h.gc
;; name in dgo: mood-h
;; dgos: ENGINE, GAME
;; todo docs and method names.
(declare-type sky-color-day structure)
;; DECOMP BEGINS
(deftype mood-channel (structure)
((data float 24 :offset-assert 0)
(vecs vector4 6 :inline :offset 0)
)
:method-count-assert 9
:size-assert #x60
:flag-assert #x900000060
)
(deftype mood-channel-group (structure)
((data mood-channel 4 :inline :offset-assert 0)
)
:method-count-assert 9
:size-assert #x180
:flag-assert #x900000180
)
(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)
(data-raw uint128 24 :offset 0)
)
:method-count-assert 9
:size-assert #x180
:flag-assert #x900000180
)
(deftype mood-color (structure)
((lgt-color vector :inline :offset-assert 0)
(amb-color vector :inline :offset-assert 16)
)
:method-count-assert 9
:size-assert #x20
:flag-assert #x900000020
)
(deftype mood-direction-table (structure)
((data vector 4 :inline :offset-assert 0)
)
:method-count-assert 9
:size-assert #x40
:flag-assert #x900000040
)
(deftype mood-color-table (structure)
((data mood-color 8 :inline :offset-assert 0)
(data-raw uint128 16 :offset 0)
)
:method-count-assert 9
:size-assert #x100
:flag-assert #x900000100
)
(deftype mood-sky-table (structure)
((data vector 8 :inline :offset-assert 0)
)
:method-count-assert 9
:size-assert #x80
:flag-assert #x900000080
)
(deftype mood-clouds (structure)
((cloud-min float :offset-assert 0)
(cloud-max float :offset-assert 4)
)
:method-count-assert 9
:size-assert #x8
:flag-assert #x900000008
)
(deftype mood-weather (structure)
((data float 2 :offset-assert 0)
(cloud float :offset 0)
(fog float :offset 4)
)
:pack-me
:allow-misaligned
:method-count-assert 9
:size-assert #x8
:flag-assert #x900000008
)
(deftype mood-iweather (structure)
((data int32 2 :offset-assert 0)
(cloud int32 :offset 0)
(fog int32 :offset 4)
)
:allow-misaligned
:method-count-assert 9
:size-assert #x8
:flag-assert #x900000008
)
(deftype mood-range (structure)
((data float 4 :offset-assert 0)
(min-cloud float :offset 0)
(max-cloud float :offset 4)
(min-fog float :offset 8)
(max-fog float :offset 12)
(quad uint128 :offset 0)
)
:method-count-assert 9
:size-assert #x10
:flag-assert #x900000010
)
(deftype mood-filters-table (structure)
((data vector 8 :inline :offset-assert 0)
)
:method-count-assert 9
:size-assert #x80
:flag-assert #x900000080
)
(deftype mood-table (basic)
((mood-fog-table mood-fog-table :offset-assert 4)
(mood-color-table mood-color-table :offset-assert 8)
(mood-channel-group mood-channel-group :offset-assert 12)
(mood-direction-table mood-direction-table :offset-assert 16)
(mood-sky-table mood-sky-table :offset-assert 20)
(mood-interp-table sky-color-day :offset-assert 24)
)
:method-count-assert 9
:size-assert #x1c
:flag-assert #x90000001c
)
(deftype mood-context-core (structure)
((current-fog mood-fog :inline :offset-assert 0)
(current-sky-color vector :inline :offset-assert 48)
(current-env-color vector :inline :offset-assert 64)
(current-prt-color vector :inline :offset-assert 80)
(current-shadow-color vector :inline :offset-assert 96)
)
:method-count-assert 9
:size-assert #x70
:flag-assert #x900000070
)
(deftype mood-context-core2 (mood-context-core)
((light-group light-group 8 :inline :offset-assert 112)
)
:method-count-assert 9
:size-assert #x670
:flag-assert #x900000670
)
(deftype mood-context-core3 (mood-context-core2)
((times vector 8 :inline :offset-assert 1648)
)
:method-count-assert 9
:size-assert #x6f0
:flag-assert #x9000006f0
)
(deftype mood-context (mood-context-core3)
"`state` holds an arbitrary state structure, ie `[[sewer-states]]` and is used
when updating the mood. This means that an individual state structure must be less than 128 bytes"
((itimes vector4w 4 :inline :offset-assert 1776)
(state uint32 32 :offset-assert 1840)
(data uint128 123 :offset 0)
)
:method-count-assert 9
:size-assert #x7b0
:flag-assert #x9000007b0
)
(deftype mood-control-work (structure)
((weather mood-weather :inline :offset-assert 0)
(iweather mood-iweather :inline :offset-assert 8)
(interp mood-weather :inline :offset-assert 16)
(index int32 4 :offset-assert 24)
(color-interp float :offset-assert 40)
(color-index int32 2 :offset-assert 44)
(channel-interp float :offset-assert 52)
(channel-index int32 2 :offset-assert 56)
(cloud-interp float :offset-assert 64)
(cloud-index int32 2 :offset-assert 68)
)
:method-count-assert 9
:size-assert #x4c
:flag-assert #x90000004c
)
(deftype mood-control (mood-table)
((mood-clouds mood-clouds :offset-assert 28)
(current-interp mood-weather :inline :offset-assert 32)
(target-interp mood-weather :inline :offset-assert 40)
(speed-interp mood-weather :inline :offset-assert 48)
(range mood-range :inline :offset-assert 64)
(time-until-random mood-weather :inline :offset-assert 80)
(time-until-random-min mood-weather :inline :offset-assert 88)
(time-until-random-max mood-weather :inline :offset-assert 96)
(display-flag symbol :offset-assert 104)
(overide-weather-flag symbol :offset-assert 108)
(overide mood-weather :inline :offset-assert 112)
(lightning-index int32 :offset-assert 120)
(lightning-val int32 :offset-assert 124)
(lightning-time int32 :offset-assert 128)
(lightning-time2 float :offset-assert 132)
(lightning-flash float :offset-assert 136)
(lightning-id sound-id :offset-assert 140)
(lightning-count0 uint32 :offset-assert 144)
(lightning-count1 uint32 :offset-assert 148)
(lightning-count2 uint32 :offset-assert 152)
(rain-id uint32 :offset-assert 156)
(sound-pitch float :offset-assert 160)
(fogs mood-fog-table 9 :offset-assert 164)
(colors mood-color-table 3 :offset-assert 200)
(channels mood-channel-group 3 :offset-assert 212)
(clouds mood-clouds 9 :offset-assert 224)
)
:method-count-assert 19
:size-assert #x104
:flag-assert #x1300000104
(:methods
(init-weather! (_type_) none :behavior process 9)
(update-mood-weather! (_type_ float float float float) none 10)
(update-mood-range! (_type_ float float float float) none 11)
(set-time-for-random-weather! (_type_ float float) none 12)
(apply-mood-clouds-and-fog (_type_ mood-control-work) none 13)
(apply-mood-color (_type_ mood-control-work) none 14)
(apply-mood-channels (_type_ mood-control-work) none 15)
(adjust-num-clouds! (_type_ mood-control-work) none 16)
(gen-lightning-and-thunder! (_type_) number 17)
(play-or-stop-lightning! (_type_ sound-spec vector) sound-id 18)
)
)