hopefully made math faster.

This commit is contained in:
Bryce Covert
2016-08-08 09:29:18 -07:00
parent 82a7269350
commit 8e54698f54
2 changed files with 45 additions and 40 deletions

View File

@@ -35,15 +35,15 @@
(def selected-save (atom nil))
(defn current-music-volume [& [factor]]
(* (Math/pow (/ (:music-volume @settings) 100.0) 2)
0.25
(or factor 1.0)))
(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-sound-volume [& [factor]]
(* (Math/pow (/ (:sound-volume @settings) 100.0) 2)
0.5
(or factor 1.0)))
(-> (Math/pow (unchecked-multiply (:sound-volume @settings) 0.01) 2)
(unchecked-multiply 0.5)
(unchecked-multiply (or factor 1.0))))
(defn cursor [filename which]
(let [scale 4