Use utility method ArrayUtil.copy.

git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@73 ed5b42cb-e716-0410-a449-f6a68f950b19
This commit is contained in:
Andrzej Kapolka
2006-11-08 03:07:19 +00:00
parent 95cc9ea2ef
commit 46616164f4
2 changed files with 8 additions and 11 deletions
+3 -4
View File
@@ -55,6 +55,7 @@ import com.jme.util.export.Savable;
import com.jme.util.export.binary.BinaryExporter;
import com.jme.util.export.binary.BinaryImporter;
import com.samskivert.util.ArrayUtil;
import com.samskivert.util.ObserverList;
import com.samskivert.util.PropertiesUtil;
import com.samskivert.util.RandomUtil;
@@ -186,10 +187,8 @@ public class Model extends ModelNode
InputCapsule capsule = im.getCapsule(this);
frameRate = capsule.readInt("frameRate", 0);
repeatType = capsule.readInt("repeatType", Controller.RT_CLAMP);
Savable[] ttargs = capsule.readSavableArray(
"transformTargets", null);
transformTargets = new Spatial[ttargs.length];
System.arraycopy(ttargs, 0, transformTargets, 0, ttargs.length);
transformTargets = ArrayUtil.copy(capsule.readSavableArray(
"transformTargets", null), new Spatial[0]);
FloatBuffer pxforms = capsule.readFloatBuffer("transforms", null);
transforms = new Transform[pxforms.capacity() /
Transform.PACKED_SIZE / transformTargets.length][];
@@ -50,6 +50,7 @@ import com.jme.util.export.OutputCapsule;
import com.jme.util.export.Savable;
import com.jme.util.geom.BufferUtils;
import com.samskivert.util.ArrayUtil;
import com.samskivert.util.HashIntMap;
import com.threerings.jme.Log;
@@ -104,9 +105,8 @@ public class SkinMesh extends ModelMesh
{
InputCapsule capsule = im.getCapsule(this);
vertexCount = capsule.readInt("vertexCount", 0);
Savable[] sbones = capsule.readSavableArray("bones", null);
bones = new Bone[sbones.length];
System.arraycopy(sbones, 0, bones, 0, sbones.length);
bones = ArrayUtil.copy(capsule.readSavableArray("bones", null),
new Bone[0]);
weights = capsule.readFloatArray("weights", null);
}
@@ -271,10 +271,8 @@ public class SkinMesh extends ModelMesh
{
super.read(im);
InputCapsule capsule = im.getCapsule(this);
Savable[] swgroups = capsule.readSavableArray("weightGroups", null);
WeightGroup[] wgroups = new WeightGroup[swgroups.length];
System.arraycopy(swgroups, 0, wgroups, 0, swgroups.length);
setWeightGroups(wgroups);
setWeightGroups(ArrayUtil.copy(capsule.readSavableArray(
"weightGroups", null), new WeightGroup[0]));
}
@Override // documentation inherited