g/j2: revert signature changes to cam-setting-data, fix camera regressions (#2975)

Co-authored-by: Hat Kid <6624576+Hat-Kid@users.noreply.github.com>
This commit is contained in:
Tyler Wilding
2023-09-10 14:15:22 -06:00
committed by GitHub
parent 49e798f88c
commit 1bd30bce84
6 changed files with 93 additions and 90 deletions
+2 -2
View File
@@ -8265,7 +8265,7 @@
(butt-handle handle)
(butt-angle float)
(extra-follow-height float)
(1Tinterp-time-priority uint32)
(interp-time-priority uint32)
(string-max-length-default symbol)
(string-min-length-default symbol)
(string-max-height-default symbol)
@@ -8277,7 +8277,7 @@
:flag-assert #xb0000030c
(:methods
(cam-setting-data-method-9 (_type_ engine engine-pers engine) _type_ 9)
(cam-setting-data-method-10 (_type_ object (pointer process) object int) _type_ 10)
(cam-setting-data-method-10 (_type_ object (pointer process) float int) _type_ 10)
)
)
+3 -2
View File
@@ -277,7 +277,7 @@
(butt-handle handle :offset-assert 336)
(butt-angle float :offset-assert 344)
(extra-follow-height float :offset-assert 348)
(1Tinterp-time-priority uint32 :offset-assert 352)
(interp-time-priority uint32 :offset-assert 352)
(string-max-length-default symbol :offset-assert 356)
(string-min-length-default symbol :offset-assert 360)
(string-max-height-default symbol :offset-assert 364)
@@ -289,7 +289,7 @@
:flag-assert #xb0000030c
(:methods
(cam-setting-data-method-9 (_type_ engine engine-pers engine) _type_ 9)
(cam-setting-data-method-10 (_type_ object (pointer process) object int) _type_ 10)
(cam-setting-data-method-10 (_type_ object (pointer process) float int) _type_ 10)
)
)
@@ -340,6 +340,7 @@
)
)
;; og:preserve-this added macro
(defmacro language? (&rest langs)
"is the current language any of the ones specified?"
`(or ,@(apply (lambda (x) `(= (-> *setting-control* user-default language) (language-enum ,x))) langs)))
+43 -42
View File
@@ -489,7 +489,7 @@
obj
(-> s3-0 param 0)
(the-as (pointer process) (-> s3-0 param 1))
(-> s3-0 param 2)
(the-as float (-> s3-0 param 2))
(the-as int (-> s3-0 param 3))
)
(set! s3-0 (-> s3-0 next))
@@ -509,7 +509,7 @@
obj
s1-0
(the-as (pointer process) (-> (the-as connection s3-1) param1))
(-> (the-as connection s3-1) param2)
(the-as float (-> (the-as connection s3-1) param2))
(-> (the-as connection s3-1) param3)
)
)
@@ -519,7 +519,7 @@
obj
s1-0
(the-as (pointer process) (-> (the-as connection s3-1) param1))
(-> (the-as connection s3-1) param2)
(the-as float (-> (the-as connection s3-1) param2))
(-> (the-as connection s3-1) param3)
)
)
@@ -537,7 +537,7 @@
obj
(-> (the-as connection v1-21) param0)
(the-as (pointer process) (-> (the-as connection v1-21) param1))
(-> (the-as connection v1-21) param2)
(the-as float (-> (the-as connection v1-21) param2))
(-> (the-as connection v1-21) param3)
)
(set! v1-21 s4-1)
@@ -547,12 +547,12 @@
obj
)
(defmethod cam-setting-data-method-10 cam-setting-data ((obj cam-setting-data) (arg0 object) (arg1 (pointer process)) (arg2 object) (arg3 int))
(defmethod cam-setting-data-method-10 cam-setting-data ((obj cam-setting-data) (arg0 object) (arg1 (pointer process)) (arg2 float) (arg3 int))
(case arg0
(('fov)
(if (= arg1 'rel)
(set! (-> obj fov) (* (-> obj fov) (the-as float arg2)))
(set! (-> obj fov) (the-as float arg2))
(set! (-> obj fov) (* (-> obj fov) arg2))
(set! (-> obj fov) arg2)
)
)
(('pov-handle)
@@ -570,14 +570,14 @@
(case arg1
(('low)
(if (-> obj string-max-length-default)
(set! (-> obj string-max-length) (the-as float arg2))
(set! (-> obj string-max-length) arg2)
)
)
(('rel)
(set! (-> obj string-max-length) (* (-> obj string-max-length) (the-as float arg2)))
(set! (-> obj string-max-length) (* (-> obj string-max-length) arg2))
)
(else
(set! (-> obj string-max-length) (the-as float arg2))
(set! (-> obj string-max-length) arg2)
)
)
(set! (-> obj string-default) #f)
@@ -587,14 +587,14 @@
(case arg1
(('low)
(if (-> obj string-min-length-default)
(set! (-> obj string-min-length) (the-as float arg2))
(set! (-> obj string-min-length) arg2)
)
)
(('rel)
(set! (-> obj string-min-length) (* (-> obj string-min-length) (the-as float arg2)))
(set! (-> obj string-min-length) (* (-> obj string-min-length) arg2))
)
(else
(set! (-> obj string-min-length) (the-as float arg2))
(set! (-> obj string-min-length) arg2)
)
)
(set! (-> obj string-default) #f)
@@ -604,14 +604,14 @@
(case arg1
(('low)
(if (-> obj string-max-height-default)
(set! (-> obj string-max-height) (the-as float arg2))
(set! (-> obj string-max-height) arg2)
)
)
(('rel)
(set! (-> obj string-max-height) (* (-> obj string-max-height) (the-as float arg2)))
(set! (-> obj string-max-height) (* (-> obj string-max-height) arg2))
)
(else
(set! (-> obj string-max-height) (the-as float arg2))
(set! (-> obj string-max-height) arg2)
)
)
(set! (-> obj string-default) #f)
@@ -621,32 +621,32 @@
(case arg1
(('low)
(if (-> obj string-min-height-default)
(set! (-> obj string-min-height) (the-as float arg2))
(set! (-> obj string-min-height) arg2)
)
)
(('rel)
(set! (-> obj string-min-height) (* (-> obj string-min-height) (the-as float arg2)))
(set! (-> obj string-min-height) (* (-> obj string-min-height) arg2))
)
(else
(set! (-> obj string-min-height) (the-as float arg2))
(set! (-> obj string-min-height) arg2)
)
)
(set! (-> obj string-default) #f)
(set! (-> obj string-min-height-default) #f)
)
(('string-cliff-height)
(set! (-> obj string-cliff-height) (the-as float arg2))
(set! (-> obj string-cliff-height) arg2)
(set! (-> obj string-default) #f)
)
(('string-camera-ceiling)
(set! (-> obj string-camera-ceiling) (the-as float arg2))
(set! (-> obj string-camera-ceiling) arg2)
(set! (-> obj string-default) #f)
)
(('gun-max-height)
(set! (-> obj gun-max-height) (the-as float arg2))
(set! (-> obj gun-max-height) arg2)
)
(('gun-min-height)
(set! (-> obj gun-min-height) (the-as float arg2))
(set! (-> obj gun-min-height) arg2)
)
(('string-local-down)
(vector-normalize-copy! (-> obj string-local-down) (the-as vector arg2) 1.0)
@@ -674,31 +674,32 @@
(logior! (-> obj slave-options) (cam-slave-options VERTICAL_FOLLOW_MATCHES_CAMERA))
)
(('matrix-blend-max-angle)
(set! (-> obj matrix-blend-max-angle) (the-as float arg2))
(set! (-> obj matrix-blend-max-angle) arg2)
)
(('matrix-blend-max-partial)
(set! (-> obj matrix-blend-max-partial) (the-as float arg2))
(set! (-> obj matrix-blend-max-partial) arg2)
)
(('string-spline-max-move-player)
(set! (-> obj string-spline-max-move-player) (the-as float arg2))
;; og:preserve-this fixed copypasta bug from original game
(('string-spline-max-move)
(set! (-> obj string-spline-max-move) arg2)
)
(('string-spline-accel)
(set! (-> obj string-spline-accel) (the-as float arg2))
(set! (-> obj string-spline-accel) arg2)
)
(('string-spline-max-move-player)
(set! (-> obj string-spline-max-move-player) (the-as float arg2))
(set! (-> obj string-spline-max-move-player) arg2)
)
(('string-spline-accel-player)
(set! (-> obj string-spline-accel-player) (the-as float arg2))
(set! (-> obj string-spline-accel-player) arg2)
)
(('target-height)
(set! (-> obj target-height) (the-as float arg2))
(set! (-> obj target-height) arg2)
)
(('head-offset)
(set! (-> obj head-offset) (the-as float arg2))
(set! (-> obj head-offset) arg2)
)
(('foot-offset)
(set! (-> obj foot-offset) (the-as float arg2))
(set! (-> obj foot-offset) arg2)
)
(('teleport-on-entity-change)
(set! (-> obj teleport-on-entity-change) (the-as symbol arg2))
@@ -757,9 +758,9 @@
)
)
)
(when (>= f0-34 (the float (-> obj 1Tinterp-time-priority)))
(when (>= f0-34 (the float (-> obj interp-time-priority)))
(set! (-> obj interp-time) (the-as uint (the int arg2)))
(set! (-> obj 1Tinterp-time-priority) (the-as uint (the int f0-34)))
(set! (-> obj interp-time-priority) (the-as uint (the int f0-34)))
)
)
)
@@ -792,12 +793,12 @@
(let ((a0-122 (new 'static 'handle :process arg1 :pid arg3)))
(when (handle->process a0-122)
(set! (-> obj butt-handle) a0-122)
(set! (-> obj butt-angle) (the-as float arg2))
(set! (-> obj butt-angle) arg2)
)
)
)
(('extra-follow-height)
(set! (-> obj extra-follow-height) (the-as float arg2))
(set! (-> obj extra-follow-height) arg2)
)
)
obj
@@ -1278,16 +1279,16 @@
((or (= (-> s5-1 cam-mode) cam-eye) (= (-> s4-1 cam-mode) cam-eye))
(set! (-> s4-1 no-intro) #t)
(set! (-> s4-1 interp-time) (the-as uint 60))
(set! (-> s4-1 1Tinterp-time-priority) (the-as uint 2))
(set! (-> s4-1 interp-time-priority) (the-as uint 2))
)
((= (-> s4-1 cam-mode) cam-endlessfall)
(set! (-> s4-1 no-intro) #t)
(set! (-> s4-1 interp-time) (the-as uint 30))
(set! (-> s4-1 1Tinterp-time-priority) (the-as uint 2))
(set! (-> s4-1 interp-time-priority) (the-as uint 2))
)
((or (= (-> s5-1 cam-mode) cam-free-floating) (= (-> s4-1 cam-mode) cam-free-floating))
(set! (-> s4-1 interp-time) (the-as uint 0))
(set! (-> s4-1 1Tinterp-time-priority) (the-as uint 2))
(set! (-> s4-1 interp-time-priority) (the-as uint 2))
)
)
(set! (-> s5-1 entity-name) (-> s4-1 entity-name))
@@ -1341,7 +1342,7 @@
(set! (-> s5-1 mouse-input) (-> s4-1 mouse-input))
(set! (-> s5-1 cpad1-skip-buttons) (-> s4-1 cpad1-skip-buttons))
(set! (-> s5-1 interp-time) (-> s4-1 interp-time))
(set! (-> s5-1 1Tinterp-time-priority) (-> s4-1 1Tinterp-time-priority))
(set! (-> s5-1 interp-time-priority) (-> s4-1 interp-time-priority))
(set! (-> s5-1 string-use-startup-vector) (-> s4-1 string-use-startup-vector))
(set! (-> s5-1 string-startup-vector quad) (-> s4-1 string-startup-vector quad))
(set! (-> s5-1 use-look-at-point) (-> s4-1 use-look-at-point))
@@ -1615,7 +1616,7 @@
(set! (-> v1-127 mouse-input) #f)
(set! (-> v1-127 cpad1-skip-buttons) #f)
(set! (-> v1-127 interp-time) (the-as uint 450))
(set! (-> v1-127 1Tinterp-time-priority) (the-as uint 0))
(set! (-> v1-127 interp-time-priority) (the-as uint 0))
(set! (-> v1-127 string-use-startup-vector) #f)
(set! (-> v1-127 use-look-at-point) #f)
(set! (-> v1-127 use-point-of-interest) #f)
+3 -3
View File
@@ -352,7 +352,7 @@
(butt-handle handle :offset-assert 336)
(butt-angle float :offset-assert 344)
(extra-follow-height float :offset-assert 348)
(1Tinterp-time-priority uint32 :offset-assert 352)
(interp-time-priority uint32 :offset-assert 352)
(string-max-length-default symbol :offset-assert 356)
(string-min-length-default symbol :offset-assert 360)
(string-max-height-default symbol :offset-assert 364)
@@ -364,7 +364,7 @@
:flag-assert #xb0000030c
(:methods
(cam-setting-data-method-9 (_type_ engine engine-pers engine) _type_ 9)
(cam-setting-data-method-10 (_type_ object (pointer process) object int) _type_ 10)
(cam-setting-data-method-10 (_type_ object (pointer process) float int) _type_ 10)
)
)
@@ -527,7 +527,7 @@
(format #t "~1Tbutt-handle: ~D~%" (-> obj butt-handle))
(format #t "~1Tbutt-angle: ~f~%" (-> obj butt-angle))
(format #t "~1Textra-follow-height: ~f~%" (-> obj extra-follow-height))
(format #t "~1Tinterp-time-priority: ~D~%" (-> obj 1Tinterp-time-priority))
(format #t "~1Tinterp-time-priority: ~D~%" (-> obj interp-time-priority))
(format #t "~1Tstring-max-length-default: ~A~%" (-> obj string-max-length-default))
(format #t "~1Tstring-min-length-default: ~A~%" (-> obj string-min-length-default))
(format #t "~1Tstring-max-height-default: ~A~%" (-> obj string-max-height-default))
+41 -41
View File
@@ -484,7 +484,7 @@
obj
(-> s3-0 param 0)
(the-as (pointer process) (-> s3-0 param 1))
(-> s3-0 param 2)
(the-as float (-> s3-0 param 2))
(the-as int (-> s3-0 param 3))
)
(set! s3-0 (-> s3-0 next))
@@ -504,7 +504,7 @@
obj
s1-0
(the-as (pointer process) (-> (the-as connection s3-1) param1))
(-> (the-as connection s3-1) param2)
(the-as float (-> (the-as connection s3-1) param2))
(-> (the-as connection s3-1) param3)
)
)
@@ -514,7 +514,7 @@
obj
s1-0
(the-as (pointer process) (-> (the-as connection s3-1) param1))
(-> (the-as connection s3-1) param2)
(the-as float (-> (the-as connection s3-1) param2))
(-> (the-as connection s3-1) param3)
)
)
@@ -532,7 +532,7 @@
obj
(-> (the-as connection v1-21) param0)
(the-as (pointer process) (-> (the-as connection v1-21) param1))
(-> (the-as connection v1-21) param2)
(the-as float (-> (the-as connection v1-21) param2))
(-> (the-as connection v1-21) param3)
)
(set! v1-21 s4-1)
@@ -544,12 +544,12 @@
;; definition for method 10 of type cam-setting-data
;; INFO: Used lq/sq
(defmethod cam-setting-data-method-10 cam-setting-data ((obj cam-setting-data) (arg0 object) (arg1 (pointer process)) (arg2 object) (arg3 int))
(defmethod cam-setting-data-method-10 cam-setting-data ((obj cam-setting-data) (arg0 object) (arg1 (pointer process)) (arg2 float) (arg3 int))
(case arg0
(('fov)
(if (= arg1 'rel)
(set! (-> obj fov) (* (-> obj fov) (the-as float arg2)))
(set! (-> obj fov) (the-as float arg2))
(set! (-> obj fov) (* (-> obj fov) arg2))
(set! (-> obj fov) arg2)
)
)
(('pov-handle)
@@ -567,14 +567,14 @@
(case arg1
(('low)
(if (-> obj string-max-length-default)
(set! (-> obj string-max-length) (the-as float arg2))
(set! (-> obj string-max-length) arg2)
)
)
(('rel)
(set! (-> obj string-max-length) (* (-> obj string-max-length) (the-as float arg2)))
(set! (-> obj string-max-length) (* (-> obj string-max-length) arg2))
)
(else
(set! (-> obj string-max-length) (the-as float arg2))
(set! (-> obj string-max-length) arg2)
)
)
(set! (-> obj string-default) #f)
@@ -584,14 +584,14 @@
(case arg1
(('low)
(if (-> obj string-min-length-default)
(set! (-> obj string-min-length) (the-as float arg2))
(set! (-> obj string-min-length) arg2)
)
)
(('rel)
(set! (-> obj string-min-length) (* (-> obj string-min-length) (the-as float arg2)))
(set! (-> obj string-min-length) (* (-> obj string-min-length) arg2))
)
(else
(set! (-> obj string-min-length) (the-as float arg2))
(set! (-> obj string-min-length) arg2)
)
)
(set! (-> obj string-default) #f)
@@ -601,14 +601,14 @@
(case arg1
(('low)
(if (-> obj string-max-height-default)
(set! (-> obj string-max-height) (the-as float arg2))
(set! (-> obj string-max-height) arg2)
)
)
(('rel)
(set! (-> obj string-max-height) (* (-> obj string-max-height) (the-as float arg2)))
(set! (-> obj string-max-height) (* (-> obj string-max-height) arg2))
)
(else
(set! (-> obj string-max-height) (the-as float arg2))
(set! (-> obj string-max-height) arg2)
)
)
(set! (-> obj string-default) #f)
@@ -618,32 +618,32 @@
(case arg1
(('low)
(if (-> obj string-min-height-default)
(set! (-> obj string-min-height) (the-as float arg2))
(set! (-> obj string-min-height) arg2)
)
)
(('rel)
(set! (-> obj string-min-height) (* (-> obj string-min-height) (the-as float arg2)))
(set! (-> obj string-min-height) (* (-> obj string-min-height) arg2))
)
(else
(set! (-> obj string-min-height) (the-as float arg2))
(set! (-> obj string-min-height) arg2)
)
)
(set! (-> obj string-default) #f)
(set! (-> obj string-min-height-default) #f)
)
(('string-cliff-height)
(set! (-> obj string-cliff-height) (the-as float arg2))
(set! (-> obj string-cliff-height) arg2)
(set! (-> obj string-default) #f)
)
(('string-camera-ceiling)
(set! (-> obj string-camera-ceiling) (the-as float arg2))
(set! (-> obj string-camera-ceiling) arg2)
(set! (-> obj string-default) #f)
)
(('gun-max-height)
(set! (-> obj gun-max-height) (the-as float arg2))
(set! (-> obj gun-max-height) arg2)
)
(('gun-min-height)
(set! (-> obj gun-min-height) (the-as float arg2))
(set! (-> obj gun-min-height) arg2)
)
(('string-local-down)
(vector-normalize-copy! (-> obj string-local-down) (the-as vector arg2) 1.0)
@@ -671,31 +671,31 @@
(logior! (-> obj slave-options) (cam-slave-options VERTICAL_FOLLOW_MATCHES_CAMERA))
)
(('matrix-blend-max-angle)
(set! (-> obj matrix-blend-max-angle) (the-as float arg2))
(set! (-> obj matrix-blend-max-angle) arg2)
)
(('matrix-blend-max-partial)
(set! (-> obj matrix-blend-max-partial) (the-as float arg2))
(set! (-> obj matrix-blend-max-partial) arg2)
)
(('string-spline-max-move-player)
(set! (-> obj string-spline-max-move-player) (the-as float arg2))
(set! (-> obj string-spline-max-move-player) arg2)
)
(('string-spline-accel)
(set! (-> obj string-spline-accel) (the-as float arg2))
(set! (-> obj string-spline-accel) arg2)
)
(('string-spline-max-move-player)
(set! (-> obj string-spline-max-move-player) (the-as float arg2))
(set! (-> obj string-spline-max-move-player) arg2)
)
(('string-spline-accel-player)
(set! (-> obj string-spline-accel-player) (the-as float arg2))
(set! (-> obj string-spline-accel-player) arg2)
)
(('target-height)
(set! (-> obj target-height) (the-as float arg2))
(set! (-> obj target-height) arg2)
)
(('head-offset)
(set! (-> obj head-offset) (the-as float arg2))
(set! (-> obj head-offset) arg2)
)
(('foot-offset)
(set! (-> obj foot-offset) (the-as float arg2))
(set! (-> obj foot-offset) arg2)
)
(('teleport-on-entity-change)
(set! (-> obj teleport-on-entity-change) (the-as symbol arg2))
@@ -754,9 +754,9 @@
)
)
)
(when (>= f0-34 (the float (-> obj 1Tinterp-time-priority)))
(when (>= f0-34 (the float (-> obj interp-time-priority)))
(set! (-> obj interp-time) (the-as uint (the int arg2)))
(set! (-> obj 1Tinterp-time-priority) (the-as uint (the int f0-34)))
(set! (-> obj interp-time-priority) (the-as uint (the int f0-34)))
)
)
)
@@ -789,12 +789,12 @@
(let ((a0-122 (new 'static 'handle :process arg1 :pid arg3)))
(when (handle->process a0-122)
(set! (-> obj butt-handle) a0-122)
(set! (-> obj butt-angle) (the-as float arg2))
(set! (-> obj butt-angle) arg2)
)
)
)
(('extra-follow-height)
(set! (-> obj extra-follow-height) (the-as float arg2))
(set! (-> obj extra-follow-height) arg2)
)
)
obj
@@ -1288,16 +1288,16 @@
((or (= (-> s5-1 cam-mode) cam-eye) (= (-> s4-1 cam-mode) cam-eye))
(set! (-> s4-1 no-intro) #t)
(set! (-> s4-1 interp-time) (the-as uint 60))
(set! (-> s4-1 1Tinterp-time-priority) (the-as uint 2))
(set! (-> s4-1 interp-time-priority) (the-as uint 2))
)
((= (-> s4-1 cam-mode) cam-endlessfall)
(set! (-> s4-1 no-intro) #t)
(set! (-> s4-1 interp-time) (the-as uint 30))
(set! (-> s4-1 1Tinterp-time-priority) (the-as uint 2))
(set! (-> s4-1 interp-time-priority) (the-as uint 2))
)
((or (= (-> s5-1 cam-mode) cam-free-floating) (= (-> s4-1 cam-mode) cam-free-floating))
(set! (-> s4-1 interp-time) (the-as uint 0))
(set! (-> s4-1 1Tinterp-time-priority) (the-as uint 2))
(set! (-> s4-1 interp-time-priority) (the-as uint 2))
)
)
(set! (-> s5-1 entity-name) (-> s4-1 entity-name))
@@ -1351,7 +1351,7 @@
(set! (-> s5-1 mouse-input) (-> s4-1 mouse-input))
(set! (-> s5-1 cpad1-skip-buttons) (-> s4-1 cpad1-skip-buttons))
(set! (-> s5-1 interp-time) (-> s4-1 interp-time))
(set! (-> s5-1 1Tinterp-time-priority) (-> s4-1 1Tinterp-time-priority))
(set! (-> s5-1 interp-time-priority) (-> s4-1 interp-time-priority))
(set! (-> s5-1 string-use-startup-vector) (-> s4-1 string-use-startup-vector))
(set! (-> s5-1 string-startup-vector quad) (-> s4-1 string-startup-vector quad))
(set! (-> s5-1 use-look-at-point) (-> s4-1 use-look-at-point))
@@ -1623,7 +1623,7 @@
(set! (-> v1-127 mouse-input) #f)
(set! (-> v1-127 cpad1-skip-buttons) #f)
(set! (-> v1-127 interp-time) (the-as uint 450))
(set! (-> v1-127 1Tinterp-time-priority) (the-as uint 0))
(set! (-> v1-127 interp-time-priority) (the-as uint 0))
(set! (-> v1-127 string-use-startup-vector) #f)
(set! (-> v1-127 use-look-at-point) #f)
(set! (-> v1-127 use-point-of-interest) #f)
+1
View File
@@ -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))))