Files
jak-project/goal_src/engine/target/pat-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

123 lines
2.8 KiB
Common Lisp

;;-*-Lisp-*-
(in-package goal)
;; name: pat-h.gc
;; name in dgo: pat-h
;; dgos: GAME, ENGINE
;; The "pat" system is used to store some data per triangle in collision meshes.
;; It packs all data into a 32-bit pat-surface type.
(defenum pat-material
:type uint8
(stone)
(ice)
(quicksand)
(waterbottom)
(tar)
(sand)
(wood)
(grass)
(pcmetal)
(snow)
(deepsnow)
(hotcoals)
(lava)
(crwood)
(gravel)
(dirt)
(metal)
(straw)
(tube)
(swamp)
(stopproj)
(rotate)
(neutral)
)
(defenum pat-mode
:type uint8
(ground)
(wall)
(obstacle)
)
(defenum pat-event
:type uint8
(none)
(deadly)
(endlessfall)
(burn)
(deadlyup)
(burnup)
(melt)
)
(deftype pat-surface (uint32)
((skip uint8 :offset 0 :size 3)
(mode pat-mode :offset 3 :size 3)
(material pat-material :offset 6 :size 6)
(camera uint8 :offset 12 :size 2)
(event pat-event :offset 14 :size 6)
(noentity uint8 :offset 0 :size 1)
(nocamera uint8 :offset 1 :size 1)
(noedge uint8 :offset 2 :size 1)
(nolineofsight uint8 :offset 12 :size 1)
(unknown-bit uint8 :offset 15 :size 1)
)
:method-count-assert 9
:size-assert #x4
:flag-assert #x900000004
)
(defun-debug pat-material->string ((pat pat-surface))
(enum->string pat-material (-> pat material))
)
(defun-debug pat-mode->string ((pat pat-surface))
(enum->string pat-mode (-> pat mode))
)
(defun-debug pat-event->string ((pat pat-surface))
(enum->string pat-event (-> pat event))
)
(deftype pat-mode-info (structure)
((name string :offset-assert 0)
(wall-angle float :offset-assert 4)
(color rgba :offset-assert 8)
(hilite-color rgba :offset-assert 12)
)
:method-count-assert 9
:size-assert #x10
:flag-assert #x900000010
)
(define *pat-mode-info* (new 'static 'inline-array pat-mode-info 4
(new 'static 'pat-mode-info
:name "ground"
:wall-angle 0.2
:color (new 'static 'rgba :r #x7f :a #x40)
:hilite-color (new 'static 'rgba :r #xff :a #x80)
)
(new 'static 'pat-mode-info
:name "wall"
:wall-angle 2.0
:color (new 'static 'rgba :b #x7f :a #x40)
:hilite-color (new 'static 'rgba :b #xff :a #x80)
)
(new 'static 'pat-mode-info
:name "obstacle"
:wall-angle 0.82
:color (new 'static 'rgba :r #x7f :b #x7f :a #x40)
:hilite-color (new 'static 'rgba :r #xff :b #xff :a #x80)
)
(new 'static 'pat-mode-info
:name "pole"
:wall-angle 2.0
:color (new 'static 'rgba :r #x7f :g #x7f :a #x40)
:hilite-color (new 'static 'rgba :r #xff :g #xff :a #x80)
)
)
)