freeing resources for justice.

This commit is contained in:
Bryce Covert
2017-05-26 07:46:29 -07:00
parent 807ee8564c
commit d8a145bb67
4 changed files with 29 additions and 18 deletions

View File

@@ -92,9 +92,8 @@
(defscreen splash-screen
:on-show
(fn [screen entities options]
(let [splash-atlas (texture-atlas "packed/splash.atlas")
global-atlas (texture-atlas "packed/global.atlas")
screen (update! screen :resources ["packed/splash.atlas" "packed/global.atlas"])]
(let [[screen splash-atlas] (utils/acquire-atlas screen "packed/splash.atlas")
[screen global-atlas] (utils/acquire-atlas screen "packed/global.atlas")]
(utils/setup-viewport screen 1280 960)
(log/info "Starting splash screen.")
(graphics! :set-cursor (utils/cursor "cursor.png" :hourglass))
@@ -121,9 +120,7 @@
entities)))
:on-hide (fn [screen entities options]
(doseq [atlas (:resources screen)]
(asset-manager! *asset-manager* :unload atlas)
(log/info "cleared assets" (into [] (.getAssetNames *asset-manager*)) (.getDiagnostics *asset-manager*))))
(utils/release-resources screen))
:on-render
(fn [{:keys [^FitViewport viewport] :as screen} entities options]