# HG changeset patch # User Robert McIntyre # Date 1330608257 25200 # Node ID 52de8a36edde16d40d839b400ebf9382a0351c66 # Parent b84701e4f6aefbee28ea1a655e0e532556adb3a7 removed last vestiges of clojure.contrib diff -r b84701e4f6ae -r 52de8a36edde org/util.org --- a/org/util.org Thu Mar 01 05:56:52 2012 -0700 +++ b/org/util.org Thu Mar 01 06:24:17 2012 -0700 @@ -104,11 +104,11 @@ (:import com.jme3.scene.plugins.blender.BlenderModelLoader) (:import (java.util.logging Level Logger))) -(defvar println-repl - (bound-fn [& args] (apply println args)) +(def println-repl "println called from the LWJGL thread will not go to the REPL, but instead to whatever terminal started the JVM process. This function - will always output to the REPL") + will always output to the REPL" + (bound-fn [& args] (apply println args))) (defn position-camera "Change the position of the in-world camera." @@ -250,23 +250,23 @@ GImpact? ]) -(defvar base-shape - (shape-description. - "default-shape" - false - ;;ColorRGBA/Blue - 1.0 ;; mass - 1.0 ;; friction - ;; texture - "Textures/Terrain/BrickWall/BrickWall.jpg" - ;; material - "Common/MatDefs/Misc/Unshaded.j3md" - Vector3f/ZERO - Quaternion/IDENTITY - (Box. Vector3f/ZERO 0.5 0.5 0.5) - true - false) - "Basic settings for shapes.") +(def base-shape + "Basic settings for shapes." + (shape-description. + "default-shape" + false + ;;ColorRGBA/Blue + 1.0 ;; mass + 1.0 ;; friction + ;; texture + "Textures/Terrain/BrickWall/BrickWall.jpg" + ;; material + "Common/MatDefs/Misc/Unshaded.j3md" + Vector3f/ZERO + Quaternion/IDENTITY + (Box. Vector3f/ZERO 0.5 0.5 0.5) + true + false)) (defn make-shape [#^shape-description d] diff -r b84701e4f6ae -r 52de8a36edde org/world.org --- a/org/world.org Thu Mar 01 05:56:52 2012 -0700 +++ b/org/world.org Thu Mar 01 06:24:17 2012 -0700 @@ -53,9 +53,6 @@ driven exception handling" {:author "Robert McIntyre"} - (:use (clojure.contrib (def :only (defn-memo)))) - (:use [clojure.contrib [str-utils :only [re-gsub]]]) - (:import com.aurellem.capture.IsoTimer) (:import com.jme3.math.Vector3f) @@ -153,7 +150,7 @@ (defn integer-constants [class] (filter static-integer? (.getFields class))) -(defn-memo constant-map +(defn constant-map "Takes a class and creates a map of the static constant integer fields with their names. This helps with C wrappers where they have just defined a bunch of integer constants instead of enums" @@ -162,6 +159,7 @@ (into (sorted-map) (zipmap (map #(.get % nil) integer-fields) (map #(.getName %) integer-fields))))) +(alter-var-root #'constant-map memoize) (defn all-keys "Uses reflection to generate a map of string names to jme3 trigger @@ -170,7 +168,7 @@ (let [inputs (constant-map KeyInput)] (assoc (zipmap (map (fn [field] - (.toLowerCase (re-gsub #"_" "-" field))) (vals inputs)) + (.toLowerCase (.replaceAll field "_" "-"))) (vals inputs)) (map (fn [val] (KeyTrigger. val)) (keys inputs))) ;;explicitly add mouse controls "mouse-left" (MouseButtonTrigger. 0)