diff --git a/src/play_clj/core_graphics.clj b/src/play_clj/core_graphics.clj index 8204a8a..366952b 100644 --- a/src/play_clj/core_graphics.clj +++ b/src/play_clj/core_graphics.clj @@ -490,11 +490,11 @@ with the tiled map file at `path` and `unit` scale. (let [^Batch batch (.getBatch renderer)] (.setProjectionMatrix batch (.combined camera)) (.begin batch) - (when shader - (.setShader batch shader)) + (doseq [{:keys [additive? opacity ^float r ^float g ^float b ^float hue-amount ^float multiply-amount] :as entity :or {opacity 1.0}} entities :when (> opacity 0.0)] (when shader + (.setShader batch shader) (.setUniformf shader "multiply_amount" (float (or multiply-amount 1.0))) (.setUniformf shader "hue_amount" (float (or hue-amount 1.0)))) @@ -559,11 +559,7 @@ specify which layers to render with or without. (render! screen entities)" ([{:keys [renderer] :as screen}] - (cond - (isa? (type renderer) BatchTiledMapRenderer) - (render-map! screen) - (isa? (type renderer) Stage) - (render-stage! screen))) + (render-stage! screen)) ([screen entities] (render! screen) (draw! screen entities))) diff --git a/src/play_clj/entities.clj b/src/play_clj/entities.clj index c77cd33..c685514 100644 --- a/src/play_clj/entities.clj +++ b/src/play_clj/entities.clj @@ -47,7 +47,9 @@ (.draw object ^Batch batch x y width height)))) (defrecord ParticleEffectEntity [object] Entity + (draw! [{:keys [^ParticleEffect object x y delta-time]} _ batch] + (.setShader ^Batch batch nil) (let [x (float (or x 0)) y (float (or y 0)) ^Graphics g (Gdx/graphics)