comparison clojure/com/aurellem/vbm.clj @ 134:718abf3bec8a

removed hardcoded /home/r/ strings from paths and made them relative to user.home
author Robert McIntyre <rlm@mit.edu>
date Sun, 18 Mar 2012 00:56:29 -0500
parents 65c2854c5875
children eb6ba88088d3
comparison
equal deleted inserted replaced
133:424510993296 134:718abf3bec8a
4 (:use com.aurellem.gb-driver)) 4 (:use com.aurellem.gb-driver))
5 5
6 ;;;;;;;;;;;;; read vbm file 6 ;;;;;;;;;;;;; read vbm file
7 7
8 (def ^:dynamic *moves-cache* 8 (def ^:dynamic *moves-cache*
9 (File. "/home/r/proj/pokemon-escape/moves/")) 9 (File. user-home "proj/pokemon-escape/moves/")))
10 10
11 (defn buttons [mask] 11 (defn buttons [mask]
12 (loop [buttons [] 12 (loop [buttons []
13 masks (seq (dissoc button-code :listen))] 13 masks (seq (dissoc button-code :listen))]
14 (if (empty? masks) buttons 14 (if (empty? masks) buttons
113 113
114 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; 114 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;
115 115
116 (use 'clojure.java.shell) 116 (use 'clojure.java.shell)
117 117
118 (def vba-linux (File. user-home "bin/vba-linux"))
118 119
119 (defn play-vbm [#^File vbm] 120 (defn play-vbm [#^File vbm]
120 (.delete yellow-save-file) 121 (.delete yellow-save-file)
121 (if (.exists vbm) 122 (if (.exists vbm)
122 (sh "/home/r/bin/vba-linux" 123 (sh (.getCanonicalPath vba-linux)
123 (str "--playmovie=" (.getCanonicalPath vbm)) 124 (str "--playmovie=" (.getCanonicalPath vbm))
124 (.getCanonicalPath yellow-rom-image))) 125 (.getCanonicalPath yellow-rom-image)))
125 nil) 126 nil)
126 127