From cfca2eda29797268580ddc5ab1eeca241e903e4a Mon Sep 17 00:00:00 2001 From: oakes Date: Sat, 11 Jan 2014 14:22:11 -0500 Subject: [PATCH] Add type hints and rename function --- src/play_clj/core_2d.clj | 2 +- src/play_clj/core_global.clj | 3 ++- src/play_clj/ui.clj | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/play_clj/core_2d.clj b/src/play_clj/core_2d.clj index f4e3b69..87b8f8f 100644 --- a/src/play_clj/core_2d.clj +++ b/src/play_clj/core_2d.clj @@ -74,7 +74,7 @@ (u/gdx-static-field :graphics :g2d :Animation ~(or (first args) :normal)))) -(defn animation-texture +(defn animation->texture ([{:keys [total-time]} ^Animation animation] (u/create-entity (.getKeyFrame animation total-time true))) ([{:keys [total-time]} ^Animation animation is-looping?] diff --git a/src/play_clj/core_global.clj b/src/play_clj/core_global.clj index 54d4c1b..f848617 100644 --- a/src/play_clj/core_global.clj +++ b/src/play_clj/core_global.clj @@ -134,4 +134,5 @@ (defn ^:private add-input! [^InputProcessor p] - (.addProcessor ^InputMultiplexer (input! :get-input-processor) p)) + (let [^InputMultiplexer multi (input! :get-input-processor)] + (.addProcessor multi p))) diff --git a/src/play_clj/ui.clj b/src/play_clj/ui.clj index 545e4ec..17314bb 100644 --- a/src/play_clj/ui.clj +++ b/src/play_clj/ui.clj @@ -48,7 +48,7 @@ (map? arg) (Image. ^TextureRegion (:object arg)) (string? arg) - (Image. (Texture. arg)) + (Image. (Texture. ^String arg)) :else (Image. arg)))