Generalised hieghtmaps so that I can do, for example, rainfall maps,

or various geophysics maps.
This commit is contained in:
simon 2014-08-12 19:07:48 +01:00
parent 64ab0b9dd9
commit 3b1d28d3cd
2 changed files with 58 additions and 17 deletions

View file

@ -21,4 +21,14 @@
(is (> (apply + gradients) 0)
"At least some gradients must be positive, none should be negative")
)))
(deftest apply-valuemap-test
(testing "Valuemap functionality"
(let [image (as-file "resources/heightmaps/test9x9.png")
world (apply-valuemap (apply-heightmap image) image :arbitrary)
altitudes (map #(:altitude %) (flatten world))
arbitraries (map #(:arbitrary %) (flatten world))]
(is (= altitudes arbitraries) "Altitudes and arbitraries are derived from same map so should be identical.")
)))