Nixed a bunch of redundant casts.
git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@304 ed5b42cb-e716-0410-a449-f6a68f950b19
This commit is contained in:
@@ -607,7 +607,7 @@ public class MisoScenePanel extends VirtualMediaPanel
|
||||
// there are any items in the array)
|
||||
int icount = _hitList.size();
|
||||
if (icount > 0) {
|
||||
DirtyItem item = (DirtyItem)_hitList.get(icount-1);
|
||||
DirtyItem item = _hitList.get(icount-1);
|
||||
hobject = item.obj;
|
||||
}
|
||||
|
||||
|
||||
@@ -141,7 +141,7 @@ public class SceneBlock
|
||||
// resolve our objects
|
||||
ObjectSet set = new ObjectSet();
|
||||
model.getObjects(_bounds, set);
|
||||
ArrayList scobjs = new ArrayList();
|
||||
ArrayList<SceneObject> scobjs = new ArrayList<SceneObject>();
|
||||
now = System.currentTimeMillis();
|
||||
for (int ii = 0, ll = set.size(); ii < ll; ii++) {
|
||||
SceneObject scobj = new SceneObject(_panel, set.get(ii));
|
||||
@@ -163,8 +163,7 @@ public class SceneBlock
|
||||
", elapsed=" + elapsed + "].");
|
||||
}
|
||||
}
|
||||
_objects = (SceneObject[])scobjs.toArray(
|
||||
new SceneObject[scobjs.size()]);
|
||||
_objects = scobjs.toArray(new SceneObject[scobjs.size()]);
|
||||
|
||||
// resolve our default tileset
|
||||
int bsetid = model.getDefaultBaseTileSet();
|
||||
@@ -339,8 +338,7 @@ public class SceneBlock
|
||||
}
|
||||
}
|
||||
|
||||
_objects = (SceneObject[])
|
||||
ArrayUtil.append(_objects, new SceneObject(_panel, info));
|
||||
_objects = ArrayUtil.append(_objects, new SceneObject(_panel, info));
|
||||
|
||||
// clear out our neighbors array so that the subsequent update
|
||||
// causes us to recompute our coverage
|
||||
@@ -367,7 +365,7 @@ public class SceneBlock
|
||||
if (oidx == -1) {
|
||||
return false;
|
||||
}
|
||||
_objects = (SceneObject[])ArrayUtil.splice(_objects, oidx, 1);
|
||||
_objects = ArrayUtil.splice(_objects, oidx, 1);
|
||||
|
||||
// clear out our neighbors array so that the subsequent update
|
||||
// causes us to recompute our coverage
|
||||
|
||||
@@ -147,7 +147,7 @@ public class SimpleMisoSceneModel extends MisoSceneModel
|
||||
public boolean addObject (ObjectInfo info)
|
||||
{
|
||||
if (info.isInteresting()) {
|
||||
objectInfo = (ObjectInfo[])ArrayUtil.append(objectInfo, info);
|
||||
objectInfo = ArrayUtil.append(objectInfo, info);
|
||||
} else {
|
||||
objectTileIds = ArrayUtil.append(objectTileIds, info.tileId);
|
||||
objectXs = ArrayUtil.append(objectXs, (short)info.x);
|
||||
@@ -170,7 +170,7 @@ public class SimpleMisoSceneModel extends MisoSceneModel
|
||||
// look for it in the interesting info array
|
||||
int oidx = ListUtil.indexOf(objectInfo, info);
|
||||
if (oidx != -1) {
|
||||
objectInfo = (ObjectInfo[])ArrayUtil.splice(objectInfo, oidx, 1);
|
||||
objectInfo = ArrayUtil.splice(objectInfo, oidx, 1);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -190,11 +190,11 @@ public class SimpleMisoSceneModel extends MisoSceneModel
|
||||
public Object clone ()
|
||||
{
|
||||
SimpleMisoSceneModel model = (SimpleMisoSceneModel)super.clone();
|
||||
model.baseTileIds = (int[])baseTileIds.clone();
|
||||
model.objectTileIds = (int[])objectTileIds.clone();
|
||||
model.objectXs = (short[])objectXs.clone();
|
||||
model.objectYs = (short[])objectYs.clone();
|
||||
model.objectInfo = (ObjectInfo[])objectInfo.clone();
|
||||
model.baseTileIds = baseTileIds.clone();
|
||||
model.objectTileIds = objectTileIds.clone();
|
||||
model.objectXs = objectXs.clone();
|
||||
model.objectYs = objectYs.clone();
|
||||
model.objectInfo = objectInfo.clone();
|
||||
return model;
|
||||
}
|
||||
|
||||
|
||||
@@ -131,7 +131,7 @@ public class SparseMisoSceneModel extends MisoSceneModel
|
||||
}
|
||||
|
||||
if (info.isInteresting()) {
|
||||
objectInfo = (ObjectInfo[])ArrayUtil.append(objectInfo, info);
|
||||
objectInfo = ArrayUtil.append(objectInfo, info);
|
||||
} else {
|
||||
objectTileIds = ArrayUtil.append(objectTileIds, info.tileId);
|
||||
objectXs = ArrayUtil.append(objectXs, (short)info.x);
|
||||
@@ -144,8 +144,7 @@ public class SparseMisoSceneModel extends MisoSceneModel
|
||||
// look for it in the interesting info array
|
||||
int oidx = ListUtil.indexOf(objectInfo, info);
|
||||
if (oidx != -1) {
|
||||
objectInfo = (ObjectInfo[])
|
||||
ArrayUtil.splice(objectInfo, oidx, 1);
|
||||
objectInfo = ArrayUtil.splice(objectInfo, oidx, 1);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -216,11 +215,11 @@ public class SparseMisoSceneModel extends MisoSceneModel
|
||||
public Object clone () {
|
||||
try {
|
||||
Section section = (Section)super.clone();
|
||||
section.baseTileIds = (int[])baseTileIds.clone();
|
||||
section.objectTileIds = (int[])objectTileIds.clone();
|
||||
section.objectXs = (short[])objectXs.clone();
|
||||
section.objectYs = (short[])objectYs.clone();
|
||||
section.objectInfo = (ObjectInfo[])objectInfo.clone();
|
||||
section.baseTileIds = baseTileIds.clone();
|
||||
section.objectTileIds = objectTileIds.clone();
|
||||
section.objectXs = objectXs.clone();
|
||||
section.objectYs = objectYs.clone();
|
||||
section.objectInfo = objectInfo.clone();
|
||||
return section;
|
||||
} catch (CloneNotSupportedException cnse) {
|
||||
throw new RuntimeException(cnse);
|
||||
|
||||
Reference in New Issue
Block a user