perf improvements, mobile working on i4s

This commit is contained in:
Bryce Covert
2017-05-24 06:15:28 -07:00
parent be916eb5f3
commit 2f6e0a4081
10 changed files with 262 additions and 186 deletions

View File

@@ -128,15 +128,19 @@
(defonce selected-save (atom nil))
(defn current-music-volume [& [^double factor]]
(-> (Math/pow (unchecked-multiply (:music-volume @settings) 0.01) 2)
(unchecked-multiply 0.25)
(unchecked-multiply (or factor 1.0))))
(defn current-music-volume
([] (current-music-volume 1.0))
([^double factor]
(-> (Math/pow (unchecked-multiply (:music-volume @settings) 0.01) 2)
(unchecked-multiply 0.25)
(unchecked-multiply (double factor)))))
(defn current-sound-volume [& [factor]]
(-> (Math/pow (unchecked-multiply (:sound-volume @settings) 0.01) 2)
(unchecked-multiply 0.5)
(unchecked-multiply (or factor 1.0))))
(defn current-sound-volume
([] (current-sound-volume 1.0))
([^double factor]
(-> (Math/pow (unchecked-multiply (:sound-volume @settings) 0.01) 2)
(unchecked-multiply 0.5)
(unchecked-multiply (double factor)))))
(defn cursor [filename which]
(let [scale 4
@@ -700,7 +704,7 @@
entities)))
(defn stop-all-sounds! [entities]
(doseq [snd (get-in entities [:current-sounds :value])]
(doseq [snd (get-in entities [:current-sounds :value] [])]
(sound! (:sound snd) :stop (:id snd))))
(defn translate-depressed [cursor depressed?]
@@ -714,3 +718,6 @@
(min (- length (* length 0.5 zoom ))
(max (* length 0.5 zoom )
x)))
(defn get-entity [entities id]
((:entities (:room entities)) id))