sound progress.
This commit is contained in:
@@ -805,9 +805,8 @@ void main()
|
||||
(if-let [[snd vol-scale] (get-in anim-sound-frames [anim current-frame-index])]
|
||||
(utils/play-sound! screen entities
|
||||
(or (snd e) (snd (:sounds entities)))
|
||||
target
|
||||
vol-scale
|
||||
[x y])
|
||||
(utils/sourced-volume-fn target vol-scale [x y])
|
||||
(utils/get-sound-pan x))
|
||||
entities)
|
||||
entities))
|
||||
|
||||
@@ -822,10 +821,10 @@ void main()
|
||||
|
||||
(defn update-current-sound-vols! [entities]
|
||||
(loop [entities entities
|
||||
[{:keys [id sound duration loc vol-scale target loc]} & rest] (get-in entities [:current-sounds :value])]
|
||||
[{:keys [id sound volume-fn]} & rest] (get-in entities [:current-sounds :value])]
|
||||
(if id
|
||||
(do
|
||||
(sound! sound :set-volume id (utils/get-sound-volume entities target vol-scale loc))
|
||||
(sound! sound :set-volume id (volume-fn entities))
|
||||
(recur entities rest))
|
||||
entities)))
|
||||
|
||||
@@ -1027,6 +1026,8 @@ void main()
|
||||
(if (get-in entities [:closing? :value])
|
||||
|
||||
(let [entities (utils/apply-tweens screen entities (:tweens entities))
|
||||
entities (update-current-sound-vols! entities)
|
||||
entities (remove-ended-sounds screen entities)
|
||||
layers (get-layers entities)
|
||||
all-entities (concat (vals entities) layers (vals (get-in entities [:room :entities])))]
|
||||
(screen! fade-screen :update-fade :opacity (get-in entities [:fade :opacity]))
|
||||
|
||||
Reference in New Issue
Block a user