Added an example colorization configuration, wired it into the Miso scene

viewer, so now we have colorized pirates walking around the scene instead of
weird red/purple ones.


git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@1060 ed5b42cb-e716-0410-a449-f6a68f950b19
This commit is contained in:
Michael Bayne
2010-11-08 22:04:22 +00:00
parent d2cc2c9331
commit 26d4b72520
5 changed files with 160 additions and 18 deletions
@@ -34,6 +34,7 @@ import com.threerings.resource.ResourceManager;
import com.threerings.media.FrameManager;
import com.threerings.media.image.ClientImageManager;
import com.threerings.media.image.ColorPository;
import com.threerings.media.tile.bundle.BundledTileSetRepository;
import com.threerings.miso.data.SimpleMisoSceneModel;
@@ -96,9 +97,10 @@ public class ViewerApp
BundledComponentRepository crepo =
new BundledComponentRepository(rmgr, imgr, "components");
CharacterManager charmgr = new CharacterManager(imgr, crepo);
ColorPository cpos = ColorPository.loadColorPository(rmgr);
// create our scene view panel
_panel = new ViewerSceneViewPanel(ctx, charmgr, crepo);
_panel = new ViewerSceneViewPanel(ctx, charmgr, crepo, cpos);
_frame.setPanel(_panel);
// load up the scene specified by the user
@@ -27,6 +27,7 @@ import java.awt.event.MouseEvent;
import com.samskivert.util.RandomUtil;
import com.threerings.media.image.ColorPository;
import com.threerings.media.sprite.PathObserver;
import com.threerings.media.sprite.Sprite;
import com.threerings.media.sprite.SpriteManager;
@@ -54,15 +55,14 @@ public class ViewerSceneViewPanel extends MisoScenePanel
/**
* Construct the panel and initialize it with a context.
*/
public ViewerSceneViewPanel (MisoContext ctx,
CharacterManager charmgr,
ComponentRepository crepo)
public ViewerSceneViewPanel (
MisoContext ctx, CharacterManager charmgr, ComponentRepository crepo, ColorPository cpos)
{
super(ctx, MisoConfig.getSceneMetrics());
// create the character descriptors
_descUser = CastUtil.getRandomDescriptor("female", crepo);
_descDecoy = CastUtil.getRandomDescriptor("male", crepo);
_descUser = CastUtil.getRandomDescriptor("female", crepo, cpos);
_descDecoy = CastUtil.getRandomDescriptor("male", crepo, cpos);
// create the manipulable sprite
_sprite = createSprite(_spritemgr, charmgr, _descUser);