mirror of
https://github.com/open-goal/jak-project
synced 2026-05-31 01:16:12 -04:00
93afb02cf4
This includes all the collision stuff needed to spawn `target`, decompiles the sparticle code and adds some of the PC hacks needed for merc to run (it doesn't work quite right and looks bad, likely due to a combination of code copied from Jak 2 and the time of day hacks). There are a bunch of temporary hacks (see commits) in place to prevent the game from crashing quite as much, but it is still extremely prone to doing so due to lots of missing functions/potentially bad decomp. --------- Co-authored-by: water <awaterford111445@gmail.com>
98 lines
3.1 KiB
Common Lisp
Vendored
Generated
98 lines
3.1 KiB
Common Lisp
Vendored
Generated
;;-*-Lisp-*-
|
|
(in-package goal)
|
|
|
|
;; definition for method 10 of type drawable-tree-array
|
|
;; WARN: Return type mismatch int vs none.
|
|
(defmethod draw ((this drawable-tree-array))
|
|
"Draw the drawable, and typically its children.
|
|
This usually means adding stuff to a list to be drawn later, rather than expensive drawing here."
|
|
(case (-> *level* draw-level *draw-index* display?)
|
|
(('special #f)
|
|
)
|
|
(else
|
|
(dotimes (s5-0 (-> this length))
|
|
(draw (-> this trees s5-0))
|
|
)
|
|
)
|
|
)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
;; definition for method 13 of type drawable-tree-array
|
|
;; WARN: Return type mismatch int vs none.
|
|
(defmethod collect-stats ((this drawable-tree-array))
|
|
"Collect triangle/perf statistics for rendering.
|
|
This is only called when viewing stats.
|
|
The vis-bits and culling registers are loaded during this time."
|
|
(dotimes (s5-0 (-> this length))
|
|
(collect-stats (-> this trees s5-0))
|
|
)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
;; definition for method 14 of type drawable-tree-array
|
|
;; WARN: Return type mismatch int vs none.
|
|
(defmethod debug-draw ((this drawable-tree-array))
|
|
"Debug-draw a drawable and its children. Typically uses the debug-draw functions."
|
|
(dotimes (s5-0 (-> this length))
|
|
(debug-draw (-> this trees s5-0))
|
|
)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
;; definition for method 15 of type drawable-tree
|
|
(defmethod unpack-vis ((this drawable-tree) (arg0 (pointer int8)) (arg1 (pointer int8)))
|
|
(local-vars (t5-1 uint))
|
|
(let* ((v1-0 (the-as drawable-inline-array-node (-> this data 0)))
|
|
(a3-1 (/ (-> v1-0 data 0 id) 8))
|
|
(t0-0 (-> v1-0 length))
|
|
(v1-1 (&+ arg0 a3-1))
|
|
(a3-3 (/ (+ t0-0 7) 8))
|
|
)
|
|
(dotimes (t0-1 a3-3)
|
|
(let ((t1-0 (-> arg1 0)))
|
|
(set! arg1 (&-> arg1 1))
|
|
(set! (-> v1-1 0) t1-0)
|
|
)
|
|
(set! v1-1 (&-> v1-1 1))
|
|
)
|
|
)
|
|
(let ((v1-5 (+ (-> this length) -1)))
|
|
(when (nonzero? v1-5)
|
|
(dotimes (a3-5 v1-5)
|
|
(let* ((t0-4 (-> this data a3-5))
|
|
(t2-0 (the-as drawable-inline-array-node (-> this data (+ a3-5 1))))
|
|
(t1-5 (/ (-> (the-as drawable-inline-array-node t0-4) data 0 id) 8))
|
|
(t2-2 (/ (-> t2-0 data 0 id) 8))
|
|
(t0-5 (-> (the-as drawable-inline-array-node t0-4) length))
|
|
(t1-6 (&+ arg0 t1-5))
|
|
(t2-3 (the-as object (&+ arg0 t2-2)))
|
|
)
|
|
(loop
|
|
(let ((t3-0 (-> t1-6 0)))
|
|
(set! t1-6 (&-> t1-6 1))
|
|
(let ((t4-0 128))
|
|
(label cfg-7)
|
|
(b! (not (logtest? t3-0 t4-0)) cfg-9 :delay (set! t5-1 (the-as uint (-> arg1 0))))
|
|
(set! arg1 (&-> arg1 1))
|
|
(set! (-> (the-as (pointer int8) t2-3) 0) (the-as int t5-1))
|
|
(label cfg-9)
|
|
(+! t0-5 -1)
|
|
(b! (zero? t0-5) cfg-12 :delay (shift-arith-right-32 t4-0 t4-0 1))
|
|
(b! (nonzero? (the-as uint t4-0)) cfg-7 :delay (set! t2-3 (&-> (the-as (pointer int8) t2-3) 1)))
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(label cfg-12)
|
|
(nop!)
|
|
0
|
|
)
|
|
)
|
|
)
|
|
arg1
|
|
)
|