From 32e24c8a339e4508d97228fd6dd7b587e3af2ede Mon Sep 17 00:00:00 2001 From: oakes Date: Tue, 8 Apr 2014 16:35:39 -0400 Subject: [PATCH] Add type hints --- src/play_clj/core_graphics.clj | 3 ++- src/play_clj/g2d.clj | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/play_clj/core_graphics.clj b/src/play_clj/core_graphics.clj index c866b3b..84bc03c 100644 --- a/src/play_clj/core_graphics.clj +++ b/src/play_clj/core_graphics.clj @@ -16,7 +16,8 @@ memory. (pixmap! object :dispose)" [object k & options] - `(u/call! ^Pixmap ~object ~k ~@options)) + `(let [^Pixmap object# ~object] + (u/call! object# ~k ~@options))) (defmacro shape-type "Returns a static field from [ShapeRenderer.ShapeType](http://libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/graphics/glutils/ShapeRenderer.ShapeType.html). diff --git a/src/play_clj/g2d.clj b/src/play_clj/g2d.clj index 3b55f95..561de2e 100644 --- a/src/play_clj/g2d.clj +++ b/src/play_clj/g2d.clj @@ -24,10 +24,12 @@ (-> ^String arg Texture. TextureRegion.) (isa? (type arg) Pixmap) (-> ^Pixmap arg Texture. TextureRegion.) + (isa? (type arg) TextureRegion) + arg (:object arg) (TextureRegion. ^TextureRegion (:object arg)) :else - arg))) + (TextureRegion. arg)))) (defmacro texture "Returns an entity based on [TextureRegion](http://libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/graphics/g2d/TextureRegion.html).