A bunch of Eclipse facilitated cleanup.

git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@734 ed5b42cb-e716-0410-a449-f6a68f950b19
This commit is contained in:
Michael Bayne
2008-12-09 02:00:28 +00:00
parent cd276073a2
commit 8fc55ee79b
36 changed files with 55 additions and 148 deletions
+2 -3
View File
@@ -45,7 +45,6 @@ import com.jme.system.lwjgl.LWJGLPropertiesDialog;
import com.jme.input.InputHandler; import com.jme.input.InputHandler;
import com.jme.input.KeyInput; import com.jme.input.KeyInput;
import com.jme.input.Mouse;
import com.jme.input.MouseInput; import com.jme.input.MouseInput;
import com.jmex.bui.BRootNode; import com.jmex.bui.BRootNode;
import com.jmex.bui.PolledRootNode; import com.jmex.bui.PolledRootNode;
@@ -203,7 +202,7 @@ public class JmeApp
// and process events until it's time to render the next // and process events until it's time to render the next
PROCESS_EVENTS: PROCESS_EVENTS:
do { do {
Runnable r = (Runnable)_evqueue.getNonBlocking(); Runnable r = _evqueue.getNonBlocking();
if (r != null) { if (r != null) {
r.run(); r.run();
} }
@@ -574,7 +573,7 @@ public class JmeApp
protected Timer _timer; protected Timer _timer;
protected Thread _dispatchThread; protected Thread _dispatchThread;
protected Queue _evqueue = new Queue(); protected Queue<Runnable> _evqueue = Queue.newQueue();
protected long _lastTick; protected long _lastTick;
protected float _frameTime; protected float _frameTime;
@@ -30,7 +30,6 @@ import java.awt.event.ComponentEvent;
import org.lwjgl.LWJGLException; import org.lwjgl.LWJGLException;
import com.jme.renderer.Renderer;
import com.jme.renderer.lwjgl.LWJGLRenderer; import com.jme.renderer.lwjgl.LWJGLRenderer;
import com.jme.scene.Node; import com.jme.scene.Node;
import com.jme.system.DisplaySystem; import com.jme.system.DisplaySystem;
@@ -28,6 +28,7 @@ import com.jme.math.Vector3f;
import com.jme.renderer.Camera; import com.jme.renderer.Camera;
import com.samskivert.util.ObserverList; import com.samskivert.util.ObserverList;
import com.threerings.jme.JmeApp;
/** /**
* Provides various useful mechanisms for manipulating the camera. * Provides various useful mechanisms for manipulating the camera.
@@ -376,21 +377,20 @@ public class CameraHandler
} }
/** Used to dispatch {@link CameraPath.Observer#pathCompleted}. */ /** Used to dispatch {@link CameraPath.Observer#pathCompleted}. */
protected static class CompletedOp implements ObserverList.ObserverOp protected static class CompletedOp implements ObserverList.ObserverOp<CameraPath.Observer>
{ {
public CompletedOp (CameraPath path) { public CompletedOp (CameraPath path) {
_path = path; _path = path;
} }
public boolean apply (Object observer) { public boolean apply (CameraPath.Observer observer) {
return ((CameraPath.Observer)observer).pathCompleted(_path); return observer.pathCompleted(_path);
} }
protected CameraPath _path; protected CameraPath _path;
} }
protected Camera _camera; protected Camera _camera;
protected CameraPath _campath; protected CameraPath _campath;
protected ObserverList _campathobs = protected ObserverList<CameraPath.Observer> _campathobs = ObserverList.newSafeInOrder();
new ObserverList(ObserverList.SAFE_IN_ORDER_NOTIFY);
protected Matrix3f _rotm = new Matrix3f(); protected Matrix3f _rotm = new Matrix3f();
protected Vector3f _temp = new Vector3f(); protected Vector3f _temp = new Vector3f();
@@ -21,8 +21,6 @@
package com.threerings.jme.camera; package com.threerings.jme.camera;
import com.jme.renderer.Camera;
/** /**
* Used to move the camera along a particular path. * Used to move the camera along a particular path.
*/ */
@@ -22,21 +22,13 @@
package com.threerings.jme.camera; package com.threerings.jme.camera;
import com.jme.math.FastMath; import com.jme.math.FastMath;
import com.jme.math.Matrix3f;
import com.jme.math.Vector3f;
import com.jme.renderer.Camera;
import com.jme.input.InputHandler; import com.jme.input.InputHandler;
import com.jme.input.KeyBindingManager; import com.jme.input.KeyBindingManager;
import com.jme.input.KeyInput; import com.jme.input.KeyInput;
import com.jme.input.RelativeMouse;
import com.jme.input.action.*; import com.jme.input.action.*;
import com.jme.input.action.InputActionEvent; import com.jme.input.action.InputActionEvent;
import com.threerings.jme.JmeApp;
import static com.threerings.jme.Log.log;
/** /**
* Sets up camera controls for moving around from a top-down perspective, * Sets up camera controls for moving around from a top-down perspective,
* suitable for strategy games and their ilk. The "ground" is assumed to be the * suitable for strategy games and their ilk. The "ground" is assumed to be the
@@ -47,7 +39,7 @@ public class GodViewHandler extends InputHandler
/** /**
* Creates the handler. * Creates the handler.
* *
* @param cam The camera to move with this handler. * @param camhand The camera to move with this handler.
*/ */
public GodViewHandler (CameraHandler camhand) public GodViewHandler (CameraHandler camhand)
{ {
@@ -24,8 +24,6 @@ package com.threerings.jme.camera;
import com.jme.math.Vector3f; import com.jme.math.Vector3f;
import com.jme.renderer.Camera; import com.jme.renderer.Camera;
import static com.threerings.jme.Log.log;
/** /**
* Moves the camera along a cubic Hermite spline path defined by the start and * Moves the camera along a cubic Hermite spline path defined by the start and
* end locations and directions. Spline formulas obtained from * end locations and directions. Spline formulas obtained from
@@ -24,7 +24,6 @@ package com.threerings.jme.camera;
import com.jme.math.FastMath; import com.jme.math.FastMath;
import com.jme.math.Quaternion; import com.jme.math.Quaternion;
import com.jme.math.Vector3f; import com.jme.math.Vector3f;
import com.jme.renderer.Camera;
import static com.threerings.jme.Log.log; import static com.threerings.jme.Log.log;
@@ -21,8 +21,6 @@
package com.threerings.jme.chat; package com.threerings.jme.chat;
import java.util.StringTokenizer;
import com.jme.renderer.ColorRGBA; import com.jme.renderer.ColorRGBA;
import com.jmex.bui.BButton; import com.jmex.bui.BButton;
@@ -34,8 +32,6 @@ import com.jmex.bui.event.ActionListener;
import com.jmex.bui.layout.BorderLayout; import com.jmex.bui.layout.BorderLayout;
import com.jmex.bui.layout.GroupLayout; import com.jmex.bui.layout.GroupLayout;
import com.threerings.util.Name;
import com.threerings.crowd.chat.client.ChatDirector; import com.threerings.crowd.chat.client.ChatDirector;
import com.threerings.crowd.chat.client.ChatDisplay; import com.threerings.crowd.chat.client.ChatDisplay;
import com.threerings.crowd.chat.client.SpeakService; import com.threerings.crowd.chat.client.SpeakService;
@@ -24,7 +24,6 @@ package com.threerings.jme.effect;
import com.jme.math.Vector3f; import com.jme.math.Vector3f;
import com.jme.renderer.ColorRGBA; import com.jme.renderer.ColorRGBA;
import com.jme.renderer.Renderer; import com.jme.renderer.Renderer;
import com.jme.scene.Geometry;
import com.jme.scene.Node; import com.jme.scene.Node;
import com.jme.scene.shape.Quad; import com.jme.scene.shape.Quad;
import com.jme.scene.state.AlphaState; import com.jme.scene.state.AlphaState;
@@ -37,9 +37,6 @@ import com.jme.util.export.JMEImporter;
import com.jme.util.export.InputCapsule; import com.jme.util.export.InputCapsule;
import com.jme.util.export.OutputCapsule; import com.jme.util.export.OutputCapsule;
import com.threerings.jme.sprite.PathUtil;
import com.threerings.jme.util.JmeUtil;
/** /**
* Orients its target towards the camera plane. * Orients its target towards the camera plane.
*/ */
+13 -19
View File
@@ -25,21 +25,19 @@ import java.io.File;
import java.io.FileInputStream; import java.io.FileInputStream;
import java.io.FileOutputStream; import java.io.FileOutputStream;
import java.io.IOException; import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;
import java.nio.FloatBuffer; import java.nio.FloatBuffer;
import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.HashMap; import java.util.HashMap;
import java.util.HashSet; import java.util.HashSet;
import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Properties; import java.util.Properties;
import com.google.common.collect.Maps;
import com.jme.bounding.BoundingVolume; import com.jme.bounding.BoundingVolume;
import com.jme.math.FastMath;
import com.jme.math.Quaternion; import com.jme.math.Quaternion;
import com.jme.math.Vector3f; import com.jme.math.Vector3f;
import com.jme.renderer.Camera; import com.jme.renderer.Camera;
@@ -140,7 +138,7 @@ public class Model extends ModelNode
* *
* @param pnodes a mapping from prototype nodes to instance nodes * @param pnodes a mapping from prototype nodes to instance nodes
*/ */
public Animation rebind (HashMap pnodes) public Animation rebind (Map<ModelSpatial, ModelSpatial> pnodes)
{ {
Animation anim = new Animation(); Animation anim = new Animation();
anim.frameRate = frameRate; anim.frameRate = frameRate;
@@ -176,7 +174,7 @@ public class Model extends ModelNode
} }
// documentation inherited // documentation inherited
public Class getClassTag () public Class<?> getClassTag ()
{ {
return getClass(); return getClass();
} }
@@ -224,7 +222,7 @@ public class Model extends ModelNode
capsule.write(pxforms, "transforms", null); capsule.write(pxforms, "transforms", null);
} }
protected Spatial[] rebind (Spatial[] targets, HashMap pnodes) protected Spatial[] rebind (Spatial[] targets, Map<ModelSpatial, ModelSpatial> pnodes)
{ {
Spatial[] ntargets = new Spatial[targets.length]; Spatial[] ntargets = new Spatial[targets.length];
for (int ii = 0; ii < targets.length; ii++) { for (int ii = 0; ii < targets.length; ii++) {
@@ -312,7 +310,7 @@ public class Model extends ModelNode
public int random; public int random;
/** Maps original objects to their copies. */ /** Maps original objects to their copies. */
public HashMap originalToCopy = new HashMap(); public Map<ModelSpatial, ModelSpatial> originalToCopy = Maps.newHashMap();
public CloneCreator (Model toCopy) public CloneCreator (Model toCopy)
{ {
@@ -736,8 +734,7 @@ public class Model extends ModelNode
} else { } else {
_anims = null; _anims = null;
} }
ArrayList controllers = capsule.readSavableArrayList( List<?> controllers = capsule.readSavableArrayList("controllers", null);
"controllers", null);
if (controllers != null) { if (controllers != null) {
for (Object ctrl : controllers) { for (Object ctrl : controllers) {
addController((Controller)ctrl); addController((Controller)ctrl);
@@ -877,7 +874,7 @@ public class Model extends ModelNode
if (_anims != null) { if (_anims != null) {
mstore._anims = new HashMap<String, Animation>(); mstore._anims = new HashMap<String, Animation>();
} }
mstore._pnodes = (HashMap)properties.originalToCopy.clone(); mstore._pnodes = Maps.newHashMap(properties.originalToCopy);
mstore._animMode = _animMode; mstore._animMode = _animMode;
return mstore; return mstore;
} }
@@ -1076,20 +1073,17 @@ public class Model extends ModelNode
} }
} }
/** A reference to the prototype, or <code>null</code> if this is a /** A reference to the prototype, or <code>null</code> if this is a prototype. */
* prototype. */
protected Model _prototype; protected Model _prototype;
/** For prototype models, a customized clone creator used to generate /** For prototype models, a customized clone creator used to generate instances. */
* instances. */
protected CloneCreator _ccreator; protected CloneCreator _ccreator;
/** The animation mode to use for this model. */ /** The animation mode to use for this model. */
protected AnimationMode _animMode; protected AnimationMode _animMode;
/** For instances, maps prototype nodes to their corresponding instance /** For instances, maps prototype nodes to their corresponding instance nodes. */
* nodes. */ protected Map<ModelSpatial, ModelSpatial> _pnodes;
protected HashMap _pnodes;
/** The model properties. */ /** The model properties. */
protected Properties _props; protected Properties _props;
@@ -28,7 +28,6 @@ import java.util.HashSet;
import java.util.Properties; import java.util.Properties;
import com.jme.scene.Controller; import com.jme.scene.Controller;
import com.jme.scene.Node;
import com.jme.scene.Spatial; import com.jme.scene.Spatial;
import com.jme.util.export.JMEExporter; import com.jme.util.export.JMEExporter;
import com.jme.util.export.JMEImporter; import com.jme.util.export.JMEImporter;
@@ -22,14 +22,10 @@
package com.threerings.jme.model; package com.threerings.jme.model;
import java.io.IOException; import java.io.IOException;
import java.io.ObjectInput;
import java.io.ObjectOutput;
import java.nio.FloatBuffer; import java.nio.FloatBuffer;
import java.nio.IntBuffer; import java.nio.IntBuffer;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import java.util.Properties; import java.util.Properties;
import com.jme.bounding.BoundingBox; import com.jme.bounding.BoundingBox;
@@ -42,8 +38,6 @@ import com.jme.math.Quaternion;
import com.jme.math.Vector3f; import com.jme.math.Vector3f;
import com.jme.renderer.ColorRGBA; import com.jme.renderer.ColorRGBA;
import com.jme.renderer.Renderer; import com.jme.renderer.Renderer;
import com.jme.scene.Controller;
import com.jme.scene.SharedMesh;
import com.jme.scene.Spatial; import com.jme.scene.Spatial;
import com.jme.scene.TriMesh; import com.jme.scene.TriMesh;
import com.jme.scene.VBOInfo; import com.jme.scene.VBOInfo;
@@ -68,8 +62,6 @@ import com.samskivert.util.StringUtil;
import com.threerings.jme.util.ShaderCache; import com.threerings.jme.util.ShaderCache;
import static com.threerings.jme.Log.log;
/** /**
* A {@link TriMesh} with a serialization mechanism tailored to stored models. * A {@link TriMesh} with a serialization mechanism tailored to stored models.
*/ */
@@ -21,17 +21,15 @@
package com.threerings.jme.model; package com.threerings.jme.model;
import java.io.DataOutput;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList;
import java.util.HashSet; import java.util.HashSet;
import java.util.List;
import com.jme.math.Matrix4f; import com.jme.math.Matrix4f;
import com.jme.math.Quaternion; import com.jme.math.Quaternion;
import com.jme.math.Vector3f; import com.jme.math.Vector3f;
import com.jme.renderer.Renderer; import com.jme.renderer.Renderer;
import com.jme.scene.Controller;
import com.jme.scene.Node; import com.jme.scene.Node;
import com.jme.scene.Spatial; import com.jme.scene.Spatial;
import com.jme.scene.state.RenderState; import com.jme.scene.state.RenderState;
@@ -43,8 +41,6 @@ import com.jme.util.export.OutputCapsule;
import com.threerings.jme.util.JmeUtil; import com.threerings.jme.util.JmeUtil;
import com.threerings.jme.util.ShaderCache; import com.threerings.jme.util.ShaderCache;
import static com.threerings.jme.Log.log;
/** /**
* A {@link Node} with a serialization mechanism tailored to stored models. * A {@link Node} with a serialization mechanism tailored to stored models.
*/ */
@@ -194,7 +190,7 @@ public class ModelNode extends Node
"localRotation", null)); "localRotation", null));
setLocalScale((Vector3f)capsule.readSavable( setLocalScale((Vector3f)capsule.readSavable(
"localScale", null)); "localScale", null));
ArrayList children = capsule.readSavableArrayList("children", null); List<?> children = capsule.readSavableArrayList("children", null);
if (children != null) { if (children != null) {
for (Object child : children) { for (Object child : children) {
attachChild((Spatial)child); attachChild((Spatial)child);
@@ -70,8 +70,7 @@ public interface ModelSpatial
* @param frameId the frame id, which uniquely identifies one frame of * @param frameId the frame id, which uniquely identifies one frame of
* one animation * one animation
* @param blend whether or not the stored frames will be retrieved by * @param blend whether or not the stored frames will be retrieved by
* calls to {@link #blendAnimationFrames} as opposed to * calls to {@link #blendMeshFrames} as opposed to {@link #setMeshFrame}
* {@link #setAnimationFrames}
*/ */
public void storeMeshFrame (int frameId, boolean blend); public void storeMeshFrame (int frameId, boolean blend);
@@ -34,12 +34,8 @@ import com.jme.util.export.JMEImporter;
import com.jme.util.export.InputCapsule; import com.jme.util.export.InputCapsule;
import com.jme.util.export.OutputCapsule; import com.jme.util.export.OutputCapsule;
import com.samskivert.util.StringUtil;
import com.threerings.jme.util.JmeUtil; import com.threerings.jme.util.JmeUtil;
import static com.threerings.jme.Log.log;
/** /**
* A procedural animation that rotates a node around at a constant angular * A procedural animation that rotates a node around at a constant angular
* velocity. * velocity.
@@ -22,8 +22,6 @@
package com.threerings.jme.model; package com.threerings.jme.model;
import java.io.IOException; import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.Serializable;
import java.nio.ByteBuffer; import java.nio.ByteBuffer;
import java.nio.FloatBuffer; import java.nio.FloatBuffer;
@@ -33,12 +31,12 @@ import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.HashMap; import java.util.HashMap;
import java.util.HashSet; import java.util.HashSet;
import java.util.Map;
import org.lwjgl.opengl.GLContext; import org.lwjgl.opengl.GLContext;
import com.jme.bounding.BoundingVolume; import com.jme.bounding.BoundingVolume;
import com.jme.math.Matrix4f; import com.jme.math.Matrix4f;
import com.jme.math.Vector3f;
import com.jme.renderer.Renderer; import com.jme.renderer.Renderer;
import com.jme.scene.Spatial; import com.jme.scene.Spatial;
import com.jme.scene.TriMesh; import com.jme.scene.TriMesh;
@@ -64,8 +62,6 @@ import com.threerings.jme.util.JmeUtil;
import com.threerings.jme.util.ShaderCache; import com.threerings.jme.util.ShaderCache;
import com.threerings.jme.util.ShaderConfig; import com.threerings.jme.util.ShaderConfig;
import static com.threerings.jme.Log.log;
/** /**
* A triangle mesh that deforms according to a bone hierarchy. * A triangle mesh that deforms according to a bone hierarchy.
*/ */
@@ -98,7 +94,7 @@ public class SkinMesh extends ModelMesh
* *
* @param bmap the mapping from prototype to instance bones * @param bmap the mapping from prototype to instance bones
*/ */
public WeightGroup rebind (HashMap<Bone, Bone> bmap) public WeightGroup rebind (Map<Bone, Bone> bmap)
{ {
WeightGroup wgroup = new WeightGroup(); WeightGroup wgroup = new WeightGroup();
wgroup.vertexCount = vertexCount; wgroup.vertexCount = vertexCount;
@@ -111,7 +107,7 @@ public class SkinMesh extends ModelMesh
} }
// documentation inherited // documentation inherited
public Class getClassTag () public Class<?> getClassTag ()
{ {
return getClass(); return getClass();
} }
@@ -169,7 +165,7 @@ public class SkinMesh extends ModelMesh
* *
* @param pnodes a mapping from prototype nodes to instance nodes * @param pnodes a mapping from prototype nodes to instance nodes
*/ */
public Bone rebind (HashMap pnodes) public Bone rebind (Map<ModelSpatial, ModelSpatial> pnodes)
{ {
Bone bone = new Bone((ModelNode)pnodes.get(node)); Bone bone = new Bone((ModelNode)pnodes.get(node));
bone.invRefTransform = invRefTransform; bone.invRefTransform = invRefTransform;
@@ -178,7 +174,7 @@ public class SkinMesh extends ModelMesh
} }
// documentation inherited // documentation inherited
public Class getClassTag () public Class<?> getClassTag ()
{ {
return getClass(); return getClass();
} }
@@ -26,7 +26,6 @@ import java.io.IOException;
import java.util.Properties; import java.util.Properties;
import com.jme.image.Texture; import com.jme.image.Texture;
import com.jme.math.Vector2f;
import com.jme.math.Vector3f; import com.jme.math.Vector3f;
import com.jme.scene.Controller; import com.jme.scene.Controller;
import com.jme.scene.Spatial; import com.jme.scene.Spatial;
@@ -35,13 +34,8 @@ import com.jme.util.export.JMEImporter;
import com.jme.util.export.InputCapsule; import com.jme.util.export.InputCapsule;
import com.jme.util.export.OutputCapsule; import com.jme.util.export.OutputCapsule;
import com.samskivert.util.StringUtil;
import com.threerings.jme.util.JmeUtil; import com.threerings.jme.util.JmeUtil;
import com.threerings.jme.util.JmeUtil.FrameState; import com.threerings.jme.util.JmeUtil.FrameState;
import com.threerings.jme.util.SpatialVisitor;
import static com.threerings.jme.Log.log;
/** /**
* Animates a model's textures by flipping between different parts. * Animates a model's textures by flipping between different parts.
@@ -23,8 +23,6 @@ package com.threerings.jme.model;
import java.util.HashMap; import java.util.HashMap;
import org.lwjgl.opengl.Display;
import com.jme.image.Texture; import com.jme.image.Texture;
import com.jme.scene.state.RenderState; import com.jme.scene.state.RenderState;
import com.jme.scene.state.TextureState; import com.jme.scene.state.TextureState;
@@ -37,8 +37,6 @@ import com.jme.util.export.OutputCapsule;
import com.samskivert.util.StringUtil; import com.samskivert.util.StringUtil;
import com.threerings.jme.util.SpatialVisitor;
import static com.threerings.jme.Log.log; import static com.threerings.jme.Log.log;
/** /**
@@ -25,7 +25,6 @@ import java.io.IOException;
import java.util.Properties; import java.util.Properties;
import com.jme.math.Quaternion;
import com.jme.math.Vector3f; import com.jme.math.Vector3f;
import com.jme.scene.Controller; import com.jme.scene.Controller;
import com.jme.scene.Spatial; import com.jme.scene.Spatial;
@@ -34,12 +33,8 @@ import com.jme.util.export.JMEImporter;
import com.jme.util.export.InputCapsule; import com.jme.util.export.InputCapsule;
import com.jme.util.export.OutputCapsule; import com.jme.util.export.OutputCapsule;
import com.samskivert.util.StringUtil;
import com.threerings.jme.util.JmeUtil; import com.threerings.jme.util.JmeUtil;
import static com.threerings.jme.Log.log;
/** /**
* A procedural animation that moves a node along a straight line at a constant velocity (then * A procedural animation that moves a node along a straight line at a constant velocity (then
* either repeats or moves it in the other direction). * either repeats or moves it in the other direction).
@@ -22,8 +22,11 @@
package com.threerings.jme.tile; package com.threerings.jme.tile;
import java.io.Serializable; import java.io.Serializable;
import java.util.ArrayList; import java.util.List;
import java.util.HashMap; import java.util.Map;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.samskivert.util.StringUtil; import com.samskivert.util.StringUtil;
@@ -46,7 +49,7 @@ public class FringeConfiguration implements Serializable
public int priority; public int priority;
/** A list of the fringe records that can be used for fringing. */ /** A list of the fringe records that can be used for fringing. */
public ArrayList fringes = new ArrayList(); public List<FringeRecord> fringes = Lists.newArrayList();
/** Used when parsing from an XML definition. */ /** Used when parsing from an XML definition. */
public void addFringe (FringeRecord record) public void addFringe (FringeRecord record)
@@ -123,13 +126,13 @@ public class FringeConfiguration implements Serializable
*/ */
public int fringesOn (String fringer, String fringed) public int fringesOn (String fringer, String fringed)
{ {
TileRecord f1 = (TileRecord)_trecs.get(fringer); TileRecord f1 = _trecs.get(fringer);
// we better have a fringe record for the fringer // we better have a fringe record for the fringer
if (null != f1) { if (null != f1) {
// it had better have some types defined // it had better have some types defined
if (f1.fringes.size() > 0) { if (f1.fringes.size() > 0) {
TileRecord f2 = (TileRecord)_trecs.get(fringed); TileRecord f2 = _trecs.get(fringed);
// and we only fringe if fringed doesn't have a fringe // and we only fringe if fringed doesn't have a fringe
// record or has a lower priority // record or has a lower priority
if ((null == f2) || (f1.priority > f2.priority)) { if ((null == f2) || (f1.priority > f2.priority)) {
@@ -147,12 +150,12 @@ public class FringeConfiguration implements Serializable
*/ */
public FringeRecord getFringe (String type, int hashValue) public FringeRecord getFringe (String type, int hashValue)
{ {
TileRecord t = (TileRecord)_trecs.get(type); TileRecord t = _trecs.get(type);
return (FringeRecord)t.fringes.get(hashValue % t.fringes.size()); return t.fringes.get(hashValue % t.fringes.size());
} }
/** The mapping from tile type to tile record. */ /** The mapping from tile type to tile record. */
protected HashMap _trecs = new HashMap(); protected Map<String, TileRecord> _trecs = Maps.newHashMap();
/** Increase this value when object's serialized state is impacted by /** Increase this value when object's serialized state is impacted by
* a class change (modification of fields, inheritance). */ * a class change (modification of fields, inheritance). */
@@ -24,8 +24,10 @@ package com.threerings.jme.tile;
import java.awt.Graphics2D; import java.awt.Graphics2D;
import java.awt.Transparency; import java.awt.Transparency;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
import java.util.ArrayList; import java.util.List;
import java.util.HashMap; import java.util.Map;
import com.google.common.collect.Lists;
import com.samskivert.util.QuickSort; import com.samskivert.util.QuickSort;
@@ -83,7 +85,7 @@ public class TileFringer
* using a fringe mask. * using a fringe mask.
*/ */
public BufferedImage getFringeTile ( public BufferedImage getFringeTile (
TileSource tiles, int col, int row, HashMap masks) TileSource tiles, int col, int row, Map<String, BufferedImage> masks)
{ {
// get the type of the tile we are considering // get the type of the tile we are considering
String baseType = tiles.getTileType(col, row); String baseType = tiles.getTileType(col, row);
@@ -141,7 +143,7 @@ public class TileFringer
* Compose a fringe tile out of the various fringe images needed. * Compose a fringe tile out of the various fringe images needed.
*/ */
protected BufferedImage composeFringeTile ( protected BufferedImage composeFringeTile (
String baseType, FringerRec[] fringers, HashMap masks, int hashValue) String baseType, FringerRec[] fringers, Map<String, BufferedImage> masks, int hashValue)
{ {
// sort the array so that higher priority fringers get drawn first // sort the array so that higher priority fringers get drawn first
QuickSort.sort(fringers); QuickSort.sort(fringers);
@@ -180,7 +182,7 @@ public class TileFringer
*/ */
protected void stampTileImage ( protected void stampTileImage (
Graphics2D gfx, String fringerType, int index, Graphics2D gfx, String fringerType, int index,
HashMap masks, int hashValue) Map<String, BufferedImage> masks, int hashValue)
{ {
FringeConfiguration.FringeRecord frec = FringeConfiguration.FringeRecord frec =
_config.getFringe(fringerType, hashValue); _config.getFringe(fringerType, hashValue);
@@ -195,7 +197,7 @@ public class TileFringer
if (frec.mask) { if (frec.mask) {
// it's a mask; look for it in the cache // it's a mask; look for it in the cache
String maskkey = fringerType + ":" + frec.name + ":" + index; String maskkey = fringerType + ":" + frec.name + ":" + index;
BufferedImage mimg = (BufferedImage)masks.get(maskkey); BufferedImage mimg = masks.get(maskkey);
if (mimg == null) { if (mimg == null) {
BufferedImage fsrc = getSubimage(fsimg, index); BufferedImage fsrc = getSubimage(fsimg, index);
BufferedImage bsrc = _isrc.getTileSource(fringerType); BufferedImage bsrc = _isrc.getTileSource(fringerType);
@@ -250,7 +252,7 @@ public class TileFringer
return new int[0]; return new int[0];
} }
ArrayList indexes = new ArrayList(); List<Integer> indexes = Lists.newArrayList();
int weebits = 0; int weebits = 0;
for (int ii=(start + 1) % NUM_FRINGEBITS; ii != start; for (int ii=(start + 1) % NUM_FRINGEBITS; ii != start;
ii = (ii + 1) % NUM_FRINGEBITS) { ii = (ii + 1) % NUM_FRINGEBITS) {
@@ -274,14 +276,14 @@ public class TileFringer
int[] ret = new int[indexes.size()]; int[] ret = new int[indexes.size()];
for (int ii=0; ii < ret.length; ii++) { for (int ii=0; ii < ret.length; ii++) {
ret[ii] = ((Integer) indexes.get(ii)).intValue(); ret[ii] = indexes.get(ii).intValue();
} }
return ret; return ret;
} }
/** A record for holding information about a particular fringe as /** A record for holding information about a particular fringe as
* we're computing what it will look like. */ * we're computing what it will look like. */
protected static class FringerRec implements Comparable protected static class FringerRec implements Comparable<FringerRec>
{ {
public String fringerType; public String fringerType;
public int priority; public int priority;
@@ -310,8 +312,8 @@ public class TileFringer
return toArray(0); return toArray(0);
} }
public int compareTo (Object o) { public int compareTo (FringerRec o) {
return priority - ((FringerRec) o).priority; return priority - o.priority;
} }
public String toString () { public String toString () {
@@ -27,7 +27,6 @@ import java.io.Serializable;
import org.apache.tools.ant.BuildException; import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Task; import org.apache.tools.ant.Task;
import com.samskivert.io.PersistenceException;
import com.threerings.util.CompiledConfig; import com.threerings.util.CompiledConfig;
import com.threerings.jme.tile.tools.xml.FringeConfigurationParser; import com.threerings.jme.tile.tools.xml.FringeConfigurationParser;
@@ -25,7 +25,6 @@ import java.io.Serializable;
import org.apache.commons.digester.Digester; import org.apache.commons.digester.Digester;
import com.samskivert.util.StringUtil;
import com.samskivert.xml.SetPropertyFieldsRule; import com.samskivert.xml.SetPropertyFieldsRule;
import com.threerings.tools.xml.CompiledConfigParser; import com.threerings.tools.xml.CompiledConfigParser;
@@ -34,8 +33,6 @@ import com.threerings.jme.tile.FringeConfiguration.TileRecord;
import com.threerings.jme.tile.FringeConfiguration.FringeRecord; import com.threerings.jme.tile.FringeConfiguration.FringeRecord;
import com.threerings.jme.tile.FringeConfiguration; import com.threerings.jme.tile.FringeConfiguration;
import static com.threerings.jme.Log.log;
/** /**
* Parses fringe config definitions, which look like so (with angle * Parses fringe config definitions, which look like so (with angle
* brackets instead of square): * brackets instead of square):
@@ -41,8 +41,6 @@ import com.threerings.jme.util.JmeUtil;
import com.threerings.jme.tools.ModelDef.TransformNode; import com.threerings.jme.tools.ModelDef.TransformNode;
import static com.threerings.jme.Log.log;
/** /**
* A basic representation for keyframe animations. * A basic representation for keyframe animations.
*/ */
@@ -28,7 +28,6 @@ import java.io.IOException;
import javax.imageio.ImageIO; import javax.imageio.ImageIO;
import com.jme.image.Texture;
import com.jme.math.FastMath; import com.jme.math.FastMath;
import com.jme.math.Vector3f; import com.jme.math.Vector3f;
@@ -83,9 +82,7 @@ public class BuildSphereMap
Vector3f vec = new Vector3f(); Vector3f vec = new Vector3f();
for (int y = 0, idx = 0; y < size; y++) { for (int y = 0, idx = 0; y < size; y++) {
for (int x = 0; x < size; x++, idx++) { for (int x = 0; x < size; x++, idx++) {
float vx = x / (size*0.5f) - 1f, vy = y / (size*0.5f) - 1f, float vx = x / (size*0.5f) - 1f, vy = y / (size*0.5f) - 1f, d2 = vx*vx + vy*vy;
d2 = vx*vx + vy*vy;
int p = 0;
if (d2 <= 1f) { if (d2 <= 1f) {
vec.set(vx, vy, FastMath.sqrt(1f - d2)); vec.set(vx, vy, FastMath.sqrt(1f - d2));
rgb[idx] = getCubeMapPixel(vec, sides); rgb[idx] = getCubeMapPixel(vec, sides);
@@ -23,11 +23,7 @@ package com.threerings.jme.tools;
import java.io.File; import java.io.File;
import java.io.FileInputStream; import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;
import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.Properties; import java.util.Properties;
import java.util.logging.Level; import java.util.logging.Level;
@@ -41,9 +37,6 @@ import com.samskivert.util.PropertiesUtil;
import com.samskivert.util.StringUtil; import com.samskivert.util.StringUtil;
import com.threerings.jme.model.Model; import com.threerings.jme.model.Model;
import com.threerings.jme.model.ModelMesh;
import com.threerings.jme.model.ModelNode;
import com.threerings.jme.model.SkinMesh;
import com.threerings.jme.tools.ModelDef.TransformNode; import com.threerings.jme.tools.ModelDef.TransformNode;
import com.threerings.jme.tools.xml.AnimationParser; import com.threerings.jme.tools.xml.AnimationParser;
import com.threerings.jme.tools.xml.ModelParser; import com.threerings.jme.tools.xml.ModelParser;
@@ -53,7 +53,6 @@ public class ConvertModel
// create a dummy display system which the converters need // create a dummy display system which the converters need
new DummyDisplaySystem(); new DummyDisplaySystem();
ConvertModel app = new ConvertModel();
File source = new File(args[0]); File source = new File(args[0]);
File target = new File(args[1]); File target = new File(args[1]);
@@ -21,14 +21,11 @@
package com.threerings.jme.tools; package com.threerings.jme.tools;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.FloatBuffer; import java.nio.FloatBuffer;
import java.nio.IntBuffer; import java.nio.IntBuffer;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap; import java.util.HashMap;
import java.util.HashSet; import java.util.HashSet;
import java.util.Iterator; import java.util.Iterator;
@@ -45,7 +42,6 @@ import com.jme.math.Quaternion;
import com.jme.math.Vector3f; import com.jme.math.Vector3f;
import com.jme.scene.Node; import com.jme.scene.Node;
import com.jme.scene.Spatial; import com.jme.scene.Spatial;
import com.jme.scene.batch.GeomBatch;
import com.jme.util.geom.BufferUtils; import com.jme.util.geom.BufferUtils;
import com.samskivert.util.ObjectUtil; import com.samskivert.util.ObjectUtil;
@@ -59,7 +55,6 @@ import com.threerings.jme.model.ModelMesh;
import com.threerings.jme.model.ModelNode; import com.threerings.jme.model.ModelNode;
import com.threerings.jme.model.SkinMesh; import com.threerings.jme.model.SkinMesh;
import com.threerings.jme.util.JmeUtil; import com.threerings.jme.util.JmeUtil;
import com.threerings.jme.util.SpatialVisitor;
import static com.threerings.jme.Log.log; import static com.threerings.jme.Log.log;
@@ -22,18 +22,14 @@
package com.threerings.jme.tools; package com.threerings.jme.tools;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.Point; import java.awt.Point;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent; import java.awt.event.KeyEvent;
import java.awt.event.MouseAdapter; import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent; import java.awt.event.MouseEvent;
import java.awt.event.MouseMotionListener; import java.awt.event.MouseMotionListener;
import java.awt.event.MouseWheelEvent; import java.awt.event.MouseWheelEvent;
import java.awt.event.MouseWheelListener; import java.awt.event.MouseWheelListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.File; import java.io.File;
import java.io.FileOutputStream; import java.io.FileOutputStream;
@@ -421,8 +417,7 @@ public class ModelViewer extends JmeCanvasApp
protected void updateCameraPosition () protected void updateCameraPosition ()
{ {
Camera cam = _camhand.getCamera(); Camera cam = _camhand.getCamera();
Vector3f pos = cam.getLocation(), dir = cam.getDirection(), Vector3f pos = cam.getLocation(), dir = cam.getDirection();
left = cam.getLeft();
float heading = -FastMath.atan2(dir.x, dir.y) * FastMath.RAD_TO_DEG, float heading = -FastMath.atan2(dir.x, dir.y) * FastMath.RAD_TO_DEG,
pitch = FastMath.asin(dir.z) * FastMath.RAD_TO_DEG; pitch = FastMath.asin(dir.z) * FastMath.RAD_TO_DEG;
_campos.setText( _campos.setText(
@@ -23,7 +23,6 @@ package com.threerings.jme.util;
import java.lang.ref.WeakReference; import java.lang.ref.WeakReference;
import java.util.HashMap; import java.util.HashMap;
import java.util.logging.Level;
import java.nio.ByteBuffer; import java.nio.ByteBuffer;
import java.nio.ByteOrder; import java.nio.ByteOrder;
@@ -23,7 +23,6 @@ package com.threerings.jme.util;
import java.io.BufferedReader; import java.io.BufferedReader;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader; import java.io.InputStreamReader;
import java.nio.ByteBuffer; import java.nio.ByteBuffer;
@@ -3,7 +3,6 @@
package com.threerings.jme.client; package com.threerings.jme.client;
import com.jmex.bui.BLabel;
import com.jmex.bui.BWindow; import com.jmex.bui.BWindow;
import com.jmex.bui.layout.BorderLayout; import com.jmex.bui.layout.BorderLayout;
@@ -6,7 +6,6 @@ package com.threerings.jme.server;
import com.google.inject.Guice; import com.google.inject.Guice;
import com.google.inject.Injector; import com.google.inject.Injector;
import com.threerings.crowd.data.PlaceObject;
import com.threerings.crowd.server.CrowdServer; import com.threerings.crowd.server.CrowdServer;
import com.threerings.crowd.server.PlaceManager; import com.threerings.crowd.server.PlaceManager;
@@ -14,7 +14,6 @@ import com.jme.renderer.ColorRGBA;
import com.jme.scene.shape.Box; import com.jme.scene.shape.Box;
import com.jme.scene.shape.Disk; import com.jme.scene.shape.Disk;
import com.jme.scene.shape.Quad; import com.jme.scene.shape.Quad;
import com.jme.scene.shape.Sphere;
import com.jme.scene.state.LightState; import com.jme.scene.state.LightState;
import com.jme.util.LoggingSystem; import com.jme.util.LoggingSystem;