Files
jak-project/test/decompiler/reference/jak1/engine/common-obs/water-h_REF.gc
T
Hat Kid 122de4ecf5 jak1: clean up control-info names and other misc cleanup (#4295)
After spending the last month staring at and comparing Jak 3 and Jak 1
versions of a bunch of `target` code for my jetboard mod, I figured this
would be a good opportunity to revive this ancient PR #1714 along with
some other small misc fixes/improvements.

Instead of directly replacing the old fields, I decided to opt for using
overlay fields to maintain backwards compatibility with existing manual
patches, files without ref tests and mods that might use these fields.
2026-05-31 15:08:41 +02:00

165 lines
6.4 KiB
Common Lisp
Vendored
Generated

;;-*-Lisp-*-
(in-package goal)
;; definition of type water-control
(deftype water-control (basic)
((flags water-flags)
(process process-drawable)
(joint-index int32)
(top-y-offset float)
(ripple-size meters)
(enter-water-time time-frame)
(wade-time time-frame)
(on-water-time time-frame)
(enter-swim-time time-frame)
(swim-time time-frame)
(base-height meters)
(wade-height meters)
(swim-height meters)
(surface-height meters)
(bottom-height meters)
(height meters)
(height-offset float 4)
(real-ocean-offset meters :overlay-at (-> height-offset 0))
(ocean-offset meters :overlay-at (-> height-offset 1))
(bob-offset meters :overlay-at (-> height-offset 2))
(align-offset meters :overlay-at (-> height-offset 3))
(swim-depth meters)
(bob smush-control :inline)
(volume handle)
(bottom vector 2 :inline)
(top vector 2 :inline)
(enter-water-pos vector :inline)
(drip-old-pos vector :inline)
(drip-joint-index int32)
(drip-wetness float)
(drip-time time-frame)
(drip-speed float)
(drip-height meters)
(drip-mult float)
(flag water-flag :overlay-at flags)
)
(:methods
(new (symbol type process int float float float) _type_)
(water-control-method-9 (_type_) none)
(water-control-method-10 (_type_) none)
(start-bobbing! (_type_ float int int) none)
(distance-from-surface (_type_) float)
(create-splash (_type_ float vector int vector) none)
(display-water-marks? (_type_) symbol)
(water-control-method-15 (_type_) none)
(water-control-method-16 (_type_) none)
)
)
;; definition for method 3 of type water-control
(defmethod inspect ((this water-control))
(format #t "[~8x] ~A~%" this (-> this type))
(format #t "~Tflags: #x~X~%" (-> this flag))
(format #t "~Tprocess: ~A~%" (-> this process))
(format #t "~Tjoint-index: ~D~%" (-> this joint-index))
(format #t "~Ttop-y-offset: ~f~%" (-> this top-y-offset))
(format #t "~Tripple-size: (meters ~m)~%" (-> this ripple-size))
(format #t "~Tenter-water-time: ~D~%" (-> this enter-water-time))
(format #t "~Twade-time: ~D~%" (-> this wade-time))
(format #t "~Ton-water-time: ~D~%" (-> this on-water-time))
(format #t "~Tenter-swim-time: ~D~%" (-> this enter-swim-time))
(format #t "~Tswim-time: ~D~%" (-> this swim-time))
(format #t "~Tbase-height: (meters ~m)~%" (-> this base-height))
(format #t "~Twade-height: (meters ~m)~%" (-> this wade-height))
(format #t "~Tswim-height: (meters ~m)~%" (-> this swim-height))
(format #t "~Tsurface-height: (meters ~m)~%" (-> this surface-height))
(format #t "~Tbottom-height: (meters ~m)~%" (-> this bottom-height))
(format #t "~Theight: (meters ~m)~%" (-> this height))
(format #t "~Theight-offset[4] @ #x~X~%" (-> this height-offset))
(format #t "~Treal-ocean-offset: (meters ~m)~%" (-> this real-ocean-offset))
(format #t "~Tocean-offset: (meters ~m)~%" (-> this ocean-offset))
(format #t "~Tbob-offset: (meters ~m)~%" (-> this bob-offset))
(format #t "~Talign-offset: (meters ~m)~%" (-> this align-offset))
(format #t "~Tswim-depth: (meters ~m)~%" (-> this swim-depth))
(format #t "~Tbob: #<smush-control @ #x~X>~%" (-> this bob))
(format #t "~Tvolume: ~D~%" (-> this volume))
(format #t "~Tbottom[2] @ #x~X~%" (-> this bottom))
(format #t "~Ttop[2] @ #x~X~%" (-> this top))
(format #t "~Tenter-water-pos: ~`vector`P~%" (-> this enter-water-pos))
(format #t "~Tdrip-old-pos: ~`vector`P~%" (-> this drip-old-pos))
(format #t "~Tdrip-joint-index: ~D~%" (-> this drip-joint-index))
(format #t "~Tdrip-wetness: ~f~%" (-> this drip-wetness))
(format #t "~Tdrip-time: ~D~%" (-> this drip-time))
(format #t "~Tdrip-speed: ~f~%" (-> this drip-speed))
(format #t "~Tdrip-height: (meters ~m)~%" (-> this drip-height))
(format #t "~Tdrip-mult: ~f~%" (-> this drip-mult))
this
)
;; definition for method 14 of type water-control
(defmethod display-water-marks? ((this water-control))
(and *display-water-marks* (logtest? (-> this flag) (water-flag water-marks)))
)
;; definition for method 0 of type water-control
(defmethod new water-control ((allocation symbol) (type-to-make type) (arg0 process) (arg1 int) (arg2 float) (arg3 float) (arg4 float))
(let ((v0-0 (object-new allocation type-to-make (the-as int (-> type-to-make size)))))
(set! (-> v0-0 process) (the-as process-drawable arg0))
(set! (-> v0-0 joint-index) arg1)
(set! (-> v0-0 wade-height) arg4)
(set! (-> v0-0 swim-height) arg3)
(set! (-> v0-0 bottom-height) 32768.0)
(set! (-> v0-0 ripple-size) 1638.4)
(set! (-> v0-0 volume) (the-as handle #f))
(set! (-> v0-0 drip-mult) 1.0)
(set! (-> v0-0 top-y-offset) arg2)
v0-0
)
)
;; definition for method 12 of type water-control
(defmethod distance-from-surface ((this water-control))
(- (-> this top 0 y) (-> this height))
)
;; definition of type water-vol
(deftype water-vol (process-drawable)
((water-height meters)
(wade-height meters)
(swim-height meters)
(bottom-height meters)
(attack-event symbol)
(target handle)
(flags water-flags)
(flag water-flag :overlay-at flags)
)
(:state-methods
water-vol-idle
water-vol-startup
)
(:methods
(water-vol-method-22 (_type_) none)
(reset-root! (_type_) none)
(set-stack-size! (_type_) none)
(water-vol-method-25 (_type_) none)
(update! (_type_) none)
(on-exit-water (_type_) none)
(get-ripple-height (_type_ vector) float)
(init! (_type_) none)
)
)
;; definition for method 3 of type water-vol
(defmethod inspect ((this water-vol))
(let ((t9-0 (method-of-type process-drawable inspect)))
(t9-0 this)
)
(format #t "~T~Twater-height: (meters ~m)~%" (-> this water-height))
(format #t "~T~Twade-height: (meters ~m)~%" (-> this wade-height))
(format #t "~T~Tswim-height: (meters ~m)~%" (-> this swim-height))
(format #t "~T~Tbottom-height: (meters ~m)~%" (-> this bottom-height))
(format #t "~T~Tattack-event: ~A~%" (-> this attack-event))
(format #t "~T~Ttarget: ~D~%" (-> this target))
(format #t "~T~Tflags: #x~X~%" (-> this flag))
this
)
;; failed to figure out what this is:
0