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)
((scale float)))
(defun part-hud-health-01-func ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 matrix))
(let ((f0-0 (-> *hud-parts* health 0 scale)))
(set! (-> arg2 vector 0 w) f0-0)
(set! (-> arg2 vector 1 w) f0-0)
)
(let ((f0-0 (-> *hud-parts* health 0 scale))) (set! (-> arg2 vector 0 w) f0-0) (set! (-> arg2 vector 1 w) f0-0))
(cond
((and *target* (< (-> *target* fact health) 1.0))
(set! (-> arg2 vector 2 w) 32.0)
)
((and *target* (< (-> *target* fact health) 1.0)) (set! (-> arg2 vector 2 w) 32.0))
(else
(let ((f0-3 128.0))
;; low health flashing
@ -250,44 +244,26 @@
(when (and *target* (= (-> *target* fact health) 1.0))
(let* ((scaled-frame-counter (the int (* DISPLAY_FPS_RATIO (-> *display* integral-frame-counter))))
(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)))
(- 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 y) f0-3)
(set! (-> arg2 vector 2 z) f0-3)
)
(set! (-> arg2 vector 2 w) 128.0)
)
)
(set! (-> arg2 vector 2 z) f0-3))
(set! (-> arg2 vector 2 w) 128.0)))
0
(none))
(defun part-hud-health-02-func ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 matrix))
(let ((f0-0 (-> *hud-parts* health 0 scale)))
(set! (-> arg2 vector 0 w) f0-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)
)
(let ((f0-0 (-> *hud-parts* health 0 scale))) (set! (-> arg2 vector 0 w) f0-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
(none))
(defun part-hud-health-03-func ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 matrix))
(let ((f0-0 (-> *hud-parts* health 0 scale)))
(set! (-> arg2 vector 0 w) f0-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)
)
(let ((f0-0 (-> *hud-parts* health 0 scale))) (set! (-> arg2 vector 0 w) f0-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
(none))
@ -1082,14 +1058,9 @@
((scale float)
(text-y-offset int32)))
(defun part-hud-buzzer-func ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 matrix))
(let ((f0-0 (-> *hud-parts* buzzers 0 scale)))
(set! (-> arg2 vector 0 w) f0-0)
(set! (-> arg2 vector 1 w) f0-0)
)
(none)
)
(let ((f0-0 (-> *hud-parts* buzzers 0 scale))) (set! (-> arg2 vector 0 w) f0-0) (set! (-> arg2 vector 1 w) f0-0))
(none))
(defmethod draw-hud ((this hud-buzzers))
(let ((t9-0 (method-of-type hud draw-hud))) (t9-0 this))
@ -1276,42 +1247,29 @@
(scale-backing float)
(scale-blue float)))
(defun calculate-rotation-and-color-for-slice ((arg0 int) (arg1 float) (arg2 int) (arg3 int) (arg4 int) (arg5 matrix))
(cond
((>= 0.0 arg1)
(set! (-> arg5 vector 1 z) -16566.045)
)
((>= 0.0 arg1) (set! (-> arg5 vector 1 z) -16566.045))
(else
(let ((v1-1 arg0))
(cond
((zero? v1-1)
(if (< 1.0 arg1)
(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)
(if (< 0.6666667 arg1)
(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)
(if (< 0.33333334 arg1)
(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
;; 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))))
(set! arg3 (* arg3 2))
)
(if (and (< 0.0 arg1)
(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 y) (the float arg3))
(set! (-> arg5 vector 2 z) (the float arg4))
@ -1319,138 +1277,66 @@
(none))
(defun part-hud-eco-timer-01-func ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 matrix))
(let ((f0-2
(/ (the float
(the-as uint (- (-> *target* fact eco-timeout)
(the-as uint (- (-> *display* game-frame-counter) (-> *target* fact eco-pickup-time)))
)
)
)
(the float (the-as uint (-> *FACT-bank* eco-full-timeout)))
)
)
(let ((f0-2 (/ (the float
(the-as uint
(- (-> *target* fact eco-timeout)
(the-as uint (- (-> *display* game-frame-counter) (-> *target* fact eco-pickup-time))))))
(the float (the-as uint (-> *FACT-bank* eco-full-timeout)))))
(a2-1 0)
(a3-0 64)
(t0-0 128))
(case (-> *target* fact eco-type)
(((pickup-type eco-yellow))
(set! a2-1 128)
(set! a3-0 96)
(set! t0-0 0)
)
(((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)
)
(((pickup-type eco-yellow)) (set! a2-1 128) (set! a3-0 96) (set! t0-0 0))
(((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
(none))
(defun part-hud-eco-timer-02-func ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 matrix))
(let ((f0-2
(/ (the float
(the-as uint (- (-> *target* fact eco-timeout)
(the-as uint (- (-> *display* game-frame-counter) (-> *target* fact eco-pickup-time)))
)
)
)
(the float (the-as uint (-> *FACT-bank* eco-full-timeout)))
)
)
(let ((f0-2 (/ (the float
(the-as uint
(- (-> *target* fact eco-timeout)
(the-as uint (- (-> *display* game-frame-counter) (-> *target* fact eco-pickup-time))))))
(the float (the-as uint (-> *FACT-bank* eco-full-timeout)))))
(a2-1 0)
(a3-0 64)
(t0-0 128))
(case (-> *target* fact eco-type)
(((pickup-type eco-yellow))
(set! a2-1 128)
(set! a3-0 96)
(set! t0-0 0)
)
(((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)
)
(((pickup-type eco-yellow)) (set! a2-1 128) (set! a3-0 96) (set! t0-0 0))
(((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
(none))
(defun part-hud-eco-timer-03-func ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 matrix))
(let ((f0-2
(/ (the float
(the-as uint (- (-> *target* fact eco-timeout)
(the-as uint (- (-> *display* game-frame-counter) (-> *target* fact eco-pickup-time)))
)
)
)
(the float (the-as uint (-> *FACT-bank* eco-full-timeout)))
)
)
(let ((f0-2 (/ (the float
(the-as uint
(- (-> *target* fact eco-timeout)
(the-as uint (- (-> *display* game-frame-counter) (-> *target* fact eco-pickup-time))))))
(the float (the-as uint (-> *FACT-bank* eco-full-timeout)))))
(a2-1 0)
(a3-0 64)
(t0-0 128))
(case (-> *target* fact eco-type)
(((pickup-type eco-yellow))
(set! a2-1 128)
(set! a3-0 96)
(set! t0-0 0)
)
(((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)
)
(((pickup-type eco-yellow)) (set! a2-1 128) (set! a3-0 96) (set! t0-0 0))
(((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
(none))
(defun part-hud-eco-timer-backing-func ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 matrix))
(let ((f0-0 (-> *hud-parts* power 0 scale-backing)))
(set! (-> arg2 vector 0 w) f0-0)
(set! (-> arg2 vector 1 w) f0-0)
)
(let ((f0-0 (-> *hud-parts* power 0 scale-backing))) (set! (-> arg2 vector 0 w) f0-0) (set! (-> arg2 vector 1 w) f0-0))
0
(none))
(defun part-hud-eco-timer-func ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 matrix))
(let ((f0-0 (-> *hud-parts* power 0 scale-timer)))
(set! (-> arg2 vector 0 w) f0-0)
(set! (-> arg2 vector 1 w) f0-0)
)
(let ((f0-0 (-> *hud-parts* power 0 scale-timer))) (set! (-> arg2 vector 0 w) f0-0) (set! (-> arg2 vector 1 w) f0-0))
0
(none))

View file

@ -1,5 +1,6 @@
;;-*-Lisp-*-
(in-package goal)
(deftype test-actor (process-drawable)
((root collide-shape-moving :override)
(birth-time time-frame)
@ -19,23 +20,15 @@
test-actor
test-actor-lod0-jg
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)))
:bounds (static-spherem 0 0 0 5)
:texture-level 2
)
:texture-level 2)
(defmethod init-collision! ((this test-actor))
(let ((cshape (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player))))
(set! (-> cshape dynam) (copy *standard-dynamics* 'process))
(set! (-> cshape reaction) default-collision-reaction)
(set! (-> cshape no-reaction)
(the (function collide-shape-moving collide-shape-intersect vector vector none) nothing)
)
(set! (-> cshape no-reaction) (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)))
(set! (-> cgroup prim-core collide-as) (collide-kind ground-object))
(set! (-> cgroup collide-with) (collide-kind target))
@ -50,8 +43,7 @@
(set! (-> mesh prim-core offense) (collide-offense indestructible))
(set! (-> mesh transform-index) 0)
(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))))
; (set! (-> sphere prim-core collide-as) (collide-kind enemy))
; (set! (-> sphere collide-with) (collide-kind target))
@ -101,29 +93,25 @@
(defstate idle (test-actor)
: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
(('attack 'touch)
; (if (= (-> proc type) target)
; (send-event proc 'attack #f (static-attack-info ((shove-up (meters 2.5)) (shove-back (meters 7.5)))))
; )
#t
)
)
)
:code (behavior ()
#t)))
:code
(behavior ()
(loop
(quaternion-rotate-y! (-> self root quat) (-> self root quat) (* (degrees 45) (seconds-per-frame)))
(let ((bob (-> self bob-amount)))
(when (< 0.0 bob)
(set! (-> self root trans y)
(+ (-> self base y)
(* bob (sin (* 109.22667 (the float (mod (+ (- (current-time) (-> self birth-time)) (-> self bob-offset)) (seconds 2))))))
)
)
(update-transforms! (-> self root))
)
)
(* bob
(sin (* 109.22667 (the float (mod (+ (- (current-time) (-> self birth-time)) (-> self bob-offset)) (seconds 2))))))))
(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)
; (dotimes (i (-> self node-list length))
; (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))
; )
; )
(suspend)
)
)
:post transform-post
)
(suspend)))
:post transform-post)

View file

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