Skip to content

Commit

Permalink
g/j2: Update some vehicle related naming (#3419)
Browse files Browse the repository at this point in the history
While looking into #3289
I renamed a few things
  • Loading branch information
xTVaser authored Mar 10, 2024
1 parent 4ca84f9 commit d9d09a8
Show file tree
Hide file tree
Showing 10 changed files with 74 additions and 71 deletions.
14 changes: 7 additions & 7 deletions decompiler/config/jak2/all-types.gc
Original file line number Diff line number Diff line change
Expand Up @@ -51999,21 +51999,21 @@ Consists of a header and a list of [[merc-effect]]s."
(vehicle-method-75 (_type_) float) ;; 75
(vehicle-method-76 (_type_ int uint) none) ;; 76
(vehicle-method-77 (_type_) none) ;; 77
(vehicle-method-78 (_type_ int) none) ;; 78
(prepare-zone-transition (_type_ int) none) ;; 78
(vehicle-method-79 (_type_) none) ;; 79
(vehicle-method-80 (_type_) none) ;; 80
(vehicle-method-81 (_type_) none) ;; 81
(switch-zone-high! (_type_) none) ;; 80
(switch-zone-low! (_type_) none) ;; 81
(vehicle-method-82 (_type_) none) ;; 82
(vehicle-method-83 (_type_) none) ;; 83
(draw-thruster (_type_ vector vector float float) none) ;; 84
(draw-thrusters (_type_) none) ;; 85
(update-joint-mods (_type_) none) ;; 86
(vehicle-method-87 (_type_) none) ;; 87
(vehicle-method-88 (_type_) none) ;; 88
(vehicle-method-89 (_type_) none) ;; 89
(vehicle-method-90 (_type_) none) ;; 90
(vehicle-method-91 (_type_) none) ;; 91
(vehicle-method-92 (_type_) none) ;; 92
(enable-bike-mode (_type_) none) ;; 89
(disable-bike-mode (_type_) none) ;; 90
(enable-rapid-camera-tracking (_type_) none) ;; 91
(disable-rapid-camera-tracking (_type_) none) ;; 92
(vehicle-method-93 (_type_) none) ;; 93
(vehicle-method-94 (_type_) none) ;; 94
(vehicle-method-95 (_type_ vector) none) ;; 95
Expand Down
2 changes: 1 addition & 1 deletion goal_src/jak2/levels/city/traffic/vehicle/vehicle-guard.gc
Original file line number Diff line number Diff line change
Expand Up @@ -1060,7 +1060,7 @@
)
(when (zero? (-> this flight-level-index))
(if (logtest? (-> this flags) (rigid-body-object-flag riding))
(vehicle-method-80 this)
(switch-zone-high! this)
)
)
0
Expand Down
14 changes: 7 additions & 7 deletions goal_src/jak2/levels/city/traffic/vehicle/vehicle-h.gc
Original file line number Diff line number Diff line change
Expand Up @@ -374,21 +374,21 @@
(vehicle-method-75 (_type_) float)
(vehicle-method-76 (_type_ int uint) none)
(vehicle-method-77 (_type_) none)
(vehicle-method-78 (_type_ int) none)
(prepare-zone-transition (_type_ int) none)
(vehicle-method-79 (_type_) none)
(vehicle-method-80 (_type_) none)
(vehicle-method-81 (_type_) none)
(switch-zone-high! (_type_) none)
(switch-zone-low! (_type_) none)
(vehicle-method-82 (_type_) none)
(vehicle-method-83 (_type_) none)
(draw-thruster (_type_ vector vector float float) none)
(draw-thrusters (_type_) none)
(update-joint-mods (_type_) none)
(vehicle-method-87 (_type_) none)
(vehicle-method-88 (_type_) none)
(vehicle-method-89 (_type_) none)
(vehicle-method-90 (_type_) none)
(vehicle-method-91 (_type_) none)
(vehicle-method-92 (_type_) none)
(enable-bike-mode (_type_) none)
(disable-bike-mode (_type_) none)
(enable-rapid-camera-tracking (_type_) none)
(disable-rapid-camera-tracking (_type_) none)
(vehicle-method-93 (_type_) none)
(vehicle-method-94 (_type_) none)
(vehicle-method-95 (_type_ vector) none)
Expand Down
31 changes: 16 additions & 15 deletions goal_src/jak2/levels/city/traffic/vehicle/vehicle-util.gc
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@
(define *pilot-edge-grab-info* (new 'static 'pilot-edge-grab-info))

(defmethod deactivate ((this vehicle))
"Make a process dead, clean it up, remove it from the active pool, and return to dead pool."
(vehicle-method-110 this)
(call-parent-method this)
(none)
Expand Down Expand Up @@ -749,13 +750,13 @@ This commonly includes things such as:
(none)
)

(defmethod vehicle-method-78 ((this vehicle) (arg0 int))
(defmethod prepare-zone-transition ((this vehicle) (arg0 int))
(set! (-> this flight-level-index-prev) (-> this flight-level-index))
(set! (-> this flight-level-index) arg0)
(logior! (-> this flags) (rigid-body-object-flag flight-level-transition camera-rapid-track-mode))
(logclear! (-> this flags) (rigid-body-object-flag flight-level-transition-ending))
(set-time! (-> this transition-time))
(vehicle-method-91 this)
(enable-rapid-camera-tracking this)
0
(none)
)
Expand Down Expand Up @@ -904,8 +905,8 @@ This commonly includes things such as:
(set-setting! 'head-offset 'abs (-> this info camera-head-offset) 0)
(set-setting! 'foot-offset 'abs (-> this info camera-foot-offset) 0)
(set-setting! 'target-height 'abs (meters 0) 0)
(vehicle-method-92 this)
(vehicle-method-89 this)
(disable-rapid-camera-tracking this)
(enable-bike-mode this)
(persist-with-delay *setting-control* 'mode-name (seconds 0.2) 'mode-name 'cam-fixed 0.0 0)
(persist-with-delay *setting-control* 'interp-time (seconds 0.05) 'interp-time 'abs 0.0 0)
(let ((v1-27 (process->ppointer this)))
Expand All @@ -926,8 +927,8 @@ This commonly includes things such as:

(defmethod vehicle-method-88 ((this vehicle))
(when (logtest? (rigid-body-object-flag camera) (-> this flags))
(vehicle-method-92 this)
(vehicle-method-90 this)
(disable-rapid-camera-tracking this)
(disable-bike-mode this)
(remove-setting! 'rapid-tracking)
(remove-setting! 'fov)
(remove-setting! 'string-camera-ceiling)
Expand Down Expand Up @@ -959,7 +960,7 @@ This commonly includes things such as:
(none)
)

(defmethod vehicle-method-89 ((this vehicle))
(defmethod enable-bike-mode ((this vehicle))
(when (not (logtest? (rigid-body-object-flag camera-bike-mode) (-> this flags)))
(logior! (-> this flags) (rigid-body-object-flag camera-bike-mode))
(set-setting! 'bike-mode #f 0.0 0)
Expand All @@ -968,7 +969,7 @@ This commonly includes things such as:
(none)
)

(defmethod vehicle-method-90 ((this vehicle))
(defmethod disable-bike-mode ((this vehicle))
(when (logtest? (rigid-body-object-flag camera-bike-mode) (-> this flags))
(logclear! (-> this flags) (rigid-body-object-flag camera-bike-mode))
(remove-setting! 'bike-mode)
Expand All @@ -977,7 +978,7 @@ This commonly includes things such as:
(none)
)

(defmethod vehicle-method-91 ((this vehicle))
(defmethod enable-rapid-camera-tracking ((this vehicle))
(when (logtest? (-> this flags) (rigid-body-object-flag player-driving))
(logior! (-> this flags) (rigid-body-object-flag camera-rapid-track-mode))
(set-setting! 'rapid-tracking #f 0.0 0)
Expand All @@ -986,7 +987,7 @@ This commonly includes things such as:
(none)
)

(defmethod vehicle-method-92 ((this vehicle))
(defmethod disable-rapid-camera-tracking ((this vehicle))
(when (logtest? (-> this flags) (rigid-body-object-flag player-driving))
(logclear! (-> this flags) (rigid-body-object-flag camera-rapid-track-mode))
(remove-setting! 'rapid-tracking)
Expand Down Expand Up @@ -1071,13 +1072,13 @@ This commonly includes things such as:
0
)

(defmethod vehicle-method-80 ((this vehicle))
(defmethod switch-zone-high! ((this vehicle))
(when (and (logtest? (-> this info flags) 64) (< (-> this flight-level-index) 1))
1
(cond
((< (+ 8192.0 (-> this rbody state position y)) (-> this flight-level))
(sound-play "bike-up")
(vehicle-method-78 this 1)
(prepare-zone-transition this 1)
)
(else
(set! (-> this flight-level-index) 1)
Expand All @@ -1088,18 +1089,18 @@ This commonly includes things such as:
(none)
)

(defmethod vehicle-method-81 ((this vehicle))
(defmethod switch-zone-low! ((this vehicle))
(when (and (logtest? (-> this info flags) 64) (> (-> this flight-level-index) 0))
(sound-play "bike-down")
(vehicle-method-78 this 0)
(prepare-zone-transition this 0)
)
0
(none)
)

(defmethod vehicle-method-83 ((this vehicle))
(logclear! (-> this flags) (rigid-body-object-flag flight-level-transition))
(vehicle-method-92 this)
(disable-rapid-camera-tracking this)
(set! (-> this flight-level-index) 0)
0
(none)
Expand Down
19 changes: 10 additions & 9 deletions goal_src/jak2/levels/city/traffic/vehicle/vehicle.gc
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@
)
(when (zero? (-> this flight-level-index))
(if (logtest? (-> this flags) (rigid-body-object-flag riding))
(vehicle-method-80 this)
(switch-zone-high! this)
)
)
(vector-! (-> s5-0 vector 1) (-> this target-acceleration) (-> this lin-acceleration))
Expand Down Expand Up @@ -371,8 +371,8 @@
)
(when (and (cpad-pressed? 0 r2) (not *pause-lock*))
(if (zero? (-> this flight-level-index))
(vehicle-method-80 this)
(vehicle-method-81 this)
(switch-zone-high! this)
(switch-zone-low! this)
)
)
(let ((s5-0 (new 'stack-no-clear 'vector)))
Expand Down Expand Up @@ -548,7 +548,7 @@
(time-elapsed? (-> this transition-end-time) (seconds 1))
)
(logclear! (-> this flags) (rigid-body-object-flag flight-level-transition-ending))
(vehicle-method-92 this)
(disable-rapid-camera-tracking this)
)
0
(none)
Expand Down Expand Up @@ -597,13 +597,13 @@
(let ((f0-5 (vector-dot (-> this rbody state lin-velocity) (-> this rbody state matrix vector 2))))
(cond
((= (-> this crash-level) 2)
(vehicle-method-90 this)
(disable-bike-mode this)
)
((< f0-5 (-> this info camera-max-lookaround-speed))
(vehicle-method-90 this)
(disable-bike-mode this)
)
((< (+ 4096.0 (-> this info camera-max-lookaround-speed)) f0-5)
(vehicle-method-89 this)
(enable-bike-mode this)
)
)
)
Expand Down Expand Up @@ -651,7 +651,7 @@
(f1-13 122880.0)
)
(if (< f0-20 (* f1-13 f1-13))
(vehicle-method-92 this)
(disable-rapid-camera-tracking this)
)
)
)
Expand All @@ -667,7 +667,7 @@
(.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1)
(.mov v1-98 vf1)
(if (< f0-23 v1-98)
(vehicle-method-91 this)
(enable-rapid-camera-tracking this)
)
)
)
Expand Down Expand Up @@ -706,6 +706,7 @@
(let ((s5-0 (-> this draw shadow-ctrl)))
(when (!= *vehicle-shadow-control-disabled* s5-0)
(let ((f30-0 (vector-vector-xz-distance (camera-pos) (-> this root trans))))
;; og:preserve-this Shadow fix of some sort
(#when PC_PORT
(if (not (-> *pc-settings* ps2-shadow?))
(set! f30-0 0.0)))
Expand Down
1 change: 1 addition & 0 deletions goal_src/jak2/pc/progress/progress-static-pc.gc
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,7 @@ This gives us more freedom to write code how we want.
(pc-settings-save)))
(new 'static 'menu-generic-carousel-option
:name (text-id progress-frame-rate)
:should-disable? (lambda () (-> *pc-settings* speedrunner-mode?))
:get-item-index-fn (lambda ()
;; TODO - use an array
(case (-> *pc-settings* target-fps)
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit d9d09a8

Please sign in to comment.