jak-project/goal_src/jak3/levels/desert/wvehicle/wvehicle-hud.gc
Hat Kid 36f1592b90
decomp3: lightning renderer, nav code, texture remap, fix progress menu crash (#3461)
Also adds:

- BLERC
- Minimap (with missing texture for the map, sprites work)
- Eco Mine files
- Precursor robot boss files
- Sewer files
- Vehicle files
2024-04-12 18:44:38 -04:00

97 lines
2.9 KiB
Common Lisp

;;-*-Lisp-*-
(in-package goal)
;; name: wvehicle-hud.gc
;; name in dgo: wvehicle-hud
;; dgos: LPATK, LFACCAR, WASALL
;; DECOMP BEGINS
(deftype hud-vehicle-turbo (hud)
((tex-rim texture)
(tex-on texture)
(tex-off texture)
)
)
(defmethod draw ((this hud-vehicle-turbo))
(set-hud-piece-position! (the-as hud-sprite (-> this sprites)) (the int (* -100.0 (-> this offset))) 336)
(let* ((f0-5 (the float (the int (-> *game-info* vehicle-turbo-ready))))
(f0-7 (* 120.0 (fmax 0.33 f0-5)))
(v1-5 (-> *game-info* race-number-turbos))
)
(dotimes (a0-2 3)
(let ((a1-3 (-> this sprites a0-2)))
(cond
((< a0-2 v1-5)
(set! (-> a1-3 tid) (the-as texture-id (-> this tex-on)))
(set! (-> a1-3 color w) (the int f0-7))
)
(else
(set! (-> a1-3 tid) (the-as texture-id (-> this tex-off)))
(set! (-> a1-3 color w) (the int (* 0.5 f0-7)))
)
)
)
)
)
(set-as-offset-from! (-> this sprites 1) (the-as vector4w (-> this sprites)) 32 0)
(set-as-offset-from! (-> this sprites 2) (the-as vector4w (-> this sprites 1)) 32 0)
(dotimes (s5-0 3)
(set-as-offset-from! (-> this sprites (+ s5-0 3)) (the-as vector4w (-> this sprites s5-0)) 0 0)
)
((method-of-type hud draw) this)
0
(none)
)
(defmethod update-values! ((this hud-vehicle-turbo))
(logclear! (-> this flags) (hud-flags disable))
((method-of-type hud update-values!) this)
0
(none)
)
(defmethod init-callback ((this hud-vehicle-turbo))
(vehicle-entity-hack 27)
(set! (-> this gui-id)
(add-process *gui-control* this (gui-channel hud-lower-left-1) (gui-action play) (-> this name) 81920.0 0)
)
(set! (-> this tex-on)
(lookup-level-texture-by-name "hud-turbo-boost-on-01" (-> this level) (the-as (pointer texture-page) #f))
)
(set! (-> this tex-off)
(lookup-level-texture-by-name "hud-turbo-boost-off-01" (-> this level) (the-as (pointer texture-page) #f))
)
(set! (-> this tex-rim)
(lookup-level-texture-by-name "hud-turbo-boost-rim-01" (-> this level) (the-as (pointer texture-page) #f))
)
(logior! (-> this flags) (hud-flags show))
(dotimes (v1-4 6)
(let ((a0-8 (-> this sprites v1-4)))
(set! (-> a0-8 scale-x) 1.0)
(set! (-> a0-8 scale-y) 1.0)
)
)
(dotimes (v1-7 3)
(let ((a0-13 (-> this sprites (+ v1-7 3))))
(set! (-> a0-13 tid) (the-as texture-id (-> this tex-rim)))
)
)
0
(none)
)
;; WARN: Return type mismatch process vs hud-vehicle-turbo.
(defun hud-vehicle-turbo-spawn ((arg0 process))
(let ((gp-0 (the-as process #f)))
(let ((v1-1 (process-spawn hud-vehicle-turbo :init hud-init-by-other :name "hud-vehicle-turbo" :to arg0)))
(if v1-1
(set! gp-0 (-> v1-1 0))
)
)
(the-as hud-vehicle-turbo gp-0)
)
)