Advertisement
Guest User

Untitled

a guest
Aug 13th, 2014
257
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (defn preload-animations []
  2.   (doseq [pair +preload-animations+]
  3.     (let [symbol (first pair) path (second pair) tw (nth pair 2) th (nth pair 3) ft (nth pair 4)]
  4.       (println "Preloading symbol" symbol "with path" path "width" tw "height" th "frame time" ft)
  5.       (let [output []]
  6.         (let [texture (new com.badlogic.gdx.graphics.Texture path)]
  7.           (let [trgs (com.badlogic.gdx.graphics.g2d.TextureRegion/split texture tw th)]
  8.             (println trgs)
  9.             (println (range (alength trgs)))
  10.             (for [i (range (alength trgs))]
  11.               (let [array (nth trgs i)]
  12.                 (println array)
  13.                 (for [j (range (alength array))]
  14.                   (conj output (nth (nth i trgs) j)))))))
  15.         (.put +animation-map+ symbol
  16.           (struct-map Animation
  17.                       :frames (reverse output)
  18.                       :frame-time ft))))))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement