mirror of
https://github.com/open-goal/jak-project
synced 2026-08-14 04:33:04 -04:00
New Pretty Printer (#994)
* begin work on improved pretty printer * update ref * finish pretty printer * force line break for defstate
This commit is contained in:
+2272
-2931
File diff suppressed because it is too large
Load Diff
+4
-23
@@ -17,10 +17,7 @@
|
||||
)
|
||||
|
||||
;; definition for method 3 of type __assert-info-private-struct
|
||||
(defmethod
|
||||
inspect
|
||||
__assert-info-private-struct
|
||||
((obj __assert-info-private-struct))
|
||||
(defmethod inspect __assert-info-private-struct ((obj __assert-info-private-struct))
|
||||
(format #t "[~8x] ~A~%" obj '__assert-info-private-struct)
|
||||
(format #t "~Tfilename: ~A~%" (-> obj filename))
|
||||
(format #t "~Tline-num: ~D~%" (-> obj line-num))
|
||||
@@ -29,14 +26,7 @@
|
||||
)
|
||||
|
||||
;; definition for method 9 of type __assert-info-private-struct
|
||||
(defmethod
|
||||
set-pos
|
||||
__assert-info-private-struct
|
||||
((obj __assert-info-private-struct)
|
||||
(filename string)
|
||||
(line-num uint)
|
||||
(column-num uint)
|
||||
)
|
||||
(defmethod set-pos __assert-info-private-struct ((obj __assert-info-private-struct) (filename string) (line-num uint) (column-num uint))
|
||||
(set! (-> obj filename) filename)
|
||||
(set! (-> obj line-num) line-num)
|
||||
(set! (-> obj column-num) column-num)
|
||||
@@ -44,17 +34,8 @@
|
||||
)
|
||||
|
||||
;; definition for method 10 of type __assert-info-private-struct
|
||||
(defmethod
|
||||
print-pos
|
||||
__assert-info-private-struct
|
||||
((obj __assert-info-private-struct))
|
||||
(format
|
||||
#t
|
||||
"file ~S.gc, line ~D, col ~D.~%"
|
||||
(-> obj filename)
|
||||
(-> obj line-num)
|
||||
(-> obj column-num)
|
||||
)
|
||||
(defmethod print-pos __assert-info-private-struct ((obj __assert-info-private-struct))
|
||||
(format #t "file ~S.gc, line ~D, col ~D.~%" (-> obj filename) (-> obj line-num) (-> obj column-num))
|
||||
0
|
||||
)
|
||||
|
||||
|
||||
+53
-79
@@ -26,58 +26,34 @@
|
||||
(f30-0 1.0)
|
||||
(s4-0 0)
|
||||
)
|
||||
(set-vector! s5-0 0.0 0.0 0.0 1.0)
|
||||
(dotimes (s3-0 10)
|
||||
(let ((f28-0 (* f30-0 (sin (* 3276.8 (the float s3-0)))))
|
||||
(f26-0 (* f30-0 (sin (* 3276.8 (the float (+ s3-0 1))))))
|
||||
(s2-0 (new-stack-vector0))
|
||||
(s1-0 (new-stack-vector0))
|
||||
(s0-0 (new-stack-vector0))
|
||||
(set-vector! s5-0 0.0 0.0 0.0 1.0)
|
||||
(dotimes (s3-0 10)
|
||||
(let ((f28-0 (* f30-0 (sin (* 3276.8 (the float s3-0)))))
|
||||
(f26-0 (* f30-0 (sin (* 3276.8 (the float (+ s3-0 1))))))
|
||||
(s2-0 (new-stack-vector0))
|
||||
(s1-0 (new-stack-vector0))
|
||||
(s0-0 (new-stack-vector0))
|
||||
)
|
||||
(set! (-> s2-0 y) (+ (-> s5-0 y) (* (cos (* 3276.8 (the float s3-0))) f30-0)))
|
||||
(set! (-> s1-0 y) (-> s2-0 y))
|
||||
(set! (-> s0-0 y) (+ (-> s5-0 y) (* (cos (* 3276.8 (the float (+ s3-0 1)))) f30-0)))
|
||||
(set! sv-80 0)
|
||||
(while (< sv-80 10)
|
||||
(set! (-> s2-0 x) (+ (-> s5-0 x) (* (cos (* 6553.6 (the float sv-80))) f28-0)))
|
||||
(set! (-> s2-0 z) (+ (-> s5-0 z) (* (sin (* 6553.6 (the float sv-80))) f28-0)))
|
||||
(set! (-> s1-0 x) (+ (-> s5-0 x) (* (cos (* 6553.6 (the float (+ sv-80 1)))) f28-0)))
|
||||
(set! (-> s1-0 z) (+ (-> s5-0 z) (* (sin (* 6553.6 (the float (+ sv-80 1)))) f28-0)))
|
||||
(set! (-> s0-0 x) (+ (-> s5-0 x) (* (cos (* 6553.6 (the float sv-80))) f26-0)))
|
||||
(set! (-> s0-0 z) (+ (-> s5-0 z) (* (sin (* 6553.6 (the float sv-80))) f26-0)))
|
||||
(set! (-> arg0 point s4-0 quad) (-> s2-0 quad))
|
||||
(set! (-> arg0 point (+ s4-0 1) quad) (-> s1-0 quad))
|
||||
(set! (-> arg0 point (+ s4-0 2) quad) (-> s0-0 quad))
|
||||
(+! s4-0 3)
|
||||
(set! sv-80 (+ sv-80 1))
|
||||
)
|
||||
(set!
|
||||
(-> s2-0 y)
|
||||
(+ (-> s5-0 y) (* (cos (* 3276.8 (the float s3-0))) f30-0))
|
||||
)
|
||||
)
|
||||
(set! (-> s1-0 y) (-> s2-0 y))
|
||||
(set!
|
||||
(-> s0-0 y)
|
||||
(+ (-> s5-0 y) (* (cos (* 3276.8 (the float (+ s3-0 1)))) f30-0))
|
||||
)
|
||||
(set! sv-80 0)
|
||||
(while (< sv-80 10)
|
||||
(set!
|
||||
(-> s2-0 x)
|
||||
(+ (-> s5-0 x) (* (cos (* 6553.6 (the float sv-80))) f28-0))
|
||||
)
|
||||
(set!
|
||||
(-> s2-0 z)
|
||||
(+ (-> s5-0 z) (* (sin (* 6553.6 (the float sv-80))) f28-0))
|
||||
)
|
||||
(set!
|
||||
(-> s1-0 x)
|
||||
(+ (-> s5-0 x) (* (cos (* 6553.6 (the float (+ sv-80 1)))) f28-0))
|
||||
)
|
||||
(set!
|
||||
(-> s1-0 z)
|
||||
(+ (-> s5-0 z) (* (sin (* 6553.6 (the float (+ sv-80 1)))) f28-0))
|
||||
)
|
||||
(set!
|
||||
(-> s0-0 x)
|
||||
(+ (-> s5-0 x) (* (cos (* 6553.6 (the float sv-80))) f26-0))
|
||||
)
|
||||
(set!
|
||||
(-> s0-0 z)
|
||||
(+ (-> s5-0 z) (* (sin (* 6553.6 (the float sv-80))) f26-0))
|
||||
)
|
||||
(set! (-> arg0 point s4-0 quad) (-> s2-0 quad))
|
||||
(set! (-> arg0 point (+ s4-0 1) quad) (-> s1-0 quad))
|
||||
(set! (-> arg0 point (+ s4-0 2) quad) (-> s0-0 quad))
|
||||
(+! s4-0 3)
|
||||
(set! sv-80 (+ sv-80 1))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
@@ -91,41 +67,39 @@
|
||||
;; definition for function add-debug-sphere-from-table
|
||||
;; INFO: Return type mismatch int vs none.
|
||||
;; Used lq/sq
|
||||
(defun
|
||||
add-debug-sphere-from-table
|
||||
((arg0 bucket-id) (arg1 vector) (arg2 float) (arg3 rgba))
|
||||
(defun add-debug-sphere-from-table ((arg0 bucket-id) (arg1 vector) (arg2 float) (arg3 rgba))
|
||||
(rlet ((vf1 :class vf)
|
||||
(vf2 :class vf)
|
||||
(vf3 :class vf)
|
||||
(vf4 :class vf)
|
||||
(vf5 :class vf)
|
||||
)
|
||||
(let ((s4-0 (new-stack-vector0))
|
||||
(s3-0 (new-stack-vector0))
|
||||
(s2-0 (new-stack-vector0))
|
||||
(points (-> *debug-sphere-table* point))
|
||||
)
|
||||
(.lvf vf1 (&-> arg1 quad))
|
||||
(.mov vf2 arg2)
|
||||
(dotimes (s0-0 100)
|
||||
(.lvf vf3 (&-> points 0 quad))
|
||||
(.lvf vf4 (&-> points 1 quad))
|
||||
(.lvf vf5 (&-> points 2 quad))
|
||||
(set! points (the-as (inline-array vector) (-> points 3)))
|
||||
(.mul.x.vf vf3 vf3 vf2)
|
||||
(.mul.x.vf vf4 vf4 vf2)
|
||||
(.mul.x.vf vf5 vf5 vf2)
|
||||
(.add.vf vf3 vf3 vf1)
|
||||
(.add.vf vf4 vf4 vf1)
|
||||
(.add.vf vf5 vf5 vf1)
|
||||
(.svf (&-> s4-0 quad) vf3)
|
||||
(.svf (&-> s3-0 quad) vf4)
|
||||
(.svf (&-> s2-0 quad) vf5)
|
||||
(add-debug-line #t arg0 s4-0 s3-0 arg3 #f (the-as rgba -1))
|
||||
(add-debug-line #t arg0 s4-0 s2-0 arg3 #f (the-as rgba -1))
|
||||
)
|
||||
(let ((s4-0 (new-stack-vector0))
|
||||
(s3-0 (new-stack-vector0))
|
||||
(s2-0 (new-stack-vector0))
|
||||
(points (-> *debug-sphere-table* point))
|
||||
)
|
||||
(.lvf vf1 (&-> arg1 quad))
|
||||
(.mov vf2 arg2)
|
||||
(dotimes (s0-0 100)
|
||||
(.lvf vf3 (&-> points 0 quad))
|
||||
(.lvf vf4 (&-> points 1 quad))
|
||||
(.lvf vf5 (&-> points 2 quad))
|
||||
(set! points (the-as (inline-array vector) (-> points 3)))
|
||||
(.mul.x.vf vf3 vf3 vf2)
|
||||
(.mul.x.vf vf4 vf4 vf2)
|
||||
(.mul.x.vf vf5 vf5 vf2)
|
||||
(.add.vf vf3 vf3 vf1)
|
||||
(.add.vf vf4 vf4 vf1)
|
||||
(.add.vf vf5 vf5 vf1)
|
||||
(.svf (&-> s4-0 quad) vf3)
|
||||
(.svf (&-> s3-0 quad) vf4)
|
||||
(.svf (&-> s2-0 quad) vf5)
|
||||
(add-debug-line #t arg0 s4-0 s3-0 arg3 #f (the-as rgba -1))
|
||||
(add-debug-line #t arg0 s4-0 s2-0 arg3 #f (the-as rgba -1))
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
)
|
||||
|
||||
+1016
-1393
File diff suppressed because it is too large
Load Diff
+3892
-8336
File diff suppressed because it is too large
Load Diff
+440
-735
File diff suppressed because it is too large
Load Diff
+995
-1443
File diff suppressed because it is too large
Load Diff
+68
-95
@@ -4,18 +4,17 @@
|
||||
;; this file is debug only
|
||||
(when *debug-segment*
|
||||
;; failed to figure out what this is:
|
||||
(set!
|
||||
(-> *part-group-id-table* 105)
|
||||
(new 'static 'sparticle-launch-group
|
||||
:length 2
|
||||
:duration #xbb8
|
||||
:linger-duration #x5dc
|
||||
:name "group-part-tester"
|
||||
:launcher
|
||||
(new 'static 'inline-array sparticle-group-item 2 (sp-item 56) (sp-item 57))
|
||||
:bounds (new 'static 'sphere :w 4096.0)
|
||||
)
|
||||
)
|
||||
(set! (-> *part-group-id-table* 105)
|
||||
(new 'static 'sparticle-launch-group
|
||||
:length 2
|
||||
:duration #xbb8
|
||||
:linger-duration #x5dc
|
||||
:name "group-part-tester"
|
||||
:launcher
|
||||
(new 'static 'inline-array sparticle-group-item 2 (sp-item 56) (sp-item 57))
|
||||
:bounds (new 'static 'sphere :w 4096.0)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition of type part-tester
|
||||
(deftype part-tester (process)
|
||||
@@ -32,8 +31,8 @@
|
||||
;; definition for method 3 of type part-tester
|
||||
(defmethod inspect part-tester ((obj part-tester))
|
||||
(let ((t9-0 (method-of-type process inspect)))
|
||||
(t9-0 obj)
|
||||
)
|
||||
(t9-0 obj)
|
||||
)
|
||||
(format #t "~T~Troot: ~A~%" (-> obj root))
|
||||
(format #t "~T~Tpart: ~A~%" (-> obj part))
|
||||
(format #t "~T~Told-group: ~A~%" (-> obj old-group))
|
||||
@@ -46,8 +45,8 @@
|
||||
;; definition for method 10 of type part-tester
|
||||
(defmethod deactivate part-tester ((obj part-tester))
|
||||
(if (nonzero? (-> obj part))
|
||||
(kill-and-free-particles (-> obj part))
|
||||
)
|
||||
(kill-and-free-particles (-> obj part))
|
||||
)
|
||||
((method-of-type process deactivate) obj)
|
||||
(none)
|
||||
)
|
||||
@@ -56,62 +55,51 @@
|
||||
(defstate part-tester-idle (part-tester)
|
||||
:code
|
||||
(behavior ()
|
||||
(while #t
|
||||
(let ((gp-0 (entity-by-name *part-tester-name*)))
|
||||
(when gp-0
|
||||
(let ((s5-0 (-> gp-0 extra process)))
|
||||
(if
|
||||
(and
|
||||
s5-0
|
||||
(type-type? (-> s5-0 type) process-drawable)
|
||||
(nonzero? (-> (the-as process-drawable s5-0) root))
|
||||
)
|
||||
(set!
|
||||
(-> self root trans quad)
|
||||
(-> (the-as process-drawable s5-0) root trans quad)
|
||||
)
|
||||
(set! (-> self root trans quad) (-> gp-0 extra trans quad))
|
||||
(while #t
|
||||
(let ((gp-0 (entity-by-name *part-tester-name*)))
|
||||
(when gp-0
|
||||
(let ((s5-0 (-> gp-0 extra process)))
|
||||
(if (and s5-0 (type-type? (-> s5-0 type) process-drawable) (nonzero? (-> (the-as process-drawable s5-0) root)))
|
||||
(set! (-> self root trans quad) (-> (the-as process-drawable s5-0) root trans quad))
|
||||
(set! (-> self root trans quad) (-> gp-0 extra trans quad))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(add-debug-x
|
||||
#t
|
||||
(bucket-id debug-draw1)
|
||||
(-> self root trans)
|
||||
(the-as rgba (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80))
|
||||
)
|
||||
(let ((gp-1 (-> *part-group-id-table* 105)))
|
||||
(let ((s5-1 (-> self root trans)))
|
||||
(when (!= gp-1 (-> self old-group))
|
||||
(when (nonzero? (-> self part))
|
||||
(kill-and-free-particles (-> self part))
|
||||
(set! (-> self heap-cur) (&-> (-> self part) type))
|
||||
)
|
||||
(set! (-> self part) (create-launch-control gp-1 self))
|
||||
)
|
||||
(if (nonzero? (-> self part))
|
||||
(spawn (-> self part) (cond
|
||||
((logtest? (-> gp-1 flags) (sp-group-flag screen-space))
|
||||
*zero-vector*
|
||||
)
|
||||
(else
|
||||
(empty)
|
||||
s5-1
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(set! (-> self old-group) gp-1)
|
||||
)
|
||||
(suspend)
|
||||
)
|
||||
)
|
||||
(add-debug-x
|
||||
#t
|
||||
(bucket-id debug-draw1)
|
||||
(-> self root trans)
|
||||
(the-as rgba (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80))
|
||||
)
|
||||
(let ((gp-1 (-> *part-group-id-table* 105)))
|
||||
(let ((s5-1 (-> self root trans)))
|
||||
(when (!= gp-1 (-> self old-group))
|
||||
(when (nonzero? (-> self part))
|
||||
(kill-and-free-particles (-> self part))
|
||||
(set! (-> self heap-cur) (&-> (-> self part) type))
|
||||
)
|
||||
(set! (-> self part) (create-launch-control gp-1 self))
|
||||
)
|
||||
(if (nonzero? (-> self part))
|
||||
(spawn (-> self part) (cond
|
||||
((logtest?
|
||||
(-> gp-1 flags)
|
||||
(sp-group-flag screen-space)
|
||||
)
|
||||
*zero-vector*
|
||||
)
|
||||
(else
|
||||
(empty)
|
||||
s5-1
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(set! (-> self old-group) gp-1)
|
||||
)
|
||||
(suspend)
|
||||
(none)
|
||||
)
|
||||
(none)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for function part-tester-init-by-other
|
||||
@@ -126,41 +114,26 @@
|
||||
)
|
||||
|
||||
;; definition (perm) for symbol *debug-part-dead-pool*, type dead-pool
|
||||
(define-perm *debug-part-dead-pool* dead-pool
|
||||
(new 'debug 'dead-pool 1 #x10000 '*debug-part-dead-pool*)
|
||||
)
|
||||
(define-perm *debug-part-dead-pool* dead-pool (new 'debug 'dead-pool 1 #x10000 '*debug-part-dead-pool*))
|
||||
|
||||
;; definition for function start-part
|
||||
;; INFO: Return type mismatch (pointer process) vs none.
|
||||
(defun start-part ()
|
||||
(kill-by-type part-tester *active-pool*)
|
||||
(let ((gp-0 (get-process *debug-part-dead-pool* part-tester #x4000)))
|
||||
(when gp-0
|
||||
(let ((t9-2 (method-of-type part-tester activate)))
|
||||
(t9-2
|
||||
(the-as part-tester gp-0)
|
||||
*default-pool*
|
||||
'part-tester
|
||||
(the-as pointer #x70004000)
|
||||
(when gp-0
|
||||
(let ((t9-2 (method-of-type part-tester activate)))
|
||||
(t9-2 (the-as part-tester gp-0) *default-pool* 'part-tester (the-as pointer #x70004000))
|
||||
)
|
||||
(run-now-in-process gp-0 part-tester-init-by-other (if *anim-tester*
|
||||
(-> *anim-tester* 0 root trans)
|
||||
(target-pos 0)
|
||||
)
|
||||
)
|
||||
(-> gp-0 ppointer)
|
||||
)
|
||||
)
|
||||
(run-now-in-process gp-0 part-tester-init-by-other (if *anim-tester*
|
||||
(->
|
||||
*anim-tester*
|
||||
0
|
||||
root
|
||||
trans
|
||||
)
|
||||
(target-pos 0)
|
||||
)
|
||||
)
|
||||
(-> gp-0 ppointer)
|
||||
)
|
||||
)
|
||||
(none)
|
||||
)
|
||||
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
+16
-19
@@ -129,17 +129,17 @@
|
||||
(defmethod reset! perf-stat ((obj perf-stat))
|
||||
(local-vars (r0-0 none))
|
||||
(let ((v1-0 (-> obj ctrl)))
|
||||
(+! (-> obj count) 1)
|
||||
(b! (zero? v1-0) cfg-2 :delay (nop!))
|
||||
(.mtc0 Perf r0-0)
|
||||
(.sync.l)
|
||||
(.sync.p)
|
||||
(.mtpc pcr0 r0-0)
|
||||
(.mtpc pcr1 r0-0)
|
||||
(.sync.l)
|
||||
(.sync.p)
|
||||
(.mtc0 Perf v1-0)
|
||||
)
|
||||
(+! (-> obj count) 1)
|
||||
(b! (zero? v1-0) cfg-2 :delay (nop!))
|
||||
(.mtc0 Perf r0-0)
|
||||
(.sync.l)
|
||||
(.sync.p)
|
||||
(.mtpc pcr0 r0-0)
|
||||
(.mtpc pcr1 r0-0)
|
||||
(.sync.l)
|
||||
(.sync.p)
|
||||
(.mtc0 Perf v1-0)
|
||||
)
|
||||
(.sync.l)
|
||||
(.sync.p)
|
||||
(label cfg-2)
|
||||
@@ -171,15 +171,12 @@
|
||||
|
||||
;; definition for method 13 of type perf-stat
|
||||
;; INFO: Return type mismatch int vs none.
|
||||
(defmethod
|
||||
update-wait-stats
|
||||
perf-stat
|
||||
((obj perf-stat) (arg0 uint) (arg1 uint) (arg2 uint))
|
||||
(defmethod update-wait-stats perf-stat ((obj perf-stat) (arg0 uint) (arg1 uint) (arg2 uint))
|
||||
(when (nonzero? (-> obj ctrl))
|
||||
(+! (-> obj to-vu0-waits) arg0)
|
||||
(+! (-> obj to-spr-waits) arg1)
|
||||
(+! (-> obj from-spr-waits) arg2)
|
||||
)
|
||||
(+! (-> obj to-vu0-waits) arg0)
|
||||
(+! (-> obj to-spr-waits) arg1)
|
||||
(+! (-> obj from-spr-waits) arg2)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
+135
-154
@@ -2,14 +2,12 @@
|
||||
(in-package goal)
|
||||
|
||||
;; definition for symbol *viewer-sg*, type skeleton-group
|
||||
(define
|
||||
*viewer-sg*
|
||||
(new 'static 'skeleton-group
|
||||
:bounds (new 'static 'vector :w 16384.0)
|
||||
:lod-dist
|
||||
(new 'static 'array float 4 4095996000.0 0.0 0.0 0.0)
|
||||
)
|
||||
)
|
||||
(define *viewer-sg* (new 'static 'skeleton-group
|
||||
:bounds (new 'static 'vector :w 16384.0)
|
||||
:lod-dist
|
||||
(new 'static 'array float 4 4095996000.0 0.0 0.0 0.0)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition of type viewer
|
||||
(deftype viewer (process-drawable)
|
||||
@@ -24,8 +22,8 @@
|
||||
;; definition for method 3 of type viewer
|
||||
(defmethod inspect viewer ((obj viewer))
|
||||
(let ((t9-0 (method-of-type process-drawable inspect)))
|
||||
(t9-0 obj)
|
||||
)
|
||||
(t9-0 obj)
|
||||
)
|
||||
(format #t "~T~Tjanim: ~A~%" (-> obj janim))
|
||||
obj
|
||||
)
|
||||
@@ -34,34 +32,27 @@
|
||||
(defstate viewer-process (viewer)
|
||||
:code
|
||||
(behavior ()
|
||||
(while #t
|
||||
(let ((a0-0 (-> self skel root-channel 0)))
|
||||
(set! (-> a0-0 frame-group) (-> self janim))
|
||||
(set! (-> a0-0 param 0) (the float (+ (-> self janim data 0 length) -1)))
|
||||
(set! (-> a0-0 param 1) 1.0)
|
||||
(set! (-> a0-0 frame-num) 0.0)
|
||||
(joint-control-channel-group! a0-0 (-> self janim) num-func-seek!)
|
||||
)
|
||||
(until (ja-done? 0)
|
||||
(TODO-RENAME-9 (-> self align))
|
||||
(TODO-RENAME-10 (-> self align) 31 1.0 1.0 1.0)
|
||||
(suspend)
|
||||
(let ((a0-3 (-> self skel root-channel 0)))
|
||||
(set!
|
||||
(-> a0-3 param 0)
|
||||
(the float (+ (-> a0-3 frame-group data 0 length) -1))
|
||||
)
|
||||
(set! (-> a0-3 param 1) 1.0)
|
||||
(joint-control-channel-group-eval!
|
||||
a0-3
|
||||
(the-as art-joint-anim #f)
|
||||
num-func-seek!
|
||||
)
|
||||
(while #t
|
||||
(let ((a0-0 (-> self skel root-channel 0)))
|
||||
(set! (-> a0-0 frame-group) (-> self janim))
|
||||
(set! (-> a0-0 param 0) (the float (+ (-> self janim data 0 length) -1)))
|
||||
(set! (-> a0-0 param 1) 1.0)
|
||||
(set! (-> a0-0 frame-num) 0.0)
|
||||
(joint-control-channel-group! a0-0 (-> self janim) num-func-seek!)
|
||||
)
|
||||
(until (ja-done? 0)
|
||||
(TODO-RENAME-9 (-> self align))
|
||||
(TODO-RENAME-10 (-> self align) 31 1.0 1.0 1.0)
|
||||
(suspend)
|
||||
(let ((a0-3 (-> self skel root-channel 0)))
|
||||
(set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group data 0 length) -1)))
|
||||
(set! (-> a0-3 param 1) 1.0)
|
||||
(joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(none)
|
||||
)
|
||||
(none)
|
||||
)
|
||||
:post
|
||||
(the-as (function none :behavior viewer) ja-post)
|
||||
)
|
||||
@@ -80,124 +71,119 @@
|
||||
(let ((s5-0 (-> arg2 data))
|
||||
(gp-0 (-> arg0 data))
|
||||
)
|
||||
(set! (-> gp-0 0) (the-as uint 0))
|
||||
(dotimes (s2-0 (- (length arg2) (+ (length arg1) 2)))
|
||||
(when (= (-> s5-0 0) 45)
|
||||
(let ((s1-0 #f))
|
||||
(dotimes (s0-0 (length arg1))
|
||||
(if (!= (-> s5-0 (+ s0-0 1)) (-> arg1 data s0-0))
|
||||
(goto cfg-10)
|
||||
(set! (-> gp-0 0) (the-as uint 0))
|
||||
(dotimes (s2-0 (- (length arg2) (+ (length arg1) 2)))
|
||||
(when (= (-> s5-0 0) 45)
|
||||
(let ((s1-0 #f))
|
||||
(dotimes (s0-0 (length arg1))
|
||||
(if (!= (-> s5-0 (+ s0-0 1)) (-> arg1 data s0-0))
|
||||
(goto cfg-10)
|
||||
)
|
||||
)
|
||||
(if (= (-> s5-0 (+ (length arg1) 1)) 45)
|
||||
(set! s1-0 #t)
|
||||
)
|
||||
(label cfg-10)
|
||||
(when s1-0
|
||||
(let ((v1-22 (&+ s5-0 (+ (length arg1) 2))))
|
||||
(while (and (!= (-> v1-22 0) 45) (nonzero? (-> v1-22 0)))
|
||||
(set! (-> gp-0 0) (-> v1-22 0))
|
||||
(set! v1-22 (&-> v1-22 1))
|
||||
(set! gp-0 (&-> gp-0 1))
|
||||
)
|
||||
)
|
||||
(set! (-> gp-0 0) (the-as uint 0))
|
||||
(return #t)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(if (= (-> s5-0 (+ (length arg1) 1)) 45)
|
||||
(set! s1-0 #t)
|
||||
)
|
||||
(label cfg-10)
|
||||
(when s1-0
|
||||
(let ((v1-22 (&+ s5-0 (+ (length arg1) 2))))
|
||||
(while (and (!= (-> v1-22 0) 45) (nonzero? (-> v1-22 0)))
|
||||
(set! (-> gp-0 0) (-> v1-22 0))
|
||||
(set! v1-22 (&-> v1-22 1))
|
||||
(set! gp-0 (&-> gp-0 1))
|
||||
)
|
||||
)
|
||||
(set! (-> gp-0 0) (the-as uint 0))
|
||||
(return #t)
|
||||
)
|
||||
(set! s5-0 (&-> s5-0 1))
|
||||
)
|
||||
)
|
||||
(set! s5-0 (&-> s5-0 1))
|
||||
)
|
||||
)
|
||||
#f
|
||||
)
|
||||
|
||||
;; definition for function art-part-name
|
||||
(defun art-part-name ((arg0 string))
|
||||
(let ((gp-0 (-> arg0 data)))
|
||||
(while (nonzero? (-> gp-0 0))
|
||||
(when (= (-> gp-0 0) 45)
|
||||
(copyn-string<-charp
|
||||
viewer-string
|
||||
(&-> gp-0 1)
|
||||
(-
|
||||
(length arg0)
|
||||
(the-as int (+ (- -1 (the-as int (-> arg0 data))) (the-as int gp-0)))
|
||||
)
|
||||
(while (nonzero? (-> gp-0 0))
|
||||
(when (= (-> gp-0 0) 45)
|
||||
(copyn-string<-charp
|
||||
viewer-string
|
||||
(&-> gp-0 1)
|
||||
(- (length arg0) (the-as int (+ (- -1 (the-as int (-> arg0 data))) (the-as int gp-0))))
|
||||
)
|
||||
(return viewer-string)
|
||||
)
|
||||
(set! gp-0 (&-> gp-0 1))
|
||||
)
|
||||
(return viewer-string)
|
||||
)
|
||||
(set! gp-0 (&-> gp-0 1))
|
||||
)
|
||||
)
|
||||
(clear viewer-string)
|
||||
)
|
||||
|
||||
;; definition for function init-viewer
|
||||
(defbehavior init-viewer viewer ((arg0 string))
|
||||
(let ((s2-0 (load-to-heap-by-name (-> (if (-> self entity)
|
||||
(-> self entity extra level)
|
||||
(-> *level* level-default)
|
||||
)
|
||||
art-group
|
||||
)
|
||||
arg0 #f global 0
|
||||
)
|
||||
)
|
||||
(let ((s2-0 (load-to-heap-by-name
|
||||
(-> (if (-> self entity)
|
||||
(-> self entity extra level)
|
||||
(-> *level* level-default)
|
||||
)
|
||||
art-group
|
||||
)
|
||||
arg0
|
||||
#f
|
||||
global
|
||||
0
|
||||
)
|
||||
)
|
||||
(s5-0 (the-as int #f))
|
||||
(s4-0 (the-as int #f))
|
||||
(s3-0 (the-as int #f))
|
||||
)
|
||||
(when s2-0
|
||||
(dotimes (s1-0 (-> s2-0 length))
|
||||
(cond
|
||||
((and
|
||||
(not s4-0)
|
||||
(= (-> s2-0 data s1-0 type) merc-ctrl)
|
||||
(or
|
||||
(zero? (length viewer-geo-name))
|
||||
(string= (art-part-name (-> s2-0 data s1-0 name)) viewer-geo-name)
|
||||
)
|
||||
(when s2-0
|
||||
(dotimes (s1-0 (-> s2-0 length))
|
||||
(cond
|
||||
((and
|
||||
(not s4-0)
|
||||
(= (-> s2-0 data s1-0 type) merc-ctrl)
|
||||
(or (zero? (length viewer-geo-name)) (string= (art-part-name (-> s2-0 data s1-0 name)) viewer-geo-name))
|
||||
)
|
||||
(set! s4-0 s1-0)
|
||||
)
|
||||
((= (-> s2-0 data s1-0 type) art-joint-geo)
|
||||
(set! s3-0 s1-0)
|
||||
)
|
||||
((and
|
||||
(= (-> s2-0 data s1-0 type) art-joint-anim)
|
||||
(or (zero? (length viewer-ja-name)) (string= (art-part-name (-> s2-0 data s1-0 name)) viewer-ja-name))
|
||||
)
|
||||
(set! s5-0 s1-0)
|
||||
)
|
||||
)
|
||||
(if (and s4-0 s3-0 s5-0)
|
||||
(goto cfg-34)
|
||||
)
|
||||
)
|
||||
(set! s4-0 s1-0)
|
||||
)
|
||||
((= (-> s2-0 data s1-0 type) art-joint-geo)
|
||||
(set! s3-0 s1-0)
|
||||
)
|
||||
((and
|
||||
(= (-> s2-0 data s1-0 type) art-joint-anim)
|
||||
(or
|
||||
(zero? (length viewer-ja-name))
|
||||
(string= (art-part-name (-> s2-0 data s1-0 name)) viewer-ja-name)
|
||||
)
|
||||
(label cfg-34)
|
||||
(cond
|
||||
((and s4-0 s3-0 s5-0)
|
||||
(set! (-> self janim) (the-as art-joint-anim (-> s2-0 data s5-0)))
|
||||
(let ((a1-3 *viewer-sg*))
|
||||
(set! (-> a1-3 art-group-name) arg0)
|
||||
(set! (-> a1-3 jgeo) s3-0)
|
||||
(set! (-> a1-3 janim) s5-0)
|
||||
(set! (-> a1-3 mgeo 0) s4-0)
|
||||
(initialize-skeleton self a1-3 '())
|
||||
)
|
||||
)
|
||||
(set! s5-0 s1-0)
|
||||
(set! (-> self align) (new 'process 'align-control self))
|
||||
(go viewer-process)
|
||||
)
|
||||
(else
|
||||
(go process-drawable-art-error arg0)
|
||||
)
|
||||
)
|
||||
(if (and s4-0 s3-0 s5-0)
|
||||
(goto cfg-34)
|
||||
)
|
||||
)
|
||||
)
|
||||
(label cfg-34)
|
||||
(cond
|
||||
((and s4-0 s3-0 s5-0)
|
||||
(set! (-> self janim) (the-as art-joint-anim (-> s2-0 data s5-0)))
|
||||
(let ((a1-3 *viewer-sg*))
|
||||
(set! (-> a1-3 art-group-name) arg0)
|
||||
(set! (-> a1-3 jgeo) s3-0)
|
||||
(set! (-> a1-3 janim) s5-0)
|
||||
(set! (-> a1-3 mgeo 0) s4-0)
|
||||
(initialize-skeleton self a1-3 '())
|
||||
)
|
||||
(set! (-> self align) (new 'process 'align-control self))
|
||||
(go viewer-process)
|
||||
)
|
||||
(else
|
||||
(go process-drawable-art-error arg0)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 11 of type viewer
|
||||
@@ -209,11 +195,11 @@
|
||||
(actor-get-arg! viewer-ja-name "ja" (res-lump-struct arg0 'name string))
|
||||
(actor-get-arg! viewer-geo-name "geo" (res-lump-struct arg0 'name string))
|
||||
(let ((gp-1 (-> arg0 etype)))
|
||||
(if (valid? gp-1 type #f #f 0)
|
||||
(init-viewer (symbol->string (-> gp-1 symbol)))
|
||||
(go process-drawable-art-error "unknown")
|
||||
(if (valid? gp-1 type #f #f 0)
|
||||
(init-viewer (symbol->string (-> gp-1 symbol)))
|
||||
(go process-drawable-art-error "unknown")
|
||||
)
|
||||
)
|
||||
)
|
||||
(none)
|
||||
)
|
||||
|
||||
@@ -237,27 +223,22 @@
|
||||
(defun add-a-bunch ((arg0 string) (arg1 int) (arg2 int) (arg3 float))
|
||||
(local-vars (sv-32 process))
|
||||
(dotimes (s2-0 arg1)
|
||||
(dotimes (s1-0 arg2)
|
||||
(let ((s0-0 (new-stack-vector0)))
|
||||
(position-in-front-of-camera! s0-0 40960.0 4096.0)
|
||||
(+! (-> s0-0 x) (the float (* (- s2-0 (/ arg1 2)) (the int arg3))))
|
||||
(+! (-> s0-0 z) (the float (* (- s1-0 (/ arg2 2)) (the int arg3))))
|
||||
(set! sv-32 (get-process *default-dead-pool* viewer #x4000))
|
||||
(when sv-32
|
||||
(let ((t9-2 (method-of-type viewer activate)))
|
||||
(t9-2
|
||||
(the-as viewer sv-32)
|
||||
*entity-pool*
|
||||
'viewer
|
||||
(the-as pointer #x70004000)
|
||||
(dotimes (s1-0 arg2)
|
||||
(let ((s0-0 (new-stack-vector0)))
|
||||
(position-in-front-of-camera! s0-0 40960.0 4096.0)
|
||||
(+! (-> s0-0 x) (the float (* (- s2-0 (/ arg1 2)) (the int arg3))))
|
||||
(+! (-> s0-0 z) (the float (* (- s1-0 (/ arg2 2)) (the int arg3))))
|
||||
(set! sv-32 (get-process *default-dead-pool* viewer #x4000))
|
||||
(when sv-32
|
||||
(let ((t9-2 (method-of-type viewer activate)))
|
||||
(t9-2 (the-as viewer sv-32) *entity-pool* 'viewer (the-as pointer #x70004000))
|
||||
)
|
||||
(run-now-in-process sv-32 init-viewer-for-other arg0 s0-0)
|
||||
(-> sv-32 ppointer)
|
||||
)
|
||||
)
|
||||
)
|
||||
(run-now-in-process sv-32 init-viewer-for-other arg0 s0-0)
|
||||
(-> sv-32 ppointer)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
#f
|
||||
)
|
||||
|
||||
@@ -266,8 +247,8 @@
|
||||
(defun birth-viewer ((arg0 process) (arg1 entity))
|
||||
(set! (-> arg0 type) viewer)
|
||||
(let ((t9-0 init-entity))
|
||||
viewer
|
||||
(t9-0 arg0 arg1)
|
||||
)
|
||||
viewer
|
||||
(t9-0 arg0 arg1)
|
||||
)
|
||||
(the-as object #t)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user