mirror of
https://github.com/open-goal/jak-project.git
synced 2024-10-20 11:26:18 -04:00
c162c66118
This PR does two main things: 1. Work through the main low-hanging fruit issues in the formatter keeping it from feeling mature and usable 2. Iterate and prove that point by formatting all of the Jak 1 code base. **This has removed around 100K lines in total.** - The decompiler will now format it's results for jak 1 to keep things from drifting back to where they were. This is controlled by a new config flag `format_code`. How am I confident this hasn't broken anything?: - I compiled the entire project and stored it's `out/jak1/obj` files separately - I then recompiled the project after formatting and wrote a script that md5's each file and compares it (`compare-compilation-outputs.py` - The results (eventually) were the same: ![Screenshot 2024-05-25 132900](https://github.com/open-goal/jak-project/assets/13153231/015e6f20-8d19-49b7-9951-97fa88ddc6c2) > This proves that the only difference before and after is non-critical whitespace for all code/macros that is actually in use. I'm still aware of improvements that could be made to the formatter, as well as general optimization of it's performance. But in general these are for rare or non-critical situations in my opinion and I'll work through them before doing Jak 2. The vast majority looks great and is working properly at this point. Those known issues are the following if you are curious: ![image](https://github.com/open-goal/jak-project/assets/13153231/0edfaba1-6d36-40f5-ab23-0642209867c4)
106 lines
3.5 KiB
Common Lisp
106 lines
3.5 KiB
Common Lisp
;;-*-Lisp-*-
|
|
(in-package goal)
|
|
(bundles "INT.DGO")
|
|
(require "engine/common-obs/process-taskable.gc")
|
|
|
|
;; DECOMP BEGINS
|
|
|
|
(deftype evilbro (process-taskable)
|
|
((evilsis entity-actor)))
|
|
|
|
(defskelgroup *evilbro-intro-sg*
|
|
evilbro
|
|
evilbro-lod0-jg
|
|
evilbro-idle-ja
|
|
((evilbro-lod0-mg (meters 999999)))
|
|
:bounds (static-spherem 0 0 0 4)
|
|
:shadow evilbro-shadow-mg)
|
|
|
|
(defmethod play-anim! ((this evilbro) (arg0 symbol))
|
|
(cond
|
|
(arg0
|
|
(close-specific-task! (game-task leaving-misty) (task-status need-introduction))
|
|
(send-event (-> this evilsis extra process) 'clone (process->handle this)))
|
|
(else (set! (-> this will-talk) #t)))
|
|
(the-as basic (new 'static 'spool-anim :name "evilbro-misty-end" :index 5 :parts 9 :command-list '())))
|
|
|
|
(defmethod get-art-elem ((this evilbro))
|
|
(-> this draw art-group data 3))
|
|
|
|
(defstate play-anim (evilbro)
|
|
:virtual #t
|
|
:exit
|
|
(behavior ()
|
|
(send-event (-> self evilsis extra process) 'end-mode)
|
|
((-> (method-of-type process-taskable play-anim) exit))))
|
|
|
|
(defstate idle (evilbro)
|
|
:virtual #t
|
|
:code
|
|
(behavior ()
|
|
(if (!= (ja-group) (get-art-elem self)) (ja-channel-push! 1 (seconds 0.05)))
|
|
(loop
|
|
(ja-no-eval :group! evilbro-idle-ja :num! (seek!) :frame-num 0.0)
|
|
(until (ja-done? 0)
|
|
(suspend)
|
|
(ja :num! (seek!)))
|
|
(let ((gp-0 (current-time)))
|
|
(while (let ((s5-0 (current-time))
|
|
(f30-0 300.0)
|
|
(f28-0 0.16)
|
|
(f26-0 0.17000002))
|
|
(< (- s5-0 (the-as time-frame (the int (* f30-0 (+ f28-0 (* f26-0 (rand-float-gen))))))) gp-0))
|
|
(suspend)))
|
|
(ja-no-eval :group! (ja-group) :num! (seek! (ja-aframe 0.0 0)) :frame-num (ja-aframe 16.0 0))
|
|
(until (ja-done? 0)
|
|
(suspend)
|
|
(ja :num! (seek! (ja-aframe 0.0 0))))
|
|
(let ((gp-3 (current-time)))
|
|
(while (let ((s5-1 (current-time))
|
|
(f30-1 300.0)
|
|
(f28-1 0.16)
|
|
(f26-1 0.17000002))
|
|
(< (- s5-1 (the-as time-frame (the int (* f30-1 (+ f28-1 (* f26-1 (rand-float-gen))))))) gp-3))
|
|
(suspend))))))
|
|
|
|
(defmethod init-from-entity! ((this evilbro) (arg0 entity-actor))
|
|
(process-taskable-method-40 this arg0 *evilbro-intro-sg* 3 40 (new 'static 'vector :w 4096.0) 5)
|
|
(set! (-> this tasks) (get-task-control (game-task leaving-misty)))
|
|
(set! (-> this evilsis) (entity-actor-lookup arg0 'alt-actor 0))
|
|
(process-taskable-method-42 this)
|
|
(none))
|
|
|
|
(deftype evilsis (process-taskable) ())
|
|
|
|
(defskelgroup *evilsis-intro-sg*
|
|
evilsis
|
|
evilsis-lod0-jg
|
|
evilsis-idle-ja
|
|
((evilsis-lod0-mg (meters 999999)))
|
|
:bounds (static-spherem 0 0 0 4)
|
|
:shadow evilsis-shadow-mg)
|
|
|
|
(defmethod play-anim! ((this evilsis) (arg0 symbol))
|
|
(if arg0
|
|
(format 0
|
|
"ERROR: <GMJ>: ~S playing anim for task status ~S~%"
|
|
(-> this name)
|
|
(task-status->string (current-status (-> this tasks)))))
|
|
(the-as basic (get-art-elem this)))
|
|
|
|
(defmethod get-art-elem ((this evilsis))
|
|
(-> this draw art-group data 3))
|
|
|
|
(defstate idle (evilsis)
|
|
:virtual #t
|
|
:trans
|
|
(behavior ()
|
|
(set! (-> self will-talk) #f)
|
|
((-> (method-of-type process-taskable idle) trans))))
|
|
|
|
(defmethod init-from-entity! ((this evilsis) (arg0 entity-actor))
|
|
(process-taskable-method-40 this arg0 *evilsis-intro-sg* 3 0 (new 'static 'vector :w 4096.0) 5)
|
|
(set! (-> this tasks) (get-task-control (game-task leaving-misty)))
|
|
(process-taskable-method-42 this)
|
|
(none))
|