mirror of
https://github.com/open-goal/jak-project.git
synced 2024-10-20 11:26:18 -04:00
parent
37069e2f8e
commit
e119a66788
|
@ -316,6 +316,11 @@ The cpad-set-buzz! function can be used for vibration.
|
||||||
;; weird leftover debug thing, enabling overrides the x position of both sticks on both controllers.
|
;; weird leftover debug thing, enabling overrides the x position of both sticks on both controllers.
|
||||||
(define *cpad-debug* #f)
|
(define *cpad-debug* #f)
|
||||||
|
|
||||||
|
(#if PC_PORT
|
||||||
|
(defconstant STICK_DEADZONE (-> *pc-settings* stick-deadzone))
|
||||||
|
(defconstant STICK_DEADZONE 0.3)
|
||||||
|
)
|
||||||
|
|
||||||
(defun service-cpads ()
|
(defun service-cpads ()
|
||||||
"Read from cpads and update vibration"
|
"Read from cpads and update vibration"
|
||||||
(let ((pads *cpad-list*))
|
(let ((pads *cpad-list*))
|
||||||
|
@ -526,7 +531,7 @@ The cpad-set-buzz! function can be used for vibration.
|
||||||
(set! (-> pad stick0-dir) (atan (- f30-0) f28-0))
|
(set! (-> pad stick0-dir) (atan (- f30-0) f28-0))
|
||||||
(set! (-> pad stick0-speed) (fmin 1.0 (sqrtf (+ (* f30-0 f30-0) (* f28-0 f28-0)))))
|
(set! (-> pad stick0-speed) (fmin 1.0 (sqrtf (+ (* f30-0 f30-0) (* f28-0 f28-0)))))
|
||||||
)
|
)
|
||||||
(if (< (-> pad stick0-speed) 0.3)
|
(if (< (-> pad stick0-speed) STICK_DEADZONE)
|
||||||
(set! (-> pad stick0-speed) 0.0)
|
(set! (-> pad stick0-speed) 0.0)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
@ -540,7 +545,7 @@ The cpad-set-buzz! function can be used for vibration.
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
(if (or (!= (-> pad button0-abs 0) (-> pad button0-abs 1))
|
(if (or (!= (-> pad button0-abs 0) (-> pad button0-abs 1))
|
||||||
(or (< 0.3 (-> pad stick0-speed)) (zero? (-> pad change-time)))
|
(or (< STICK_DEADZONE (-> pad stick0-speed)) (zero? (-> pad change-time)))
|
||||||
)
|
)
|
||||||
(set! (-> pad change-time) (get-current-time))
|
(set! (-> pad change-time) (get-current-time))
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue