Files
jak-project/test/decompiler/reference/jak3/levels/temple/templex-mood_REF.gc
T
water111 7348e6a4ff [decompiler] Update vector ops, reduce casts (#3849)
Update the decompiler to use the new vf macros.

Also, fix a bunch of silly casting issues where accessing inline fields
with an offset of 0 would be better than a cast:

![image](https://github.com/user-attachments/assets/885bbb07-634f-47b8-99f5-5a947941cdde)

---------

Co-authored-by: water111 <awaterford1111445@gmail.com>
2025-01-20 16:32:58 -05:00

84 lines
2.9 KiB
Common Lisp
Vendored
Generated

;;-*-Lisp-*-
(in-package goal)
;; definition of type templex-states
(deftype templex-states (structure)
((light light-state :inline)
(flame flames-state :inline)
)
)
;; definition for method 3 of type templex-states
(defmethod inspect ((this templex-states))
(when (not this)
(set! this this)
(goto cfg-4)
)
(format #t "[~8x] ~A~%" this 'templex-states)
(format #t "~1Tlight: #<light-state @ #x~X>~%" (-> this light))
(format #t "~1Tflame: #<flames-state @ #x~X>~%" (-> this flame))
(label cfg-4)
this
)
;; definition for function update-templex-lights
;; INFO: Used lq/sq
;; WARN: Return type mismatch float vs none.
(defun update-templex-lights ((arg0 mood-context))
(let ((v1-0 (-> arg0 current-fog)))
(set-vector! (-> v1-0 fog-color) 0.0 44.7999 57.5999 1.0)
(set-vector! (-> v1-0 fog-dists) 131072.0 1843200.0 255.0 128.0)
(set-vector! (-> v1-0 erase-color) 0.0 0.0 0.0 128.0)
)
(let ((s5-0 (-> arg0 light-group 1)))
(mem-copy! (the-as pointer s5-0) (the-as pointer (-> *level* level-default mood-context light-group)) 192)
(set! (-> s5-0 ambi extra x) 0.8)
)
(let ((s5-1 (-> arg0 light-group 2)))
(let ((s4-0 (new 'static 'vector :x 1.0 :y 0.65 :z 0.4 :w 1.0)))
(mem-copy! (the-as pointer s5-1) (the-as pointer (-> *level* level-default mood-context light-group)) 192)
(vector*! (the-as vector (-> s5-1 dir0 color)) (the-as vector (-> s5-1 dir0 color)) s4-0)
(vector*! (the-as vector (-> s5-1 dir1 color)) (the-as vector (-> s5-1 dir1 color)) s4-0)
)
(set! (-> s5-1 ambi extra x) 0.8)
)
(let ((v1-10 (-> arg0 light-group 3)))
(vector-float*! (the-as vector (-> v1-10 ambi color)) (-> arg0 times 0) 0.55)
(vector+!
(the-as vector (-> v1-10 ambi color))
(the-as vector (-> v1-10 ambi color))
(new 'static 'vector :x 0.4253 :y 0.39 :z 0.45 :w 1.0)
)
(set! (-> v1-10 dir0 color quad) (-> arg0 times 0 quad))
(let ((a0-13 (-> v1-10 dir0)))
(set! (-> a0-13 direction x) 0.0)
(set! (-> a0-13 direction y) 1.0)
(set! (-> a0-13 direction z) 0.0)
(set! (-> a0-13 direction w) 0.0)
)
(set! (-> v1-10 ambi extra x) 0.8)
(set! (-> v1-10 dir0 extra x) 0.8)
(set! (-> v1-10 dir1 extra x) 0.0)
(set! (-> v1-10 dir2 extra x) 0.0)
)
(none)
)
;; definition for function update-mood-templex
;; WARN: Return type mismatch int vs none.
(defbehavior update-mood-templex time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int))
(copy-mood-exterior arg0)
(update-templex-lights arg0)
(when (and (= (-> *level* level arg2 status) 'active)
(< (the-as uint (-> *time-of-day-context* mode)) (the-as uint 9))
)
(-> arg0 state)
(if (task-node-closed? (game-task-node volcano-darkeco-resolution))
(set! (-> arg0 times 5 w) 1.0)
)
(update-mood-flames arg0 6 2 8 0.5 0.0009765625 1.5)
)
0
(none)
)