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:
Michael Bayne
2002-09-23 23:07:11 +00:00
parent 92c8748c7c
commit 68af441fbf
7 changed files with 41 additions and 67 deletions
@@ -1,5 +1,5 @@
//
// $Id: DirtyItemList.java,v 1.13 2002/09/18 02:32:57 mdb Exp $
// $Id: DirtyItemList.java,v 1.14 2002/09/23 23:07:11 mdb Exp $
package com.threerings.miso.scene;
@@ -525,16 +525,16 @@ public class DirtyItemList
}
// if the two objects are scene objects and they overlap, we
// compare them solely based on the order in which they were
// added to the scene; this allows the scene creator to avoid
// all sorts of sticky business wherein the render order
// between two overlapping objects cannot be determined
// compare them solely based on their human assigned render
// priority scene; this allows us to avoid all sorts of sticky
// business wherein the render order between two overlapping
// objects cannot be determined without a z-buffer
if ((da.obj instanceof SceneObject) &&
(db.obj instanceof SceneObject)) {
SceneObject soa = (SceneObject)da.obj;
SceneObject sob = (SceneObject)db.obj;
if (IsoUtil.objectFootprintsOverlap(soa, sob)) {
return (soa.index - sob.index);
return (soa.priority - sob.priority);
}
}
@@ -1,5 +1,5 @@
//
// $Id: DisplayMisoSceneImpl.java,v 1.61 2002/09/23 21:54:50 mdb Exp $
// $Id: DisplayMisoSceneImpl.java,v 1.62 2002/09/23 23:07:11 mdb Exp $
package com.threerings.miso.scene;
@@ -138,17 +138,14 @@ public class DisplayMisoSceneImpl
for (int ii = 0; ii < ocount; ii+= 3) {
int col = _model.objectTileIds[ii];
int row = _model.objectTileIds[ii+1];
String action = _model.objectActions[ii/3];
int fqTid = _model.objectTileIds[ii+2];
int tsid = (fqTid >> 16) & 0xFFFF;
int tid = (fqTid & 0xFFFF);
int tsid = (fqTid >> 16) & 0xFFFF, tid = (fqTid & 0xFFFF);
try {
expandObject(col, row, tsid, tid, fqTid, action);
expandObject(col, row, tsid, tid, fqTid, ii/3);
} catch (TileException te) {
Log.warning("Scene contains non-existent object tile " +
"[tsid=" + tsid + ", tid=" + tid +
", col=" + col + ", row=" + row +
", action=" + action + "].");
", col=" + col + ", row=" + row + "].");
}
}
}
@@ -162,14 +159,20 @@ public class DisplayMisoSceneImpl
* tables).
*/
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
{
// create and initialize an object info record for this object
SceneObject scobj = createSceneObject(
col, row, (ObjectTile)_tmgr.getTile(tsid, tid));
if (!StringUtil.blank(action)) {
scobj.action = action;
// assign the object's remaining attributes
if (!StringUtil.blank(_model.objectActions[objidx])) {
scobj.action = _model.objectActions[objidx];
}
// if we have object priorities, use 'em
if (_model.objectPrios != null) {
scobj.priority = _model.objectPrios[objidx];
}
// generate a "shadow" for this object tile by toggling the
@@ -177,9 +180,6 @@ public class DisplayMisoSceneImpl
// sprites from walking on those tiles)
setObjectTileFootprint(scobj.tile, col, row, true);
// assign the object its index
scobj.index = _objects.size();
// add the info record to the list
_objects.add(scobj);
@@ -209,8 +209,6 @@ public class DisplayMisoSceneImpl
SceneObject scobj = (SceneObject)_objects.get(ii);
if (region.contains(scobj.x, scobj.y)) {
set.insert(scobj);
} else {
System.err.println("Skipping " + scobj + ", not in " + region + ".");
}
}
}
@@ -1,5 +1,5 @@
//
// $Id: DisplayObjectInfo.java,v 1.2 2002/09/23 21:54:50 mdb Exp $
// $Id: DisplayObjectInfo.java,v 1.3 2002/09/23 23:07:11 mdb Exp $
package com.threerings.miso.scene;
@@ -20,8 +20,8 @@ public class SceneObject
/** The x and y tile coordinates of the object. */
public int x = -1, y = -1;
/** The object's index in the scene object list. */
public int index = -1;
/** The object's render priority. */
public byte priority = 0;
/** The action associated with this object or null if it has no
* action. */