mirror of
https://github.com/open-goal/jak-project
synced 2026-06-30 03:49:08 -04:00
f48fda692e
* docs for ee merc code * 150fps support but it replaces 60fps * oops switched wrong mode * oops 50.0 not 50 * formatting * fix cutscene speed * oops * Replace latest merc.md, not sure what happened * Automatically switch between video modes (ntsc or 150fps) based on refresh rate. Cleanup particle timing * cleanup * fix idle animation * linter * fix village2 crash * can load all levels again * update loader output and replace sparticle time with formula * Add 100fps support, add some comments, fix build * formatting Co-authored-by: water <awaterford111445@gmail.com>
53 lines
2.1 KiB
Common Lisp
53 lines
2.1 KiB
Common Lisp
;;-*-Lisp-*-
|
|
(in-package goal)
|
|
|
|
;; name: wind.gc
|
|
;; name in dgo: wind
|
|
;; dgos: GAME, ENGINE
|
|
|
|
;; definition for symbol *wind-work*, type wind-work
|
|
(define *wind-work* (new 'global 'wind-work))
|
|
|
|
;; definition for function update-wind
|
|
;; INFO: Return type mismatch int vs none.
|
|
(defun update-wind ((arg0 wind-work) (arg1 (array uint8)))
|
|
(let* ((f0-1 (+ (-> arg0 wind-normal w) (rand-vu-float-range -1024.0 1024.0)))
|
|
(f30-1 (- f0-1 (* (the float (the int (/ f0-1 65536.0))) 65536.0)))
|
|
)
|
|
(set! (-> arg0 wind-normal w) f30-1)
|
|
(set! (-> arg0 wind-normal x) (cos f30-1))
|
|
(set! (-> arg0 wind-normal z) (sin f30-1))
|
|
)
|
|
(set! (-> arg0 wind-time) (+ (-> arg0 wind-time) 1))
|
|
(let* ((s4-0 (logand (-> arg0 wind-time) 63))
|
|
(f0-4 (rand-vu-float-range 0.0 100.0))
|
|
(v1-5 (/ (if (or (eq? (-> *setting-control* current video-mode) '150fps) (eq? (-> *setting-control* current video-mode) '100fps)) (the uint (min 1.0 (* (if (eq? (-> *setting-control* current video-mode) '150fps) 0.4 0.6) (-> arg0 wind-time)))) (-> arg0 wind-time)) (the-as uint 120)))
|
|
(f1-6 (* 0.008333334
|
|
(the float (mod (if (or (eq? (-> *setting-control* current video-mode) '150fps) (eq? (-> *setting-control* current video-mode) '100fps)) (the uint (min 1.0 (* (if (eq? (-> *setting-control* current video-mode) '150fps) 0.4 0.6) (-> arg0 wind-time)))) (-> arg0 wind-time)) (the-as uint 120)))
|
|
)
|
|
)
|
|
(f2-4 (* 0.0625
|
|
(the float (-> arg1 (mod (the-as int v1-5) (-> arg1 length))))
|
|
)
|
|
)
|
|
(f0-5 (* (+ (* (- (* 0.0625
|
|
(the float (-> arg1 (mod (the-as int (+ v1-5 1)) (-> arg1 length)))
|
|
)
|
|
)
|
|
f2-4
|
|
)
|
|
f1-6
|
|
)
|
|
f2-4
|
|
)
|
|
f0-4
|
|
)
|
|
)
|
|
)
|
|
(set! (-> *wind-work* wind-force s4-0) f0-5)
|
|
(vector-float*! (-> *wind-work* wind-array s4-0) (-> arg0 wind-normal) f0-5)
|
|
)
|
|
0
|
|
(none)
|
|
)
|