change
This commit is contained in:
@@ -455,7 +455,8 @@
|
||||
:finish #(do
|
||||
|
||||
(graphics! :set-cursor (utils/cursor "cursor.png" :main))
|
||||
(utils/play-music (:music %)) %)
|
||||
(doto (:music %) println)
|
||||
(doto (utils/play-music (:music %)) println) %)
|
||||
:ease tween/ease-in-quadratic)}}
|
||||
entities (utils/platformify
|
||||
entities
|
||||
|
||||
@@ -135,16 +135,20 @@
|
||||
(defn current-music-volume
|
||||
(^double [] (current-music-volume 1.0))
|
||||
(^double [^double factor]
|
||||
(-> (Math/pow (unchecked-multiply (:music-volume @settings) 0.01) 2)
|
||||
(unchecked-multiply 0.25)
|
||||
(unchecked-multiply (double factor)))))
|
||||
(min (max (-> (Math/pow (unchecked-multiply (:music-volume @settings) 0.01) 2)
|
||||
(unchecked-multiply 0.25)
|
||||
(unchecked-multiply (double factor)))
|
||||
0.0)
|
||||
1.0)))
|
||||
|
||||
(defn current-sound-volume
|
||||
(^double [] (current-sound-volume 1.0))
|
||||
(^double [^double factor]
|
||||
(-> (Math/pow (unchecked-multiply (:sound-volume @settings) 0.01) 2)
|
||||
(unchecked-multiply 0.5)
|
||||
(unchecked-multiply (double factor)))))
|
||||
(min (max (-> (Math/pow (unchecked-multiply (:sound-volume @settings) 0.01) 2)
|
||||
(unchecked-multiply 0.5)
|
||||
(unchecked-multiply (double factor)))
|
||||
0.0)
|
||||
1.0)))
|
||||
|
||||
(defn cursor [filename which]
|
||||
(let [scale 4
|
||||
@@ -156,7 +160,8 @@
|
||||
[hot-x hot-y] (+cursor-hotspots+ which [0 0])
|
||||
hot-x (int hot-x)
|
||||
hot-y (int hot-y)]
|
||||
(Pixmap/setFilter Pixmap$Filter/NearestNeighbour)
|
||||
(pixmap! resized :set-filter Pixmap$Filter/NearestNeighbour)
|
||||
(pixmap! base-cursor :set-filter Pixmap$Filter/NearestNeighbour)
|
||||
(pixmap! resized :draw-pixmap base-cursor (* index 18) 0 16 16
|
||||
0 0 target-width target-height)
|
||||
|
||||
@@ -248,11 +253,12 @@
|
||||
(defn publish-screenshot-fn []
|
||||
(do
|
||||
(log/info "Taking Desktop screenshot...")
|
||||
(Pixmap/setFilter Pixmap$Filter/BiLinear)
|
||||
(let [viewport (-> @ (resolve 'advent.screens.scene/scene) :screen deref :viewport)
|
||||
[x y w h g-l g-r] [(.getScreenX ^FitViewport viewport) (.getScreenY ^FitViewport viewport) (.getScreenWidth ^FitViewport viewport) (.getScreenHeight ^FitViewport viewport)]
|
||||
pm (ScreenUtils/getFrameBufferPixmap x y w h)
|
||||
resized (Pixmap. 160 120 Pixmap$Format/RGB888)]
|
||||
(pixmap! pm :set-filter Pixmap$Filter/BiLinear)
|
||||
(pixmap! resized :set-filter Pixmap$Filter/BiLinear)
|
||||
(.drawPixmap resized pm 0 0 (.getWidth pm) (.getHeight pm) 0 0 160 120)
|
||||
(.dispose pm)
|
||||
(fn [] resized))))
|
||||
@@ -460,7 +466,8 @@
|
||||
|
||||
|
||||
(defn play-music [snd]
|
||||
(music! snd :play))
|
||||
(music! snd :play)
|
||||
(println "is playing:" (music! snd :is-playing)))
|
||||
|
||||
(defn stop-music [snd]
|
||||
(music! snd :stop))
|
||||
|
||||
Reference in New Issue
Block a user