From 581a9d97cd1c8bde29475a7cfc85759b910b3878 Mon Sep 17 00:00:00 2001 From: Simon Brooke Date: Mon, 4 Dec 2017 13:45:55 +0000 Subject: [PATCH] Ran `lein ancient` and upversioned all dependencies; fixed failing tests. --- buildall.sh | 2 +- project.clj | 10 +++++----- src/mw_engine/heightmap.clj | 12 ++++++------ src/mw_engine/utils.clj | 2 +- test/mw_engine/heightmap_test.clj | 6 +++--- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/buildall.sh b/buildall.sh index 6152aed..052bfdc 100755 --- a/buildall.sh +++ b/buildall.sh @@ -16,7 +16,7 @@ old="unset" release="" tmp=buildall.tmp.$$ trial="FALSE" -webappsdir="/var/lib/tomcat7/webapps" +webappsdir="/var/lib/tomcat8/webapps" # Builds the build signature properties in the manifest map file # expected arguments: old version tag, version tag, full name of user, diff --git a/project.clj b/project.clj index 70cfad8..c55b8d5 100644 --- a/project.clj +++ b/project.clj @@ -12,10 +12,10 @@ :license {:name "GNU General Public License v2" :url "http://www.gnu.org/licenses/gpl-2.0.html"} :plugins [[lein-marginalia "0.7.1"]] - :dependencies [[org.clojure/clojure "1.6.0"] - [org.clojure/math.combinatorics "0.0.7"] - [org.clojure/tools.trace "0.7.8"] - [org.clojure/tools.namespace "0.2.4"] + :dependencies [[org.clojure/clojure "1.8.0"] + [org.clojure/math.combinatorics "0.1.4"] + [org.clojure/tools.trace "0.7.9"] + [org.clojure/tools.namespace "0.2.10"] [hiccup "1.0.5"] - [net.mikera/imagez "0.3.1"] + [net.mikera/imagez "0.12.0"] [fivetonine/collage "0.2.0"]]) diff --git a/src/mw_engine/heightmap.clj b/src/mw_engine/heightmap.clj index cde7002..eaa3e2b 100644 --- a/src/mw_engine/heightmap.clj +++ b/src/mw_engine/heightmap.clj @@ -107,15 +107,15 @@ * `imagepath` a file path or URL which indicates an (ideally greyscale) image file." ([world imagepath] (let [heightmap (imagez/filter-image - (filters/grayscale) - (collage/load-image imagepath))] + (imagez/load-image-resource imagepath) + (filters/grayscale))] (map-world (map-world world tag-altitude (list heightmap)) tag-gradient))) ([imagepath] (let [heightmap (imagez/filter-image - (filters/grayscale) - (collage/load-image imagepath)) + (imagez/load-image-resource imagepath) + (filters/grayscale)) world (make-world (.getWidth heightmap) (.getHeight heightmap))] (map-world (map-world world tag-altitude (list heightmap)) @@ -132,6 +132,6 @@ intensity of the corresponding cell of the image." [world imagepath property] (let [heightmap (imagez/filter-image - (filters/grayscale) - (collage/load-image imagepath))] + (imagez/load-image-resource imagepath) + (filters/grayscale))] (map-world world tag-property (list property heightmap)))) diff --git a/src/mw_engine/utils.clj b/src/mw_engine/utils.clj index 53c359f..fb39003 100644 --- a/src/mw_engine/utils.clj +++ b/src/mw_engine/utils.clj @@ -112,7 +112,7 @@ ([world function additional-args] (into [] (pmap (fn [row] - (into [] (map + (into [] (mapv #(apply function (cons world (cons % additional-args))) row))) diff --git a/test/mw_engine/heightmap_test.clj b/test/mw_engine/heightmap_test.clj index 23f63fa..2d96722 100644 --- a/test/mw_engine/heightmap_test.clj +++ b/test/mw_engine/heightmap_test.clj @@ -7,7 +7,7 @@ (deftest apply-heightmap-test (testing "Heightmap functionality" - (let [world (apply-heightmap (as-file "resources/heightmaps/test9x9.png")) + (let [world (apply-heightmap "heightmaps/test9x9.png") altitudes (map #(:altitude %) (flatten world)) gradients (map #(:gradient %) (flatten world))] (is (= (count world) 9) "World should be 9x9") @@ -22,7 +22,7 @@ (is (> (apply + gradients) 0) "At least some gradients must be positive, none should be negative")) ;; alternate means of making the world, same tests. - (let [world (apply-heightmap (world/make-world 9 9) (as-file "resources/heightmaps/test9x9.png")) + (let [world (apply-heightmap (world/make-world 9 9) "heightmaps/test9x9.png") altitudes (map #(:altitude %) (flatten world)) gradients (map #(:gradient %) (flatten world))] (is (= (count world) 9) "World should be 9x9") @@ -42,7 +42,7 @@ (deftest apply-valuemap-test (testing "Valuemap functionality" - (let [image (as-file "resources/heightmaps/test9x9.png") + (let [image "heightmaps/test9x9.png" world (apply-valuemap (apply-heightmap image) image :arbitrary) altitudes (map #(:altitude %) (flatten world)) arbitraries (map #(:arbitrary %) (flatten world))]