Add global asset manager

This commit is contained in:
oakes
2014-04-30 18:18:00 -04:00
parent 332f83c6ca
commit 348612b62f
8 changed files with 161 additions and 65 deletions

View File

@@ -73,12 +73,19 @@
; model
(defn model*
[^String path]
(or (u/load-asset path Model)
(throw (Exception. "Asset manager not found. See set-asset-manager!"))))
(defmacro model
"Returns an entity based on [ModelInstance](http://libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/graphics/g3d/ModelInstance.html)."
[& args]
`(ModelEntity.
(let [arg1# ~(first args)]
(cond
(string? arg1#)
(ModelInstance. (model* arg1#))
(:object arg1#)
(ModelInstance. ^ModelInstance (:object arg1#))
(isa? arg1# ModelData)