fixes the sound issue.

This commit is contained in:
2026-03-23 23:45:49 -07:00
parent 9a14d849c6
commit b9e3e3ba2e
2 changed files with 3 additions and 3 deletions

View File

@@ -2161,5 +2161,5 @@
:else :else
nil)))) nil))))
:on-hide :on-hide
(fn [screen entities options] (fn [screen entities options]
(utils/release-resources screen))) (utils/release-resources screen)))

View File

@@ -741,6 +741,7 @@
sound-id (if (= :once type) sound-id (if (= :once type)
(sound! snd :play (scale-vol-from-fade entities (current-sound-volume vol)) (or pitch 1.0) pan ) (sound! snd :play (scale-vol-from-fade entities (current-sound-volume vol)) (or pitch 1.0) pan )
(sound! snd :loop 0.0 (or pitch 1.0) pan )) ] (sound! snd :loop 0.0 (or pitch 1.0) pan )) ]
(update-in entities [:current-sounds :value] (update-in entities [:current-sounds :value]
conj {:id sound-id conj {:id sound-id
:sound snd :sound snd
@@ -748,8 +749,7 @@
:type type :type type
:ends-at (if (= type :once) :ends-at (if (= type :once)
(+ (:total-time screen) 1.0 #_(sound! snd :duration)) (+ (:total-time screen) 1.0 #_(sound! snd :duration))
nil)})) nil)}))))
entities))
(defn stop-all-sounds! [entities] (defn stop-all-sounds! [entities]
(doseq [snd (get-in entities [:current-sounds :value] [])] (doseq [snd (get-in entities [:current-sounds :value] [])]