Cleaner way to colorize multiframe images generated from tile sets.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3559 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// $Id: TileMultiFrameImage.java,v 1.4 2004/08/27 02:12:41 mdb Exp $
|
||||
// $Id$
|
||||
//
|
||||
// Narya library - tools for developing networked games
|
||||
// Copyright (C) 2002-2004 Three Rings Design, Inc., All Rights Reserved
|
||||
@@ -23,6 +23,7 @@ package com.threerings.media.tile;
|
||||
|
||||
import java.awt.Graphics2D;
|
||||
|
||||
import com.threerings.media.image.Colorization;
|
||||
import com.threerings.media.util.MultiFrameImage;
|
||||
|
||||
/**
|
||||
@@ -40,6 +41,15 @@ public class TileMultiFrameImage implements MultiFrameImage
|
||||
_source = source;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a recoolored tile MFI which will obtain its image frames
|
||||
* from the specified source tileset.
|
||||
*/
|
||||
public TileMultiFrameImage (TileSet source, Colorization[] zations)
|
||||
{
|
||||
this(source.clone(zations));
|
||||
}
|
||||
|
||||
// documentation inherited from interface
|
||||
public int getFrameCount ()
|
||||
{
|
||||
|
||||
@@ -228,25 +228,6 @@ public abstract class TileSet
|
||||
return tile;
|
||||
}
|
||||
|
||||
/** Returns a multiframe image of all the tiles in this tile set. */
|
||||
public MultiFrameImage getTileMultiFrameImage ()
|
||||
{
|
||||
return getTileMultiFrameImage(null);
|
||||
}
|
||||
|
||||
/** Returns a multiframe image of all the tiles in this tile set. */
|
||||
public MultiFrameImage getTileMultiFrameImage (Colorization[] zations)
|
||||
{
|
||||
// Load each tile's image
|
||||
Mirage[] images = new Mirage[getTileCount()];
|
||||
for (int i = 0; i < images.length; i++) {
|
||||
images[i] = getTileMirage(i, zations);
|
||||
}
|
||||
|
||||
// Construct a multiframe image from these images
|
||||
return new MultiFrameImageImpl(images);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a prepared version of the image that would be used by the
|
||||
* tile at the specified index. Because tilesets are often used simply
|
||||
|
||||
Reference in New Issue
Block a user