format/j1: reformat recently modified files

This commit is contained in:
Tyler Wilding 2024-06-05 21:06:42 -04:00
parent 209a997717
commit de710e86ad
No known key found for this signature in database
GPG key ID: BF7B068C2FEFD7EF
3 changed files with 106 additions and 235 deletions

View file

@ -233,16 +233,10 @@
(deftype hud-health (hud) (deftype hud-health (hud)
((scale float))) ((scale float)))
(defun part-hud-health-01-func ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 matrix)) (defun part-hud-health-01-func ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 matrix))
(let ((f0-0 (-> *hud-parts* health 0 scale))) (let ((f0-0 (-> *hud-parts* health 0 scale))) (set! (-> arg2 vector 0 w) f0-0) (set! (-> arg2 vector 1 w) f0-0))
(set! (-> arg2 vector 0 w) f0-0)
(set! (-> arg2 vector 1 w) f0-0)
)
(cond (cond
((and *target* (< (-> *target* fact health) 1.0)) ((and *target* (< (-> *target* fact health) 1.0)) (set! (-> arg2 vector 2 w) 32.0))
(set! (-> arg2 vector 2 w) 32.0)
)
(else (else
(let ((f0-3 128.0)) (let ((f0-3 128.0))
;; low health flashing ;; low health flashing
@ -250,44 +244,26 @@
(when (and *target* (= (-> *target* fact health) 1.0)) (when (and *target* (= (-> *target* fact health) 1.0))
(let* ((scaled-frame-counter (the int (* DISPLAY_FPS_RATIO (-> *display* integral-frame-counter)))) (let* ((scaled-frame-counter (the int (* DISPLAY_FPS_RATIO (-> *display* integral-frame-counter))))
(v1-16 (logand scaled-frame-counter 7))) (v1-16 (logand scaled-frame-counter 7)))
(set! f0-3 (if (not (logtest? scaled-frame-counter 8)) (set! f0-3
(if (not (logtest? scaled-frame-counter 8))
(+ 128.0 (* 18.142857 (the float v1-16))) (+ 128.0 (* 18.142857 (the float v1-16)))
(- 255.0 (* 18.142857 (the float v1-16))) (- 255.0 (* 18.142857 (the float v1-16)))))))
)
)
)
)
(set! (-> arg2 vector 2 x) f0-3) (set! (-> arg2 vector 2 x) f0-3)
(set! (-> arg2 vector 2 y) f0-3) (set! (-> arg2 vector 2 y) f0-3)
(set! (-> arg2 vector 2 z) f0-3) (set! (-> arg2 vector 2 z) f0-3))
) (set! (-> arg2 vector 2 w) 128.0)))
(set! (-> arg2 vector 2 w) 128.0)
)
)
0 0
(none)) (none))
(defun part-hud-health-02-func ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 matrix)) (defun part-hud-health-02-func ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 matrix))
(let ((f0-0 (-> *hud-parts* health 0 scale))) (let ((f0-0 (-> *hud-parts* health 0 scale))) (set! (-> arg2 vector 0 w) f0-0) (set! (-> arg2 vector 1 w) f0-0))
(set! (-> arg2 vector 0 w) f0-0) (if (and *target* (< (-> *target* fact health) 2.0)) (set! (-> arg2 vector 2 w) 32.0) (set! (-> arg2 vector 2 w) 128.0))
(set! (-> arg2 vector 1 w) f0-0)
)
(if (and *target* (< (-> *target* fact health) 2.0))
(set! (-> arg2 vector 2 w) 32.0)
(set! (-> arg2 vector 2 w) 128.0)
)
0 0
(none)) (none))
(defun part-hud-health-03-func ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 matrix)) (defun part-hud-health-03-func ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 matrix))
(let ((f0-0 (-> *hud-parts* health 0 scale))) (let ((f0-0 (-> *hud-parts* health 0 scale))) (set! (-> arg2 vector 0 w) f0-0) (set! (-> arg2 vector 1 w) f0-0))
(set! (-> arg2 vector 0 w) f0-0) (if (and *target* (< (-> *target* fact health) 3.0)) (set! (-> arg2 vector 2 w) 32.0) (set! (-> arg2 vector 2 w) 128.0))
(set! (-> arg2 vector 1 w) f0-0)
)
(if (and *target* (< (-> *target* fact health) 3.0))
(set! (-> arg2 vector 2 w) 32.0)
(set! (-> arg2 vector 2 w) 128.0)
)
0 0
(none)) (none))
@ -1082,14 +1058,9 @@
((scale float) ((scale float)
(text-y-offset int32))) (text-y-offset int32)))
(defun part-hud-buzzer-func ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 matrix)) (defun part-hud-buzzer-func ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 matrix))
(let ((f0-0 (-> *hud-parts* buzzers 0 scale))) (let ((f0-0 (-> *hud-parts* buzzers 0 scale))) (set! (-> arg2 vector 0 w) f0-0) (set! (-> arg2 vector 1 w) f0-0))
(set! (-> arg2 vector 0 w) f0-0) (none))
(set! (-> arg2 vector 1 w) f0-0)
)
(none)
)
(defmethod draw-hud ((this hud-buzzers)) (defmethod draw-hud ((this hud-buzzers))
(let ((t9-0 (method-of-type hud draw-hud))) (t9-0 this)) (let ((t9-0 (method-of-type hud draw-hud))) (t9-0 this))
@ -1276,42 +1247,29 @@
(scale-backing float) (scale-backing float)
(scale-blue float))) (scale-blue float)))
(defun calculate-rotation-and-color-for-slice ((arg0 int) (arg1 float) (arg2 int) (arg3 int) (arg4 int) (arg5 matrix)) (defun calculate-rotation-and-color-for-slice ((arg0 int) (arg1 float) (arg2 int) (arg3 int) (arg4 int) (arg5 matrix))
(cond (cond
((>= 0.0 arg1) ((>= 0.0 arg1) (set! (-> arg5 vector 1 z) -16566.045))
(set! (-> arg5 vector 1 z) -16566.045)
)
(else (else
(let ((v1-1 arg0)) (let ((v1-1 arg0))
(cond (cond
((zero? v1-1) ((zero? v1-1)
(if (< 1.0 arg1) (if (< 1.0 arg1)
(set! (-> arg5 vector 1 z) 910.2222) (set! (-> arg5 vector 1 z) 910.2222)
(set! (-> arg5 vector 1 z) (* 182.04445 (+ 5.0 (* 263.0 (- 1.0 arg1))))) (set! (-> arg5 vector 1 z) (* 182.04445 (+ 5.0 (* 263.0 (- 1.0 arg1)))))))
)
)
((= v1-1 1) ((= v1-1 1)
(if (< 0.6666667 arg1) (if (< 0.6666667 arg1)
(set! (-> arg5 vector 1 z) 17294.223) (set! (-> arg5 vector 1 z) 17294.223)
(set! (-> arg5 vector 1 z) (* 182.04445 (+ 95.0 (* 173.0 (- 1.0 (* 1.5 arg1)))))) (set! (-> arg5 vector 1 z) (* 182.04445 (+ 95.0 (* 173.0 (- 1.0 (* 1.5 arg1))))))))
)
)
((= v1-1 2) ((= v1-1 2)
(if (< 0.33333334 arg1) (if (< 0.33333334 arg1)
(set! (-> arg5 vector 1 z) 33678.223) (set! (-> arg5 vector 1 z) 33678.223)
(set! (-> arg5 vector 1 z) (* 182.04445 (+ 185.0 (* 83.0 (- 1.0 (* 3.0 arg1)))))) (set! (-> arg5 vector 1 z) (* 182.04445 (+ 185.0 (* 83.0 (- 1.0 (* 3.0 arg1))))))))))))
)
)
)
)
)
)
;; low eco flashing ;; low eco flashing
;; og:preserve-this modified to support high fps ;; og:preserve-this modified to support high fps
(if (and (< 0.0 arg1) (and (< arg1 0.2) (zero? (logand (the int (* DISPLAY_FPS_RATIO (-> *display* integral-frame-counter))) 4)))) (if (and (< 0.0 arg1)
(set! arg3 (* arg3 2)) (and (< arg1 0.2) (zero? (logand (the int (* DISPLAY_FPS_RATIO (-> *display* integral-frame-counter))) 4))))
) (set! arg3 (* arg3 2)))
(set! (-> arg5 vector 2 x) (the float arg2)) (set! (-> arg5 vector 2 x) (the float arg2))
(set! (-> arg5 vector 2 y) (the float arg3)) (set! (-> arg5 vector 2 y) (the float arg3))
(set! (-> arg5 vector 2 z) (the float arg4)) (set! (-> arg5 vector 2 z) (the float arg4))
@ -1319,138 +1277,66 @@
(none)) (none))
(defun part-hud-eco-timer-01-func ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 matrix)) (defun part-hud-eco-timer-01-func ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 matrix))
(let ((f0-2 (let ((f0-2 (/ (the float
(/ (the float (the-as uint
(the-as uint (- (-> *target* fact eco-timeout) (- (-> *target* fact eco-timeout)
(the-as uint (- (-> *display* game-frame-counter) (-> *target* fact eco-pickup-time))) (the-as uint (- (-> *display* game-frame-counter) (-> *target* fact eco-pickup-time))))))
) (the float (the-as uint (-> *FACT-bank* eco-full-timeout)))))
)
)
(the float (the-as uint (-> *FACT-bank* eco-full-timeout)))
)
)
(a2-1 0) (a2-1 0)
(a3-0 64) (a3-0 64)
(t0-0 128)) (t0-0 128))
(case (-> *target* fact eco-type) (case (-> *target* fact eco-type)
(((pickup-type eco-yellow)) (((pickup-type eco-yellow)) (set! a2-1 128) (set! a3-0 96) (set! t0-0 0))
(set! a2-1 128) (((pickup-type eco-red)) (set! a2-1 128) (set! a3-0 32) (set! t0-0 0))
(set! a3-0 96) (((pickup-type eco-green)) (set! a2-1 0) (set! a3-0 128) (set! t0-0 32)))
(set! t0-0 0) (calculate-rotation-and-color-for-slice 0 f0-2 a2-1 a3-0 t0-0 arg2))
) (let ((f0-3 (-> *hud-parts* power 0 scale-blue))) (set! (-> arg2 vector 0 w) f0-3) (set! (-> arg2 vector 1 w) f0-3))
(((pickup-type eco-red))
(set! a2-1 128)
(set! a3-0 32)
(set! t0-0 0)
)
(((pickup-type eco-green))
(set! a2-1 0)
(set! a3-0 128)
(set! t0-0 32)
)
)
(calculate-rotation-and-color-for-slice 0 f0-2 a2-1 a3-0 t0-0 arg2)
)
(let ((f0-3 (-> *hud-parts* power 0 scale-blue)))
(set! (-> arg2 vector 0 w) f0-3)
(set! (-> arg2 vector 1 w) f0-3)
)
0 0
(none)) (none))
(defun part-hud-eco-timer-02-func ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 matrix)) (defun part-hud-eco-timer-02-func ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 matrix))
(let ((f0-2 (let ((f0-2 (/ (the float
(/ (the float (the-as uint
(the-as uint (- (-> *target* fact eco-timeout) (- (-> *target* fact eco-timeout)
(the-as uint (- (-> *display* game-frame-counter) (-> *target* fact eco-pickup-time))) (the-as uint (- (-> *display* game-frame-counter) (-> *target* fact eco-pickup-time))))))
) (the float (the-as uint (-> *FACT-bank* eco-full-timeout)))))
)
)
(the float (the-as uint (-> *FACT-bank* eco-full-timeout)))
)
)
(a2-1 0) (a2-1 0)
(a3-0 64) (a3-0 64)
(t0-0 128)) (t0-0 128))
(case (-> *target* fact eco-type) (case (-> *target* fact eco-type)
(((pickup-type eco-yellow)) (((pickup-type eco-yellow)) (set! a2-1 128) (set! a3-0 96) (set! t0-0 0))
(set! a2-1 128) (((pickup-type eco-red)) (set! a2-1 128) (set! a3-0 32) (set! t0-0 0))
(set! a3-0 96) (((pickup-type eco-green)) (set! a2-1 0) (set! a3-0 128) (set! t0-0 32)))
(set! t0-0 0) (calculate-rotation-and-color-for-slice 1 f0-2 a2-1 a3-0 t0-0 arg2))
) (let ((f0-3 (-> *hud-parts* power 0 scale-blue))) (set! (-> arg2 vector 0 w) f0-3) (set! (-> arg2 vector 1 w) f0-3))
(((pickup-type eco-red))
(set! a2-1 128)
(set! a3-0 32)
(set! t0-0 0)
)
(((pickup-type eco-green))
(set! a2-1 0)
(set! a3-0 128)
(set! t0-0 32)
)
)
(calculate-rotation-and-color-for-slice 1 f0-2 a2-1 a3-0 t0-0 arg2)
)
(let ((f0-3 (-> *hud-parts* power 0 scale-blue)))
(set! (-> arg2 vector 0 w) f0-3)
(set! (-> arg2 vector 1 w) f0-3)
)
0 0
(none)) (none))
(defun part-hud-eco-timer-03-func ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 matrix)) (defun part-hud-eco-timer-03-func ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 matrix))
(let ((f0-2 (let ((f0-2 (/ (the float
(/ (the float (the-as uint
(the-as uint (- (-> *target* fact eco-timeout) (- (-> *target* fact eco-timeout)
(the-as uint (- (-> *display* game-frame-counter) (-> *target* fact eco-pickup-time))) (the-as uint (- (-> *display* game-frame-counter) (-> *target* fact eco-pickup-time))))))
) (the float (the-as uint (-> *FACT-bank* eco-full-timeout)))))
)
)
(the float (the-as uint (-> *FACT-bank* eco-full-timeout)))
)
)
(a2-1 0) (a2-1 0)
(a3-0 64) (a3-0 64)
(t0-0 128)) (t0-0 128))
(case (-> *target* fact eco-type) (case (-> *target* fact eco-type)
(((pickup-type eco-yellow)) (((pickup-type eco-yellow)) (set! a2-1 128) (set! a3-0 96) (set! t0-0 0))
(set! a2-1 128) (((pickup-type eco-red)) (set! a2-1 128) (set! a3-0 32) (set! t0-0 0))
(set! a3-0 96) (((pickup-type eco-green)) (set! a2-1 0) (set! a3-0 128) (set! t0-0 32)))
(set! t0-0 0) (calculate-rotation-and-color-for-slice 2 f0-2 a2-1 a3-0 t0-0 arg2))
) (let ((f0-3 (-> *hud-parts* power 0 scale-blue))) (set! (-> arg2 vector 0 w) f0-3) (set! (-> arg2 vector 1 w) f0-3))
(((pickup-type eco-red))
(set! a2-1 128)
(set! a3-0 32)
(set! t0-0 0)
)
(((pickup-type eco-green))
(set! a2-1 0)
(set! a3-0 128)
(set! t0-0 32)
)
)
(calculate-rotation-and-color-for-slice 2 f0-2 a2-1 a3-0 t0-0 arg2)
)
(let ((f0-3 (-> *hud-parts* power 0 scale-blue)))
(set! (-> arg2 vector 0 w) f0-3)
(set! (-> arg2 vector 1 w) f0-3)
)
0 0
(none)) (none))
(defun part-hud-eco-timer-backing-func ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 matrix)) (defun part-hud-eco-timer-backing-func ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 matrix))
(let ((f0-0 (-> *hud-parts* power 0 scale-backing))) (let ((f0-0 (-> *hud-parts* power 0 scale-backing))) (set! (-> arg2 vector 0 w) f0-0) (set! (-> arg2 vector 1 w) f0-0))
(set! (-> arg2 vector 0 w) f0-0)
(set! (-> arg2 vector 1 w) f0-0)
)
0 0
(none)) (none))
(defun part-hud-eco-timer-func ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 matrix)) (defun part-hud-eco-timer-func ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 matrix))
(let ((f0-0 (-> *hud-parts* power 0 scale-timer))) (let ((f0-0 (-> *hud-parts* power 0 scale-timer))) (set! (-> arg2 vector 0 w) f0-0) (set! (-> arg2 vector 1 w) f0-0))
(set! (-> arg2 vector 0 w) f0-0)
(set! (-> arg2 vector 1 w) f0-0)
)
0 0
(none)) (none))

View file

@ -1,5 +1,6 @@
;;-*-Lisp-*- ;;-*-Lisp-*-
(in-package goal) (in-package goal)
(deftype test-actor (process-drawable) (deftype test-actor (process-drawable)
((root collide-shape-moving :override) ((root collide-shape-moving :override)
(birth-time time-frame) (birth-time time-frame)
@ -19,23 +20,15 @@
test-actor test-actor
test-actor-lod0-jg test-actor-lod0-jg
test-actor-idle-ja test-actor-idle-ja
((test-actor-lod0-mg (meters 9999999)))
:bounds (static-spherem 0 0 0 4.5)
:texture-level 2)
(defskelgroup *test-actor-sg* test-actor test-actor-lod0-jg test-actor-idle-ja
((test-actor-lod0-mg (meters 9999999))) ((test-actor-lod0-mg (meters 9999999)))
:bounds (static-spherem 0 0 0 5) :bounds (static-spherem 0 0 0 5)
:texture-level 2 :texture-level 2)
)
(defmethod init-collision! ((this test-actor)) (defmethod init-collision! ((this test-actor))
(let ((cshape (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (let ((cshape (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player))))
(set! (-> cshape dynam) (copy *standard-dynamics* 'process)) (set! (-> cshape dynam) (copy *standard-dynamics* 'process))
(set! (-> cshape reaction) default-collision-reaction) (set! (-> cshape reaction) default-collision-reaction)
(set! (-> cshape no-reaction) (set! (-> cshape no-reaction) (the (function collide-shape-moving collide-shape-intersect vector vector none) nothing))
(the (function collide-shape-moving collide-shape-intersect vector vector none) nothing)
)
(let ((cgroup (new 'process 'collide-shape-prim-group cshape (the uint 1) 0))) (let ((cgroup (new 'process 'collide-shape-prim-group cshape (the uint 1) 0)))
(set! (-> cgroup prim-core collide-as) (collide-kind ground-object)) (set! (-> cgroup prim-core collide-as) (collide-kind ground-object))
(set! (-> cgroup collide-with) (collide-kind target)) (set! (-> cgroup collide-with) (collide-kind target))
@ -50,8 +43,7 @@
(set! (-> mesh prim-core offense) (collide-offense indestructible)) (set! (-> mesh prim-core offense) (collide-offense indestructible))
(set! (-> mesh transform-index) 0) (set! (-> mesh transform-index) 0)
(set-vector! (-> mesh local-sphere) 0.0 (meters 0) 0.0 (meters 5)) (set-vector! (-> mesh local-sphere) 0.0 (meters 0) 0.0 (meters 5))
(append-prim cgroup mesh) (append-prim cgroup mesh))
)
; (let ((sphere (new 'process 'collide-shape-prim-sphere cshape (the uint 0)))) ; (let ((sphere (new 'process 'collide-shape-prim-sphere cshape (the uint 0))))
; (set! (-> sphere prim-core collide-as) (collide-kind enemy)) ; (set! (-> sphere prim-core collide-as) (collide-kind enemy))
; (set! (-> sphere collide-with) (collide-kind target)) ; (set! (-> sphere collide-with) (collide-kind target))
@ -101,29 +93,25 @@
(defstate idle (test-actor) (defstate idle (test-actor)
:virtual #t :virtual #t
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) :event
(behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message (case message
(('attack 'touch) (('attack 'touch)
; (if (= (-> proc type) target) ; (if (= (-> proc type) target)
; (send-event proc 'attack #f (static-attack-info ((shove-up (meters 2.5)) (shove-back (meters 7.5))))) ; (send-event proc 'attack #f (static-attack-info ((shove-up (meters 2.5)) (shove-back (meters 7.5)))))
; ) ; )
#t #t)))
) :code
) (behavior ()
)
:code (behavior ()
(loop (loop
(quaternion-rotate-y! (-> self root quat) (-> self root quat) (* (degrees 45) (seconds-per-frame))) (quaternion-rotate-y! (-> self root quat) (-> self root quat) (* (degrees 45) (seconds-per-frame)))
(let ((bob (-> self bob-amount))) (let ((bob (-> self bob-amount)))
(when (< 0.0 bob) (when (< 0.0 bob)
(set! (-> self root trans y) (set! (-> self root trans y)
(+ (-> self base y) (+ (-> self base y)
(* bob (sin (* 109.22667 (the float (mod (+ (- (current-time) (-> self birth-time)) (-> self bob-offset)) (seconds 2)))))) (* bob
) (sin (* 109.22667 (the float (mod (+ (- (current-time) (-> self birth-time)) (-> self bob-offset)) (seconds 2))))))))
) (update-transforms! (-> self root))))
(update-transforms! (-> self root))
)
)
; (debug-draw-tris (-> (res-lump-struct (-> self draw art-group data 0 extra) 'collide-mesh-group (array collide-mesh)) 0) self 2) ; (debug-draw-tris (-> (res-lump-struct (-> self draw art-group data 0 extra) 'collide-mesh-group (array collide-mesh)) 0) self 2)
; (dotimes (i (-> self node-list length)) ; (dotimes (i (-> self node-list length))
; (let* ((joint (-> self node-list data i)) (jpos (vector<-cspace! (new-stack-vector0) joint))) ; (let* ((joint (-> self node-list data i)) (jpos (vector<-cspace! (new-stack-vector0) joint)))
@ -131,8 +119,5 @@
; (add-debug-text-sphere (!= (-> joint joint) #f) (bucket-id debug) jpos (meters 0.1) (-> joint joint name) (static-rgba 0 #xff 0 #x40)) ; (add-debug-text-sphere (!= (-> joint joint) #f) (bucket-id debug) jpos (meters 0.1) (-> joint joint name) (static-rgba 0 #xff 0 #x40))
; ) ; )
; ) ; )
(suspend) (suspend)))
) :post transform-post)
)
:post transform-post
)

View file

@ -47,7 +47,7 @@ def compare_directories(base_dir, compare_dir):
print(f" - {file}") print(f" - {file}")
# Usage example # Usage example
base_directory = './out/jak1/obj_before' base_directory = './out/jak1/obj'
compare_directory = './out/jak1/obj' compare_directory = './out/jak1/obj_master'
print(f'Comparing {base_directory} with {compare_directory}') print(f'Comparing {base_directory} with {compare_directory}')
compare_directories(base_directory, compare_directory) compare_directories(base_directory, compare_directory)