From a234f2275ee0ab939b3abf0861a68ae10b0ec9d0 Mon Sep 17 00:00:00 2001 From: oakes Date: Wed, 12 Feb 2014 17:55:31 -0500 Subject: [PATCH] Shorten function name --- src/play_clj/core_graphics.clj | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/play_clj/core_graphics.clj b/src/play_clj/core_graphics.clj index 247a658..9e827c8 100644 --- a/src/play_clj/core_graphics.clj +++ b/src/play_clj/core_graphics.clj @@ -101,11 +101,11 @@ from the tiled map in `screen` from the given `layer` and position `x` and `y` :width (.get prop "width") :height (.get prop "height")})) -(defn screen->isometric-map +(defn screen->isometric "Returns a copy of the provided map with x/y values converted from screen to isometric map coordinates - (screen->isometric-map screen {:x 64 :y 32})" + (screen->isometric screen {:x 64 :y 32})" [screen {:keys [x y] :as entity}] (let [{:keys [unit-scale tile-width tile-height]} (tiled-map-prop screen) half-tile-width (/ (* tile-width unit-scale) 2) @@ -118,11 +118,11 @@ to isometric map coordinates (/ x half-tile-width)) 2)))) -(defn isometric-map->screen +(defn isometric->screen "Returns a copy of the provided map with x/y values converted from isometric map to screen coordinates - (isometric-map->screen screen {:x 2 :y 1})" + (isometric->screen screen {:x 2 :y 1})" [screen {:keys [x y] :as entity}] (let [{:keys [unit-scale tile-width tile-height]} (tiled-map-prop screen) half-tile-width (/ (* tile-width unit-scale) 2) @@ -382,7 +382,7 @@ specify which layers to render with or without [screen layer-name] (let [^TiledMapTileLayer l (tiled-map-layer screen layer-name)] (reduce (fn [layers {:keys [x y] :as map-tile}] - (let [screen-tile (isometric-map->screen screen map-tile) + (let [screen-tile (isometric->screen screen map-tile) new-layer (or (->> layers (filter #(= y (:y %))) first) (assoc screen-tile :layer (create-layer l)))] (->> (tiled-map-layer! l :get-cell x y)