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