mirror of
https://github.com/open-goal/jak-project.git
synced 2024-10-20 00:57:44 -04:00
decomp: finish tippy
This commit is contained in:
parent
ad695ed12b
commit
4560feba0b
|
@ -22451,8 +22451,8 @@
|
|||
:size-assert #x3c
|
||||
:flag-assert #xb0000003c
|
||||
(:methods
|
||||
(dummy-9 () none 9)
|
||||
(dummy-10 () none 10)
|
||||
(reset! (_type_ process-drawable float float) none 9)
|
||||
(TODO-RENAME-10 (_type_ process-drawable vector) symbol 10)
|
||||
)
|
||||
)
|
||||
|
||||
|
|
|
@ -1413,6 +1413,10 @@
|
|||
["L508", "float", true]
|
||||
],
|
||||
|
||||
"tippy": [
|
||||
["L7", "float", true]
|
||||
],
|
||||
|
||||
// please do not add things after this entry! git is dumb.
|
||||
"object-file-that-doesnt-actually-exist-and-i-just-put-this-here-to-prevent-merge-conflicts-with-this-file": []
|
||||
}
|
||||
|
|
|
@ -821,5 +821,9 @@
|
|||
[16, "sphere"]
|
||||
],
|
||||
|
||||
"(method 10 tippy)": [
|
||||
[16, "vector"]
|
||||
],
|
||||
|
||||
"placeholder-do-not-add-below!": []
|
||||
}
|
||||
|
|
|
@ -5,3 +5,102 @@
|
|||
;; name in dgo: tippy
|
||||
;; dgos: GAME, COMMON, L1
|
||||
|
||||
;; definition of type tippy
|
||||
(deftype tippy (structure)
|
||||
((axis vector :inline :offset-assert 0)
|
||||
(angle float :offset-assert 16)
|
||||
(orig quaternion :inline :offset-assert 32)
|
||||
(dist-ratio float :offset-assert 48)
|
||||
(damping float :offset-assert 52)
|
||||
(1-damping float :offset-assert 56)
|
||||
)
|
||||
:method-count-assert 11
|
||||
:size-assert #x3c
|
||||
:flag-assert #xb0000003c
|
||||
(:methods
|
||||
(reset! (_type_ process-drawable float float) none 9)
|
||||
(TODO-RENAME-10 (_type_ process-drawable vector) symbol 10)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 3 of type tippy
|
||||
(defmethod inspect tippy ((obj tippy))
|
||||
(format #t "[~8x] ~A~%" obj 'tippy)
|
||||
(format #t "~Taxis: #<vector @ #x~X>~%" (-> obj axis))
|
||||
(format #t "~Tangle: ~f~%" (-> obj angle))
|
||||
(format #t "~Torig: #<quaternion @ #x~X>~%" (-> obj orig))
|
||||
(format #t "~Tdist-ratio: ~f~%" (-> obj dist-ratio))
|
||||
(format #t "~Tdamping: ~f~%" (-> obj damping))
|
||||
(format #t "~T1-damping: ~f~%" (-> obj 1-damping))
|
||||
obj
|
||||
)
|
||||
|
||||
;; definition for method 9 of type tippy
|
||||
;; INFO: Return type mismatch int vs none.
|
||||
(defmethod
|
||||
reset!
|
||||
tippy
|
||||
((obj tippy) (arg0 process-drawable) (arg1 float) (arg2 float))
|
||||
(set-vector! (-> obj axis) 0.0 0.0 0.0 1.0)
|
||||
(set! (-> obj angle) 0.0)
|
||||
(quaternion-copy! (-> obj orig) (-> arg0 root quat))
|
||||
(set! (-> obj dist-ratio) arg1)
|
||||
(set! (-> obj damping) arg2)
|
||||
(set! (-> obj 1-damping) (- 1.0 arg2))
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for method 10 of type tippy
|
||||
(defmethod
|
||||
TODO-RENAME-10
|
||||
tippy
|
||||
((obj tippy) (arg0 process-drawable) (arg1 vector))
|
||||
(let ((s4-0 #t))
|
||||
(cond
|
||||
(arg1
|
||||
(let ((s3-0 (new 'stack-no-clear 'vector)))
|
||||
0.0
|
||||
(set! (-> s3-0 x) (- (-> arg1 z) (-> arg0 root trans z)))
|
||||
(set! (-> s3-0 y) 0.0)
|
||||
(set! (-> s3-0 z) (- (-> arg0 root trans x) (-> arg1 x)))
|
||||
(let ((f0-6 (vector-length s3-0)))
|
||||
(vector-float*! s3-0 s3-0 (/ 1.0 f0-6))
|
||||
(let ((f30-0 (* f0-6 (-> obj dist-ratio))))
|
||||
(set!
|
||||
(-> obj axis x)
|
||||
(+
|
||||
(* (-> obj 1-damping) (-> obj axis x))
|
||||
(* (-> obj damping) (-> s3-0 x))
|
||||
)
|
||||
)
|
||||
(set! (-> obj axis y) 0.0)
|
||||
(set!
|
||||
(-> obj axis z)
|
||||
(+
|
||||
(* (-> obj 1-damping) (-> obj axis z))
|
||||
(* (-> obj damping) (-> s3-0 z))
|
||||
)
|
||||
)
|
||||
(vector-normalize! (-> obj axis) 1.0)
|
||||
(set!
|
||||
(-> obj angle)
|
||||
(+ (* (-> obj 1-damping) (-> obj angle)) (* (-> obj damping) f30-0))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(else
|
||||
(set! (-> obj angle) (* (-> obj 1-damping) (-> obj angle)))
|
||||
(when (< (-> obj angle) 182.04445)
|
||||
(set! (-> obj angle) 0.0)
|
||||
(set! s4-0 #f)
|
||||
)
|
||||
)
|
||||
)
|
||||
(quaternion-vector-angle! (-> arg0 root quat) (-> obj axis) (-> obj angle))
|
||||
(quaternion*! (-> arg0 root quat) (-> arg0 root quat) (-> obj orig))
|
||||
s4-0
|
||||
)
|
||||
)
|
||||
|
|
106
test/decompiler/reference/levels/common/tippy_REF.gc
Normal file
106
test/decompiler/reference/levels/common/tippy_REF.gc
Normal file
|
@ -0,0 +1,106 @@
|
|||
;;-*-Lisp-*-
|
||||
(in-package goal)
|
||||
|
||||
;; definition of type tippy
|
||||
(deftype tippy (structure)
|
||||
((axis vector :inline :offset-assert 0)
|
||||
(angle float :offset-assert 16)
|
||||
(orig quaternion :inline :offset-assert 32)
|
||||
(dist-ratio float :offset-assert 48)
|
||||
(damping float :offset-assert 52)
|
||||
(1-damping float :offset-assert 56)
|
||||
)
|
||||
:method-count-assert 11
|
||||
:size-assert #x3c
|
||||
:flag-assert #xb0000003c
|
||||
(:methods
|
||||
(reset! (_type_ process-drawable float float) none 9)
|
||||
(TODO-RENAME-10 (_type_ process-drawable vector) symbol 10)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 3 of type tippy
|
||||
(defmethod inspect tippy ((obj tippy))
|
||||
(format #t "[~8x] ~A~%" obj 'tippy)
|
||||
(format #t "~Taxis: #<vector @ #x~X>~%" (-> obj axis))
|
||||
(format #t "~Tangle: ~f~%" (-> obj angle))
|
||||
(format #t "~Torig: #<quaternion @ #x~X>~%" (-> obj orig))
|
||||
(format #t "~Tdist-ratio: ~f~%" (-> obj dist-ratio))
|
||||
(format #t "~Tdamping: ~f~%" (-> obj damping))
|
||||
(format #t "~T1-damping: ~f~%" (-> obj 1-damping))
|
||||
obj
|
||||
)
|
||||
|
||||
;; definition for method 9 of type tippy
|
||||
;; INFO: Return type mismatch int vs none.
|
||||
(defmethod
|
||||
reset!
|
||||
tippy
|
||||
((obj tippy) (arg0 process-drawable) (arg1 float) (arg2 float))
|
||||
(set-vector! (-> obj axis) 0.0 0.0 0.0 1.0)
|
||||
(set! (-> obj angle) 0.0)
|
||||
(quaternion-copy! (-> obj orig) (-> arg0 root quat))
|
||||
(set! (-> obj dist-ratio) arg1)
|
||||
(set! (-> obj damping) arg2)
|
||||
(set! (-> obj 1-damping) (- 1.0 arg2))
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for method 10 of type tippy
|
||||
(defmethod
|
||||
TODO-RENAME-10
|
||||
tippy
|
||||
((obj tippy) (arg0 process-drawable) (arg1 vector))
|
||||
(let ((s4-0 #t))
|
||||
(cond
|
||||
(arg1
|
||||
(let ((s3-0 (new 'stack-no-clear 'vector)))
|
||||
0.0
|
||||
(set! (-> s3-0 x) (- (-> arg1 z) (-> arg0 root trans z)))
|
||||
(set! (-> s3-0 y) 0.0)
|
||||
(set! (-> s3-0 z) (- (-> arg0 root trans x) (-> arg1 x)))
|
||||
(let ((f0-6 (vector-length s3-0)))
|
||||
(vector-float*! s3-0 s3-0 (/ 1.0 f0-6))
|
||||
(let ((f30-0 (* f0-6 (-> obj dist-ratio))))
|
||||
(set!
|
||||
(-> obj axis x)
|
||||
(+
|
||||
(* (-> obj 1-damping) (-> obj axis x))
|
||||
(* (-> obj damping) (-> s3-0 x))
|
||||
)
|
||||
)
|
||||
(set! (-> obj axis y) 0.0)
|
||||
(set!
|
||||
(-> obj axis z)
|
||||
(+
|
||||
(* (-> obj 1-damping) (-> obj axis z))
|
||||
(* (-> obj damping) (-> s3-0 z))
|
||||
)
|
||||
)
|
||||
(vector-normalize! (-> obj axis) 1.0)
|
||||
(set!
|
||||
(-> obj angle)
|
||||
(+ (* (-> obj 1-damping) (-> obj angle)) (* (-> obj damping) f30-0))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(else
|
||||
(set! (-> obj angle) (* (-> obj 1-damping) (-> obj angle)))
|
||||
(when (< (-> obj angle) 182.04445)
|
||||
(set! (-> obj angle) 0.0)
|
||||
(set! s4-0 #f)
|
||||
)
|
||||
)
|
||||
)
|
||||
(quaternion-vector-angle! (-> arg0 root quat) (-> obj axis) (-> obj angle))
|
||||
(quaternion*! (-> arg0 root quat) (-> arg0 root quat) (-> obj orig))
|
||||
s4-0
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in a new issue