The amazing revamp four hundred billion. Let's see:
- Reworked colorization repository such that we now have arbitrary named "colorization classes" which can be used by various and sundry entities to colorize themselves. - Added support for individual object colorizations as well as "spots" that go along with objects (will be used to automatically create portals into buildings and automatically position users properly when at a "station"). - Repackaged things in miso to more closely mimic what we do everywhere else (no more miso.scene, now we have miso.data and miso.client). - Fixed up miso scene XML representation so that objects can more easily be expanded to have yet more stuff if we think of more stuff that they might aught to have in the future. Structured the miso scene model so that "uninteresting" objects (those that simply sit somewhere and don't do anything) take up a lot less memory than "interesting" objects (those that have action strings, "spots", colorizations and the works). I may want to roll colorizations into the "uninteresting" realm, but that remains to be seen. - Made it possible for object tilesets to specify default render priorities for objects in that tileset. This will hopefully allow us to get by without any "custom" render priorities that are specified on scene objects, instead relying on the default priorities to resolve common conflicts. There are surely other cleanups in there, but I think that was the major thrust of it. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2228 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
//
|
||||
// $Id: DumpColorPository.java,v 1.1 2003/01/31 23:10:45 mdb Exp $
|
||||
|
||||
package com.threerings.media.image.tools;
|
||||
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.Iterator;
|
||||
|
||||
import com.threerings.media.image.ColorPository;
|
||||
|
||||
/**
|
||||
* Simple tool for dumping a serialized color pository.
|
||||
*/
|
||||
public class DumpColorPository
|
||||
{
|
||||
public static void main (String[] args)
|
||||
{
|
||||
if (args.length == 0) {
|
||||
System.err.println("Usage: DumpColorPository colorpos.dat");
|
||||
System.exit(-1);
|
||||
}
|
||||
|
||||
try {
|
||||
ColorPository pos = ColorPository.loadColorPository(
|
||||
new FileInputStream(args[0]));
|
||||
Iterator iter = pos.enumerateClasses();
|
||||
while (iter.hasNext()) {
|
||||
System.out.println(iter.next());
|
||||
}
|
||||
|
||||
} catch (IOException ioe) {
|
||||
ioe.printStackTrace(System.err);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
//
|
||||
// $Id: ColorPositoryParser.java,v 1.1 2003/01/31 23:10:45 mdb Exp $
|
||||
|
||||
package com.threerings.media.image.tools.xml;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.xml.sax.Attributes;
|
||||
import org.apache.commons.digester.Digester;
|
||||
import org.apache.commons.digester.Rule;
|
||||
import com.samskivert.xml.SetPropertyFieldsRule;
|
||||
|
||||
import com.threerings.tools.xml.CompiledConfigParser;
|
||||
|
||||
import com.threerings.media.image.ColorPository.ClassRecord;
|
||||
import com.threerings.media.image.ColorPository.ColorRecord;
|
||||
import com.threerings.media.image.ColorPository;
|
||||
|
||||
/**
|
||||
* Parses the XML color repository definition and creates a {@link
|
||||
* ColorPository} instance that reflects its contents.
|
||||
*/
|
||||
public class ColorPositoryParser extends CompiledConfigParser
|
||||
{
|
||||
// documentation inherited
|
||||
protected Serializable createConfigObject ()
|
||||
{
|
||||
return new ColorPository();
|
||||
}
|
||||
|
||||
// documentation inherited
|
||||
protected void addRules (Digester digest)
|
||||
{
|
||||
// create and configure class record instances
|
||||
String prefix = "colors/class";
|
||||
digest.addObjectCreate(prefix, ClassRecord.class.getName());
|
||||
digest.addRule(prefix, new SetPropertyFieldsRule(digest));
|
||||
digest.addSetNext(prefix, "addClass", ClassRecord.class.getName());
|
||||
|
||||
// create and configure color record instances
|
||||
prefix += "/color";
|
||||
digest.addRule(prefix, new Rule(digest) {
|
||||
public void begin (Attributes attributes) throws Exception {
|
||||
// we want to inherit settings from the color class when
|
||||
// creating the record, so we do some custom stuff
|
||||
ColorRecord record = new ColorRecord();
|
||||
ClassRecord clrec = (ClassRecord)digester.peek();
|
||||
record.starter = clrec.starter;
|
||||
digester.push(record);
|
||||
}
|
||||
|
||||
public void end () throws Exception {
|
||||
digester.pop();
|
||||
}
|
||||
});
|
||||
digest.addRule(prefix, new SetPropertyFieldsRule(digest));
|
||||
digest.addSetNext(prefix, "addColor", ColorRecord.class.getName());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user