mirror of
https://github.com/open-goal/jak-project
synced 2026-05-31 01:16:12 -04:00
24578b64b9
* hardcode `time-frame`things * Update cam-states_REF.gc * Update level-info_REF.gc * update refs 1 * update refs 2 * update refs 3 * update refs 4 * update refs 5 * update detection and casting * Update FormExpressionAnalysis.cpp * update refs 6 * update mood decomp * update refs 7 * update refs 8 * remove temp entity birth code * update time-frame casts * fix compiler * hardcode stuff and fix some types * fix some bitfield detection being wrong * bug fixes * detect seconds on adds with immediate * update refs 9 * fix casts and rand-vu-int-range bugs (update refs 10) * update refs 11 * update 12 * update 13 * update 14 * Update game-info_REF.gc * improve cpad macros detection * remove unused code * update refs * clang * update source code * Update cam-states.gc * `lavatube-energy` finish * update refs * fix actor bank stuff * Update navigate.gc * reduce entity default stack size * Update transformq-h.gc * oops forgot these * fix code and tests * fix mood sound stuff * Update load-dgo.gc * Update README.md
74 lines
2.4 KiB
Common Lisp
Vendored
Generated
74 lines
2.4 KiB
Common Lisp
Vendored
Generated
;;-*-Lisp-*-
|
|
(in-package goal)
|
|
|
|
;; definition of type ticky
|
|
(deftype ticky (structure)
|
|
((delay-til-ramp time-frame :offset-assert 0)
|
|
(delay-til-timeout time-frame :offset-assert 8)
|
|
(starting-time time-frame :offset-assert 16)
|
|
(last-tick-time time-frame :offset-assert 24)
|
|
)
|
|
:method-count-assert 12
|
|
:size-assert #x20
|
|
:flag-assert #xc00000020
|
|
(:methods
|
|
(sleep (_type_ time-frame) none 9)
|
|
(reached-delay? (_type_ time-frame) symbol 10)
|
|
(completed? (_type_) symbol 11)
|
|
)
|
|
)
|
|
|
|
;; definition for method 3 of type ticky
|
|
(defmethod inspect ticky ((obj ticky))
|
|
(format #t "[~8x] ~A~%" obj 'ticky)
|
|
(format #t "~Tdelay-til-ramp: ~D~%" (-> obj delay-til-ramp))
|
|
(format #t "~Tdelay-til-timeout: ~D~%" (-> obj delay-til-timeout))
|
|
(format #t "~Tstarting-time: ~D~%" (-> obj starting-time))
|
|
(format #t "~Tlast-tick-time: ~D~%" (-> obj last-tick-time))
|
|
obj
|
|
)
|
|
|
|
;; definition for method 9 of type ticky
|
|
;; INFO: Return type mismatch int vs none.
|
|
(defmethod sleep ticky ((obj ticky) (arg0 time-frame))
|
|
(set! (-> obj starting-time) (-> *display* base-frame-counter))
|
|
(set! (-> obj delay-til-timeout) arg0)
|
|
(set! (-> obj delay-til-ramp) (max 0 (+ arg0 (seconds -4))))
|
|
(set! (-> obj last-tick-time) 0)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
;; definition for method 11 of type ticky
|
|
(defmethod completed? ticky ((obj ticky))
|
|
(let ((gp-0 #f))
|
|
(let ((v1-2 (- (-> *display* base-frame-counter) (-> obj starting-time))))
|
|
(cond
|
|
((>= v1-2 (-> obj delay-til-timeout))
|
|
(set! gp-0 #t)
|
|
)
|
|
(else
|
|
(let* ((f0-1 (fmin 1.0 (/ (the float (max 0 (- v1-2 (-> obj delay-til-ramp))))
|
|
(the float (- (-> obj delay-til-timeout) (-> obj delay-til-ramp)))
|
|
)
|
|
)
|
|
)
|
|
(v1-7 (the int (lerp 105.0 41.0 f0-1)))
|
|
)
|
|
(when (>= (- (-> *display* base-frame-counter) (-> obj last-tick-time)) v1-7)
|
|
(set! (-> obj last-tick-time) (-> *display* base-frame-counter))
|
|
(sound-play-by-name (static-sound-name "stopwatch") (new-sound-id) 1024 0 0 1 #t)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
gp-0
|
|
)
|
|
)
|
|
|
|
;; definition for method 10 of type ticky
|
|
(defmethod reached-delay? ticky ((obj ticky) (arg0 time-frame))
|
|
(>= (- (-> *display* base-frame-counter) (-> obj starting-time)) arg0)
|
|
)
|