Type safety, redundant case removal, other cleanup.

git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@490 ed5b42cb-e716-0410-a449-f6a68f950b19
This commit is contained in:
Michael Bayne
2008-05-09 11:39:45 +00:00
parent 95400b6050
commit 51c01493f2
9 changed files with 63 additions and 78 deletions
@@ -238,8 +238,7 @@ public class ModelMesh extends TriMesh
((ModelController)controller).putClone(null, properties));
}
}
TriangleBatch batch = (TriangleBatch)getBatch(0),
mbatch = (TriangleBatch)mstore.getBatch(0);
TriangleBatch batch = getBatch(0), mbatch = mstore.getBatch(0);
mbatch.setVertexBuffer(properties.isSet("vertices") ?
batch.getVertexBuffer() :
BufferUtils.clone(batch.getVertexBuffer()));
@@ -317,7 +316,7 @@ public class ModelMesh extends TriMesh
"localRotation", null));
setLocalScale((Vector3f)capsule.readSavable(
"localScale", null));
TriangleBatch batch = (TriangleBatch)getBatch(0);
TriangleBatch batch = getBatch(0);
batch.setModelBound((BoundingVolume)capsule.readSavable(
"modelBound", null));
_textureKey = capsule.readString("textureKey", null);
@@ -344,8 +344,7 @@ public class SkinMesh extends ModelMesh
@Override // documentation inherited
public void expandModelBounds ()
{
BoundingVolume obound =
(BoundingVolume)getBatch(0).getModelBound().clone(null);
BoundingVolume obound = getBatch(0).getModelBound().clone(null);
updateModelBound();
getBatch(0).getModelBound().mergeLocal(obound);
}
@@ -538,8 +537,7 @@ public class SkinMesh extends ModelMesh
protected void storeFrame ()
{
if (_storeBlend) {
_frames.put(_storeFrameId, new BlendFrame(
(float[])_vbuf.clone(), (float[])_nbuf.clone()));
_frames.put(_storeFrameId, new BlendFrame(_vbuf.clone(), _nbuf.clone()));
} else {
TriangleBatch batch = getBatch(0), tbatch = new TriangleBatch();
tbatch.setParentGeom(DUMMY_MESH);
@@ -789,7 +789,7 @@ public class ModelViewer extends JmeCanvasApp
TextureKey.setLocationOverride(new TextureKey.LocationOverride() {
public URL getLocation (String name)
throws MalformedURLException {
return new URL(parent.toURL(), name);
return new URL(parent.toURI().toURL(), name);
}
});
try {
@@ -1107,7 +1107,7 @@ public class ModelViewer extends JmeCanvasApp
{
Vector3f target = new Vector3f();
if (_model != null) {
BoundingVolume bound = (BoundingVolume)_model.getWorldBound();
BoundingVolume bound = _model.getWorldBound();
if (bound != null) {
bound.getCenter(target);
}
@@ -99,13 +99,13 @@ public abstract class ShaderConfig
other._state.uniforms.put(uniform.name, (ShaderUniform)uniform.clone());
}
if (_lights != null) {
other._lights = (LightConfig[])_lights.clone();
other._lights = _lights.clone();
for (int ii = 0; ii < _lights.length; ii++) {
other._lights[ii] = (LightConfig)_lights[ii].clone();
}
}
if (_textures != null) {
other._textures = (TextureConfig[])_textures.clone();
other._textures = _textures.clone();
for (int ii = 0; ii < _textures.length; ii++) {
other._textures[ii] = (TextureConfig)_textures[ii].clone();
}