Added support for specifying colorization classes that should be used to
colorize objects in particular tileset. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2226 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
//
|
//
|
||||||
// $Id: ObjectTileSet.java,v 1.11 2003/01/29 21:31:37 mdb Exp $
|
// $Id: ObjectTileSet.java,v 1.12 2003/01/29 21:53:51 mdb Exp $
|
||||||
|
|
||||||
package com.threerings.media.tile;
|
package com.threerings.media.tile;
|
||||||
|
|
||||||
@@ -60,6 +60,24 @@ public class ObjectTileSet extends SwissArmyTileSet
|
|||||||
_priorities = priorities;
|
_priorities = priorities;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Provides a set of colorization classes that apply to objects in
|
||||||
|
* this tileset.
|
||||||
|
*/
|
||||||
|
public void setColorizations (String[] zations)
|
||||||
|
{
|
||||||
|
_zations = zations;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the colorization classes that should be used to recolor
|
||||||
|
* objects in this tileset.
|
||||||
|
*/
|
||||||
|
public String[] getColorizations ()
|
||||||
|
{
|
||||||
|
return _zations;
|
||||||
|
}
|
||||||
|
|
||||||
// documentation inherited
|
// documentation inherited
|
||||||
protected void toString (StringBuffer buf)
|
protected void toString (StringBuffer buf)
|
||||||
{
|
{
|
||||||
@@ -69,6 +87,7 @@ public class ObjectTileSet extends SwissArmyTileSet
|
|||||||
buf.append(", xorigins=").append(StringUtil.toString(_xorigins));
|
buf.append(", xorigins=").append(StringUtil.toString(_xorigins));
|
||||||
buf.append(", yorigins=").append(StringUtil.toString(_yorigins));
|
buf.append(", yorigins=").append(StringUtil.toString(_yorigins));
|
||||||
buf.append(", prios=").append(StringUtil.toString(_priorities));
|
buf.append(", prios=").append(StringUtil.toString(_priorities));
|
||||||
|
buf.append(", zations=").append(StringUtil.toString(_zations));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -105,6 +124,9 @@ public class ObjectTileSet extends SwissArmyTileSet
|
|||||||
/** The default render priorities of our objects. */
|
/** The default render priorities of our objects. */
|
||||||
protected int[] _priorities;
|
protected int[] _priorities;
|
||||||
|
|
||||||
|
/** Colorization classes that apply to our objects. */
|
||||||
|
protected String[] _zations;
|
||||||
|
|
||||||
/** Increase this value when object's serialized state is impacted by
|
/** Increase this value when object's serialized state is impacted by
|
||||||
* a class change (modification of fields, inheritance). */
|
* a class change (modification of fields, inheritance). */
|
||||||
private static final long serialVersionUID = 1;
|
private static final long serialVersionUID = 1;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
//
|
//
|
||||||
// $Id: ObjectTileSetRuleSet.java,v 1.5 2003/01/29 21:31:37 mdb Exp $
|
// $Id: ObjectTileSetRuleSet.java,v 1.6 2003/01/29 21:53:51 mdb Exp $
|
||||||
|
|
||||||
package com.threerings.media.tile.tools.xml;
|
package com.threerings.media.tile.tools.xml;
|
||||||
|
|
||||||
@@ -97,6 +97,16 @@ public class ObjectTileSetRuleSet extends SwissArmyTileSetRuleSet
|
|||||||
((ObjectTileSet)target).setPriorities(prios);
|
((ObjectTileSet)target).setPriorities(prios);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
digester.addRule(
|
||||||
|
_prefix + TILESET_PATH + "/zations",
|
||||||
|
new CallMethodSpecialRule(digester) {
|
||||||
|
public void parseAndSet (String bodyText, Object target)
|
||||||
|
{
|
||||||
|
String[] zations = StringUtil.parseStringArray(bodyText);
|
||||||
|
((ObjectTileSet)target).setColorizations(zations);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
// documentation inherited
|
||||||
|
|||||||
Reference in New Issue
Block a user