mirror of
https://github.com/open-goal/jak-project
synced 2026-08-16 13:17:34 -04:00
[decomp] better handling of animation code and art files (#1352)
* update refs * [decompiler] read and process art groups * finish decompiler art group selection & detect in `ja-group?` * make art stuff work on offline tests! * [decompiler] detect `ja-group!` (primitive) * corrections. * more * use new feature on skel groups! * find `loop!` as well * fully fledged `ja` macro & decomp + `loop` detect * fancy fixed point printing! * update source * `:num! max` (i knew i should've done this) * Update jak1_ntsc_black_label.jsonc * hi imports * make compiling the game work * fix `defskelgroup` * clang * update refs * fix chan * fix seek and finalboss * fix tests * delete unused function * track let rewrite stats * reorder `rewrite_let` * Update .gitattributes * fix bug with `:num! max` * Update robotboss-part.gc * Update goal-lib.gc * document `ja` * get rid of pc fixes thing * use std::abs
This commit is contained in:
+15
-64
@@ -293,22 +293,13 @@
|
||||
|
||||
;; definition for function process-taskable-anim-loop
|
||||
(defbehavior process-taskable-anim-loop process-taskable ()
|
||||
(when (!= (if (> (-> self skel active-channels) 0)
|
||||
(-> self skel root-channel 0 frame-group)
|
||||
)
|
||||
(get-art-elem self)
|
||||
)
|
||||
(ja-channel-push! 1 60)
|
||||
(let ((gp-0 (-> self skel root-channel 0)))
|
||||
(set! (-> gp-0 frame-group) (the-as art-joint-anim (get-art-elem self)))
|
||||
)
|
||||
(when (!= (ja-group) (get-art-elem self))
|
||||
(ja-channel-push! 1 (seconds 0.2))
|
||||
(ja :group! (get-art-elem self))
|
||||
)
|
||||
(while #t
|
||||
(loop
|
||||
(suspend)
|
||||
(let ((a0-8 (-> self skel root-channel 0)))
|
||||
(set! (-> a0-8 param 0) 1.0)
|
||||
(joint-control-channel-group-eval! a0-8 (the-as art-joint-anim #f) num-func-loop!)
|
||||
)
|
||||
(ja :num! (loop!))
|
||||
(if (= (-> self next-state name) 'idle)
|
||||
(TODO-RENAME-43 self)
|
||||
)
|
||||
@@ -452,7 +443,7 @@
|
||||
(if (nonzero? *camera-look-through-other*)
|
||||
(set! *camera-look-through-other* 2)
|
||||
)
|
||||
(set-letterbox-frames (seconds 0.016666668))
|
||||
(set-letterbox-frames (seconds 0.017))
|
||||
(draw-npc-shadow self)
|
||||
(none)
|
||||
)
|
||||
@@ -533,10 +524,7 @@
|
||||
(else
|
||||
(when (not arg1)
|
||||
(format #t "ERROR<GMJ>: ~S ~S got #f from anim picker~%" (-> self name) (-> self state name))
|
||||
(set! arg1 (if (> (-> self skel active-channels) 0)
|
||||
(-> self skel root-channel 0 frame-group)
|
||||
)
|
||||
)
|
||||
(set! arg1 (ja-group))
|
||||
)
|
||||
(when (not (type-type? (-> arg1 type) art-joint-anim))
|
||||
(format
|
||||
@@ -545,58 +533,23 @@
|
||||
(-> self name)
|
||||
(-> self state name)
|
||||
)
|
||||
(set! arg1 (if (> (-> self skel active-channels) 0)
|
||||
(-> self skel root-channel 0 frame-group)
|
||||
)
|
||||
)
|
||||
(set! arg1 (ja-group))
|
||||
)
|
||||
(format #t "~S ~S anim ~S~%" (-> self name) (-> self state name) (-> (the-as art-joint-anim arg1) name))
|
||||
(ja-channel-push! 1 60)
|
||||
(ja-channel-push! 1 (seconds 0.2))
|
||||
(set! (-> self skel root-channel 0 frame-group) (the-as art-joint-anim arg1))
|
||||
(when (< (ja-num-frames 0) 3)
|
||||
(suspend)
|
||||
(suspend)
|
||||
0
|
||||
)
|
||||
(let ((a0-30 (-> self skel root-channel 0)))
|
||||
(set! (-> a0-30 frame-group) (if (> (-> self skel active-channels) 0)
|
||||
(-> self skel root-channel 0 frame-group)
|
||||
)
|
||||
)
|
||||
(set! (-> a0-30 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0)
|
||||
(-> self skel root-channel 0 frame-group)
|
||||
)
|
||||
data
|
||||
0
|
||||
length
|
||||
)
|
||||
-1
|
||||
)
|
||||
)
|
||||
)
|
||||
(set! (-> a0-30 param 1) 1.0)
|
||||
(set! (-> a0-30 frame-num) 0.0)
|
||||
(joint-control-channel-group!
|
||||
a0-30
|
||||
(if (> (-> self skel active-channels) 0)
|
||||
(-> self skel root-channel 0 frame-group)
|
||||
)
|
||||
num-func-seek!
|
||||
)
|
||||
)
|
||||
(ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0)
|
||||
(until (ja-done? 0)
|
||||
(when (and *debug-segment* (= (get-response (-> self query)) 'no))
|
||||
(let ((v1-106 (-> self skel root-channel 0)))
|
||||
(set! (-> v1-106 num-func) num-func-identity)
|
||||
(set! (-> v1-106 frame-num) (the float (+ (-> v1-106 frame-group data 0 length) -1)))
|
||||
(if (and *debug-segment* (= (get-response (-> self query)) 'no))
|
||||
(ja :num-func num-func-identity :frame-num max)
|
||||
)
|
||||
)
|
||||
(suspend)
|
||||
(let ((a0-38 (-> self skel root-channel 0)))
|
||||
(set! (-> a0-38 param 0) (the float (+ (-> a0-38 frame-group data 0 length) -1)))
|
||||
(set! (-> a0-38 param 1) 1.0)
|
||||
(joint-control-channel-group-eval! a0-38 (the-as art-joint-anim #f) num-func-seek!)
|
||||
)
|
||||
(ja :num! (seek!))
|
||||
)
|
||||
#f
|
||||
)
|
||||
@@ -821,9 +774,7 @@
|
||||
)
|
||||
(else
|
||||
(ja-channel-set! 1)
|
||||
(let ((gp-0 (-> self skel root-channel 0)))
|
||||
(set! (-> gp-0 frame-group) (the-as art-joint-anim (get-art-elem self)))
|
||||
)
|
||||
(ja :group! (get-art-elem self))
|
||||
(restore-collide-with-as (-> self root-override))
|
||||
(process-entity-status! self (entity-perm-status bit-3) #t)
|
||||
(let ((v1-7 (-> self draw shadow-ctrl)))
|
||||
@@ -1395,7 +1346,7 @@
|
||||
)
|
||||
:code
|
||||
(behavior ()
|
||||
(while #t
|
||||
(loop
|
||||
(let ((s2-0 (-> self hand process 0)))
|
||||
(when (not s2-0)
|
||||
(format #t "ERROR<GMJ>: othercam parent invalid~%")
|
||||
|
||||
Reference in New Issue
Block a user