Objects now have explicit render priorities rather than relying on the
order in which they were added to the scene (that information is no longer available as objects are reordered arbitrarily once loaded). Also removed old-school scene conversion. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1743 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// $Id: EditableMisoSceneImpl.java,v 1.23 2002/09/23 21:54:50 mdb Exp $
|
||||
// $Id: EditableMisoSceneImpl.java,v 1.24 2002/09/23 23:07:11 mdb Exp $
|
||||
|
||||
package com.threerings.miso.scene.tools;
|
||||
|
||||
@@ -118,7 +118,6 @@ public class EditableMisoSceneImpl
|
||||
EditableSceneObject scobj = (EditableSceneObject)
|
||||
createSceneObject(x, y, tile);
|
||||
scobj.fqTileId = fqTileId;
|
||||
scobj.index = _objects.size();
|
||||
_objects.add(scobj);
|
||||
|
||||
// toggle the "covered" flag on in all base tiles below this
|
||||
@@ -160,6 +159,7 @@ public class EditableMisoSceneImpl
|
||||
if (ocount > 0) {
|
||||
int[] otids = new int[ocount*3];
|
||||
String[] actions = new String[ocount];
|
||||
byte[] prios = new byte[ocount];
|
||||
|
||||
for (int ii = 0; ii < ocount; ii++) {
|
||||
EditableSceneObject scobj = (EditableSceneObject)
|
||||
@@ -168,11 +168,13 @@ public class EditableMisoSceneImpl
|
||||
otids[3*ii+1] = scobj.y;
|
||||
otids[3*ii+2] = scobj.fqTileId;
|
||||
actions[ii] = scobj.action;
|
||||
prios[ii] = scobj.priority;
|
||||
}
|
||||
|
||||
// stuff the new arrays into the model
|
||||
_model.objectTileIds = otids;
|
||||
_model.objectActions = actions;
|
||||
_model.objectPrios = prios;
|
||||
}
|
||||
|
||||
// and we're ready to roll
|
||||
@@ -187,12 +189,12 @@ public class EditableMisoSceneImpl
|
||||
|
||||
// documentation inherited
|
||||
protected SceneObject expandObject (
|
||||
int col, int row, int tsid, int tid, int fqTid, String action)
|
||||
int col, int row, int tsid, int tid, int fqTid, int objidx)
|
||||
throws NoSuchTileException, NoSuchTileSetException
|
||||
{
|
||||
// do the actual object creation
|
||||
EditableSceneObject scobj = (EditableSceneObject)
|
||||
super.expandObject(col, row, tsid, tid, fqTid, action);
|
||||
super.expandObject(col, row, tsid, tid, fqTid, objidx);
|
||||
|
||||
// we need this to track object layer mods
|
||||
scobj.fqTileId = fqTid;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// $Id: MisoSceneRuleSet.java,v 1.9 2002/05/17 19:06:23 ray Exp $
|
||||
// $Id: MisoSceneRuleSet.java,v 1.10 2002/09/23 23:07:11 mdb Exp $
|
||||
|
||||
package com.threerings.miso.scene.tools.xml;
|
||||
|
||||
@@ -62,6 +62,8 @@ public class MisoSceneRuleSet extends RuleSetBase
|
||||
new SetFieldRule(digester, "objectTileIds"));
|
||||
digester.addRule(_prefix + "/actions",
|
||||
new SetFieldRule(digester, "objectActions"));
|
||||
digester.addRule(_prefix + "/priorities",
|
||||
new SetFieldRule(digester, "objectPrios"));
|
||||
|
||||
// we have to unfuck the objectActions field in the event that
|
||||
// there's one object in the objects element which has a blank
|
||||
@@ -76,14 +78,6 @@ public class MisoSceneRuleSet extends RuleSetBase
|
||||
model.objectActions.length == 0) {
|
||||
model.objectActions = new String[1];
|
||||
}
|
||||
|
||||
// check to see if we've read in an old-style model.
|
||||
// TODO: remove this someday after all our scenes are
|
||||
// converted.
|
||||
if (model.vwidth == 0) {
|
||||
model.convertOldSchool(10, 12);
|
||||
Log.info("Converted old-school MisoSceneModel.");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// $Id: MisoSceneWriter.java,v 1.7 2002/05/17 19:06:23 ray Exp $
|
||||
// $Id: MisoSceneWriter.java,v 1.8 2002/09/23 23:07:11 mdb Exp $
|
||||
|
||||
package com.threerings.miso.scene.tools.xml;
|
||||
|
||||
@@ -46,5 +46,7 @@ public class MisoSceneWriter
|
||||
StringUtil.toString(model.objectTileIds, "", ""));
|
||||
writer.dataElement("actions",
|
||||
StringUtil.joinEscaped(model.objectActions));
|
||||
writer.dataElement("priorities",
|
||||
StringUtil.toString(model.objectPrios, "", ""));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user