mirror of
https://github.com/open-goal/jak-project.git
synced 2024-10-20 00:57:44 -04:00
parent
b350525294
commit
d3e7a48639
|
@ -34163,7 +34163,7 @@
|
|||
(define-extern damping-time-adjust (function float float float))
|
||||
(define-extern transform-rigid-body-prims (function collide-shape-prim matrix symbol))
|
||||
(define-extern *rigid-body-object-constants* rigid-body-object-constants)
|
||||
(define-extern rigid-body-object-event-handler (function process int symbol event-message-block none :behavior rigid-body-object))
|
||||
(define-extern rigid-body-object-event-handler (function process int symbol event-message-block object :behavior rigid-body-object))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; rigid-body-queue ;;
|
||||
|
|
|
@ -1419,10 +1419,8 @@ This commonly includes things such as:
|
|||
)
|
||||
)
|
||||
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defbehavior rigid-body-object-event-handler rigid-body-object ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
|
||||
(rigid-body-object-method-46 self (the-as process-drawable arg0) arg1 arg2 arg3)
|
||||
(none)
|
||||
)
|
||||
|
||||
(defstate idle (rigid-body-object)
|
||||
|
@ -1444,10 +1442,7 @@ This commonly includes things such as:
|
|||
|
||||
(defstate active (rigid-body-object)
|
||||
:virtual #t
|
||||
:event (the-as
|
||||
(function process int symbol event-message-block object :behavior rigid-body-object)
|
||||
rigid-body-object-event-handler
|
||||
)
|
||||
:event rigid-body-object-event-handler
|
||||
:trans (behavior ()
|
||||
(if (or (not *target*)
|
||||
(or (< (+ 4096.0 (-> self info extra idle-distance))
|
||||
|
|
|
@ -238,7 +238,7 @@
|
|||
(set! (-> self last-ridden-time) (current-time))
|
||||
)
|
||||
)
|
||||
(the-as object (rigid-body-object-event-handler proc arg1 event-type event))
|
||||
(rigid-body-object-event-handler proc arg1 event-type event)
|
||||
)
|
||||
)
|
||||
|
||||
|
|
|
@ -1410,7 +1410,7 @@ This commonly includes things such as:
|
|||
(set! (-> self last-ridden-time) (current-time))
|
||||
)
|
||||
)
|
||||
(the-as object (rigid-body-object-event-handler proc arg1 event-type event))
|
||||
(rigid-body-object-event-handler proc arg1 event-type event)
|
||||
)
|
||||
:trans (the-as (function none :behavior dig-tipping-rock) rider-trans)
|
||||
:code (the-as (function none :behavior dig-tipping-rock) sleep-code)
|
||||
|
|
|
@ -344,91 +344,79 @@ This commonly includes things such as:
|
|||
)
|
||||
)
|
||||
|
||||
;; WARN: Return type mismatch none vs object.
|
||||
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 109]
|
||||
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 114]
|
||||
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 119]
|
||||
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 142]
|
||||
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 59]
|
||||
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 67]
|
||||
(defbehavior defend-stadium-rift-rider-handler rift-rider ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
|
||||
(let ((v1-0 arg2))
|
||||
(the-as
|
||||
object
|
||||
(cond
|
||||
((= v1-0 'get-position)
|
||||
(let ((s5-1 (new 'stack-no-clear 'vector)))
|
||||
(set! (-> s5-1 quad) (-> self root-override-2 trans quad))
|
||||
(let ((s4-0 (-> self root-override-2 quat)))
|
||||
(case (-> arg3 param 0)
|
||||
(('left)
|
||||
(vector+float*! s5-1 s5-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) s4-0) 24576.0)
|
||||
(vector+float*!
|
||||
(the-as vector (-> arg3 param 1))
|
||||
s5-1
|
||||
(vector-x-quaternion! (new 'stack-no-clear 'vector) s4-0)
|
||||
12288.0
|
||||
)
|
||||
)
|
||||
(('right)
|
||||
(vector+float*!
|
||||
(the-as vector (-> arg3 param 1))
|
||||
s5-1
|
||||
(vector-x-quaternion! (new 'stack-no-clear 'vector) s4-0)
|
||||
-12288.0
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(case arg2
|
||||
(('get-position)
|
||||
(let ((s5-1 (new 'stack-no-clear 'vector)))
|
||||
(set! (-> s5-1 quad) (-> self root-override-2 trans quad))
|
||||
(let ((s4-0 (-> self root-override-2 quat)))
|
||||
(case (-> arg3 param 0)
|
||||
(('left)
|
||||
(vector+float*! s5-1 s5-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) s4-0) 24576.0)
|
||||
(vector+float*!
|
||||
(the-as vector (-> arg3 param 1))
|
||||
s5-1
|
||||
(vector-x-quaternion! (new 'stack-no-clear 'vector) s4-0)
|
||||
12288.0
|
||||
)
|
||||
)
|
||||
(('right)
|
||||
(vector+float*!
|
||||
(the-as vector (-> arg3 param 1))
|
||||
s5-1
|
||||
(vector-x-quaternion! (new 'stack-no-clear 'vector) s4-0)
|
||||
-12288.0
|
||||
)
|
||||
)
|
||||
)
|
||||
(set! (-> (the-as vector (-> arg3 param 1)) y)
|
||||
(-> (get-point-in-path! (-> self path) (new 'stack-no-clear 'vector) (-> self path-pos) 'interp) y)
|
||||
)
|
||||
(-> arg3 param 1)
|
||||
)
|
||||
((= v1-0 'die)
|
||||
(go-virtual defend-stadium-die)
|
||||
)
|
||||
((= v1-0 'touch)
|
||||
(let* ((gp-1 (-> arg3 param 0))
|
||||
(s3-7 arg0)
|
||||
(s4-1 (if (type? s3-7 process-focusable)
|
||||
s3-7
|
||||
)
|
||||
)
|
||||
(set! (-> (the-as vector (-> arg3 param 1)) y)
|
||||
(-> (get-point-in-path! (-> self path) (new 'stack-no-clear 'vector) (-> self path-pos) 'interp) y)
|
||||
)
|
||||
(-> arg3 param 1)
|
||||
)
|
||||
(('die)
|
||||
(go-virtual defend-stadium-die)
|
||||
)
|
||||
(('touch)
|
||||
(let* ((gp-1 (-> arg3 param 0))
|
||||
(s3-7 arg0)
|
||||
(s4-1 (if (type? s3-7 process-focusable)
|
||||
s3-7
|
||||
)
|
||||
)
|
||||
(if (and gp-1
|
||||
s4-1
|
||||
((method-of-type touching-shapes-entry prims-touching-action?)
|
||||
(the-as touching-shapes-entry gp-1)
|
||||
(-> self root-override-2)
|
||||
(collide-action no-standon)
|
||||
(collide-action)
|
||||
)
|
||||
)
|
||||
(if (and gp-1
|
||||
s4-1
|
||||
((method-of-type touching-shapes-entry prims-touching-action?)
|
||||
(the-as touching-shapes-entry gp-1)
|
||||
(-> self root-override-2)
|
||||
(collide-action no-standon)
|
||||
(collide-action)
|
||||
)
|
||||
(not (logtest? (-> self root-override-2 penetrated-by)
|
||||
(-> (the-as collide-shape (-> (the-as process-drawable s4-1) root)) penetrate-using)
|
||||
)
|
||||
)
|
||||
(not (logtest? (-> self root-override-2 penetrated-by)
|
||||
(-> (the-as collide-shape (-> (the-as process-drawable s4-1) root)) penetrate-using)
|
||||
)
|
||||
)
|
||||
)
|
||||
(send-shoves (-> self root-override-2) arg0 (the-as touching-shapes-entry gp-1) 0.7 6144.0 16384.0)
|
||||
)
|
||||
)
|
||||
(send-shoves (-> self root-override-2) arg0 (the-as touching-shapes-entry gp-1) 0.7 6144.0 16384.0)
|
||||
)
|
||||
)
|
||||
((= v1-0 'trans)
|
||||
(-> self root-override-2 trans)
|
||||
)
|
||||
((= v1-0 'quat)
|
||||
(-> self root-override-2 quat)
|
||||
)
|
||||
((= v1-0 'hold)
|
||||
(set! (-> self escort-force (-> arg3 param 0) y)
|
||||
(seek (-> self escort-force (-> arg3 param 0) y) 1.0 (* 2.0 (-> self clock seconds-per-frame)))
|
||||
)
|
||||
)
|
||||
(else
|
||||
(rigid-body-object-event-handler arg0 arg1 arg2 arg3)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(('trans)
|
||||
(-> self root-override-2 trans)
|
||||
)
|
||||
(('quat)
|
||||
(-> self root-override-2 quat)
|
||||
)
|
||||
(('hold)
|
||||
(set! (-> self escort-force (-> arg3 param 0) y)
|
||||
(seek (-> self escort-force (-> arg3 param 0) y) 1.0 (* 2.0 (-> self clock seconds-per-frame)))
|
||||
)
|
||||
)
|
||||
(else
|
||||
(rigid-body-object-event-handler arg0 arg1 arg2 arg3)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
|
8
test/decompiler/reference/jak2/engine/physics/rigid-body_REF.gc
generated
vendored
8
test/decompiler/reference/jak2/engine/physics/rigid-body_REF.gc
generated
vendored
|
@ -882,6 +882,7 @@
|
|||
)
|
||||
|
||||
;; definition for method 10 of type rigid-body-control
|
||||
;; INFO: this function exists in multiple non-identical object files
|
||||
;; WARN: Return type mismatch int vs object.
|
||||
(defmethod rigid-body-control-method-10 rigid-body-control ((obj rigid-body-control) (arg0 rigid-body-object) (arg1 float) (arg2 float))
|
||||
(let* ((s4-1 (max 1 (min 4 (+ (the int (* 0.9999 (/ arg1 arg2))) 1))))
|
||||
|
@ -1525,10 +1526,8 @@ This commonly includes things such as:
|
|||
)
|
||||
|
||||
;; definition for function rigid-body-object-event-handler
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defbehavior rigid-body-object-event-handler rigid-body-object ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
|
||||
(rigid-body-object-method-46 self (the-as process-drawable arg0) arg1 arg2 arg3)
|
||||
(none)
|
||||
)
|
||||
|
||||
;; failed to figure out what this is:
|
||||
|
@ -1552,10 +1551,7 @@ This commonly includes things such as:
|
|||
;; failed to figure out what this is:
|
||||
(defstate active (rigid-body-object)
|
||||
:virtual #t
|
||||
:event (the-as
|
||||
(function process int symbol event-message-block object :behavior rigid-body-object)
|
||||
rigid-body-object-event-handler
|
||||
)
|
||||
:event rigid-body-object-event-handler
|
||||
:trans (behavior ()
|
||||
(if (or (not *target*)
|
||||
(or (< (+ 4096.0 (-> self info extra idle-distance))
|
||||
|
|
2
test/decompiler/reference/jak2/levels/dig/dig-obs_REF.gc
generated
vendored
2
test/decompiler/reference/jak2/levels/dig/dig-obs_REF.gc
generated
vendored
|
@ -265,7 +265,7 @@
|
|||
(set! (-> self last-ridden-time) (current-time))
|
||||
)
|
||||
)
|
||||
(the-as object (rigid-body-object-event-handler proc arg1 event-type event))
|
||||
(rigid-body-object-event-handler proc arg1 event-type event)
|
||||
)
|
||||
)
|
||||
|
||||
|
|
2
test/decompiler/reference/jak2/levels/dig/dig3-obs_REF.gc
generated
vendored
2
test/decompiler/reference/jak2/levels/dig/dig3-obs_REF.gc
generated
vendored
|
@ -1578,7 +1578,7 @@ This commonly includes things such as:
|
|||
(set! (-> self last-ridden-time) (current-time))
|
||||
)
|
||||
)
|
||||
(the-as object (rigid-body-object-event-handler proc arg1 event-type event))
|
||||
(rigid-body-object-event-handler proc arg1 event-type event)
|
||||
)
|
||||
:trans (the-as (function none :behavior dig-tipping-rock) rider-trans)
|
||||
:code (the-as (function none :behavior dig-tipping-rock) sleep-code)
|
||||
|
|
146
test/decompiler/reference/jak2/levels/stadium/stadium-obs_REF.gc
generated
vendored
146
test/decompiler/reference/jak2/levels/stadium/stadium-obs_REF.gc
generated
vendored
|
@ -429,91 +429,79 @@ This commonly includes things such as:
|
|||
|
||||
;; definition for function defend-stadium-rift-rider-handler
|
||||
;; INFO: Used lq/sq
|
||||
;; WARN: Return type mismatch none vs object.
|
||||
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 109]
|
||||
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 114]
|
||||
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 119]
|
||||
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 142]
|
||||
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 59]
|
||||
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 67]
|
||||
(defbehavior defend-stadium-rift-rider-handler rift-rider ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
|
||||
(let ((v1-0 arg2))
|
||||
(the-as
|
||||
object
|
||||
(cond
|
||||
((= v1-0 'get-position)
|
||||
(let ((s5-1 (new 'stack-no-clear 'vector)))
|
||||
(set! (-> s5-1 quad) (-> self root-override-2 trans quad))
|
||||
(let ((s4-0 (-> self root-override-2 quat)))
|
||||
(case (-> arg3 param 0)
|
||||
(('left)
|
||||
(vector+float*! s5-1 s5-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) s4-0) 24576.0)
|
||||
(vector+float*!
|
||||
(the-as vector (-> arg3 param 1))
|
||||
s5-1
|
||||
(vector-x-quaternion! (new 'stack-no-clear 'vector) s4-0)
|
||||
12288.0
|
||||
)
|
||||
)
|
||||
(('right)
|
||||
(vector+float*!
|
||||
(the-as vector (-> arg3 param 1))
|
||||
s5-1
|
||||
(vector-x-quaternion! (new 'stack-no-clear 'vector) s4-0)
|
||||
-12288.0
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(case arg2
|
||||
(('get-position)
|
||||
(let ((s5-1 (new 'stack-no-clear 'vector)))
|
||||
(set! (-> s5-1 quad) (-> self root-override-2 trans quad))
|
||||
(let ((s4-0 (-> self root-override-2 quat)))
|
||||
(case (-> arg3 param 0)
|
||||
(('left)
|
||||
(vector+float*! s5-1 s5-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) s4-0) 24576.0)
|
||||
(vector+float*!
|
||||
(the-as vector (-> arg3 param 1))
|
||||
s5-1
|
||||
(vector-x-quaternion! (new 'stack-no-clear 'vector) s4-0)
|
||||
12288.0
|
||||
)
|
||||
)
|
||||
(('right)
|
||||
(vector+float*!
|
||||
(the-as vector (-> arg3 param 1))
|
||||
s5-1
|
||||
(vector-x-quaternion! (new 'stack-no-clear 'vector) s4-0)
|
||||
-12288.0
|
||||
)
|
||||
)
|
||||
)
|
||||
(set! (-> (the-as vector (-> arg3 param 1)) y)
|
||||
(-> (get-point-in-path! (-> self path) (new 'stack-no-clear 'vector) (-> self path-pos) 'interp) y)
|
||||
)
|
||||
(-> arg3 param 1)
|
||||
)
|
||||
((= v1-0 'die)
|
||||
(go-virtual defend-stadium-die)
|
||||
)
|
||||
((= v1-0 'touch)
|
||||
(let* ((gp-1 (-> arg3 param 0))
|
||||
(s3-7 arg0)
|
||||
(s4-1 (if (type? s3-7 process-focusable)
|
||||
s3-7
|
||||
)
|
||||
)
|
||||
(set! (-> (the-as vector (-> arg3 param 1)) y)
|
||||
(-> (get-point-in-path! (-> self path) (new 'stack-no-clear 'vector) (-> self path-pos) 'interp) y)
|
||||
)
|
||||
(-> arg3 param 1)
|
||||
)
|
||||
(('die)
|
||||
(go-virtual defend-stadium-die)
|
||||
)
|
||||
(('touch)
|
||||
(let* ((gp-1 (-> arg3 param 0))
|
||||
(s3-7 arg0)
|
||||
(s4-1 (if (type? s3-7 process-focusable)
|
||||
s3-7
|
||||
)
|
||||
)
|
||||
(if (and gp-1
|
||||
s4-1
|
||||
((method-of-type touching-shapes-entry prims-touching-action?)
|
||||
(the-as touching-shapes-entry gp-1)
|
||||
(-> self root-override-2)
|
||||
(collide-action no-standon)
|
||||
(collide-action)
|
||||
)
|
||||
)
|
||||
(if (and gp-1
|
||||
s4-1
|
||||
((method-of-type touching-shapes-entry prims-touching-action?)
|
||||
(the-as touching-shapes-entry gp-1)
|
||||
(-> self root-override-2)
|
||||
(collide-action no-standon)
|
||||
(collide-action)
|
||||
)
|
||||
(not (logtest? (-> self root-override-2 penetrated-by)
|
||||
(-> (the-as collide-shape (-> (the-as process-drawable s4-1) root)) penetrate-using)
|
||||
)
|
||||
)
|
||||
(not (logtest? (-> self root-override-2 penetrated-by)
|
||||
(-> (the-as collide-shape (-> (the-as process-drawable s4-1) root)) penetrate-using)
|
||||
)
|
||||
)
|
||||
)
|
||||
(send-shoves (-> self root-override-2) arg0 (the-as touching-shapes-entry gp-1) 0.7 6144.0 16384.0)
|
||||
)
|
||||
)
|
||||
(send-shoves (-> self root-override-2) arg0 (the-as touching-shapes-entry gp-1) 0.7 6144.0 16384.0)
|
||||
)
|
||||
)
|
||||
((= v1-0 'trans)
|
||||
(-> self root-override-2 trans)
|
||||
)
|
||||
((= v1-0 'quat)
|
||||
(-> self root-override-2 quat)
|
||||
)
|
||||
((= v1-0 'hold)
|
||||
(set! (-> self escort-force (-> arg3 param 0) y)
|
||||
(seek (-> self escort-force (-> arg3 param 0) y) 1.0 (* 2.0 (-> self clock seconds-per-frame)))
|
||||
)
|
||||
)
|
||||
(else
|
||||
(rigid-body-object-event-handler arg0 arg1 arg2 arg3)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(('trans)
|
||||
(-> self root-override-2 trans)
|
||||
)
|
||||
(('quat)
|
||||
(-> self root-override-2 quat)
|
||||
)
|
||||
(('hold)
|
||||
(set! (-> self escort-force (-> arg3 param 0) y)
|
||||
(seek (-> self escort-force (-> arg3 param 0) y) 1.0 (* 2.0 (-> self clock seconds-per-frame)))
|
||||
)
|
||||
)
|
||||
(else
|
||||
(rigid-body-object-event-handler arg0 arg1 arg2 arg3)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue