Don't foolishly blow away a perfectly good set of object tile ids and
actions unless we're actually loaded into the editor and turned into a real editable scene. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1315 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
//
|
//
|
||||||
// $Id: EditableMisoSceneImpl.java,v 1.17 2002/04/27 18:41:14 mdb Exp $
|
// $Id: EditableMisoSceneImpl.java,v 1.18 2002/04/28 03:14:15 mdb Exp $
|
||||||
|
|
||||||
package com.threerings.miso.scene.tools;
|
package com.threerings.miso.scene.tools;
|
||||||
|
|
||||||
@@ -187,22 +187,26 @@ public class EditableMisoSceneImpl
|
|||||||
// we need to flush the object layer to the model prior to
|
// we need to flush the object layer to the model prior to
|
||||||
// returning it
|
// returning it
|
||||||
int ocount = _objects.size();
|
int ocount = _objects.size();
|
||||||
int[] otids = new int[ocount*3];
|
|
||||||
String[] actions = new String[ocount];
|
|
||||||
|
|
||||||
for (int ii = 0; ii < ocount; ii++) {
|
// but only do it if we've actually got some objects
|
||||||
ObjectTile tile = (ObjectTile)_objects.get(ii);
|
if (ocount > 0) {
|
||||||
Point coords = (Point)_coords.get(tile);
|
int[] otids = new int[ocount*3];
|
||||||
otids[3*ii] = coords.x;
|
String[] actions = new String[ocount];
|
||||||
otids[3*ii+1] = coords.y;
|
|
||||||
otids[3*ii+2] = ((Integer)_objectTileIds.get(tile)).intValue();
|
for (int ii = 0; ii < ocount; ii++) {
|
||||||
actions[ii] = (String)_actions.get(tile);
|
ObjectTile tile = (ObjectTile)_objects.get(ii);
|
||||||
|
Point coords = (Point)_coords.get(tile);
|
||||||
|
otids[3*ii] = coords.x;
|
||||||
|
otids[3*ii+1] = coords.y;
|
||||||
|
otids[3*ii+2] = ((Integer)_objectTileIds.get(tile)).intValue();
|
||||||
|
actions[ii] = (String)_actions.get(tile);
|
||||||
|
}
|
||||||
|
|
||||||
|
// stuff the new arrays into the model
|
||||||
|
_model.objectTileIds = otids;
|
||||||
|
_model.objectActions = actions;
|
||||||
}
|
}
|
||||||
|
|
||||||
// stuff the new arrays into the model
|
|
||||||
_model.objectTileIds = otids;
|
|
||||||
_model.objectActions = actions;
|
|
||||||
|
|
||||||
// and we're ready to roll
|
// and we're ready to roll
|
||||||
return _model;
|
return _model;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user