Screw the miso tileset repository; we'll just have the miso tile manager
load the fringe configuration from a standard place in the classpath. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1194 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -1,11 +1,19 @@
|
|||||||
//
|
//
|
||||||
// $Id: MisoTileManager.java,v 1.1 2002/04/06 01:46:56 mdb Exp $
|
// $Id: MisoTileManager.java,v 1.2 2002/04/06 01:56:39 mdb Exp $
|
||||||
|
|
||||||
package com.threerings.miso.tile;
|
package com.threerings.miso.tile;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InputStream;
|
||||||
|
|
||||||
|
import com.threerings.resource.ResourceManager;
|
||||||
|
import com.threerings.util.CompiledConfig;
|
||||||
|
|
||||||
import com.threerings.media.ImageManager;
|
import com.threerings.media.ImageManager;
|
||||||
import com.threerings.media.tile.TileManager;
|
import com.threerings.media.tile.TileManager;
|
||||||
|
|
||||||
|
import com.threerings.miso.Log;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Extends the basic tile manager and provides support for automatically
|
* Extends the basic tile manager and provides support for automatically
|
||||||
* generating fringes in between different types of base tiles in a scene.
|
* generating fringes in between different types of base tiles in a scene.
|
||||||
@@ -19,24 +27,24 @@ public class MisoTileManager extends TileManager
|
|||||||
* @param imgr the image manager via which the tile manager will
|
* @param imgr the image manager via which the tile manager will
|
||||||
* decode and cache images.
|
* decode and cache images.
|
||||||
*/
|
*/
|
||||||
public MisoTileManager (ImageManager imgr)
|
public MisoTileManager (ResourceManager rmgr, ImageManager imgr)
|
||||||
{
|
{
|
||||||
super(imgr);
|
super(imgr);
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
// look for a fringe configuration in the appropriate place
|
||||||
* Sets the tileset repository that will be used by the tile manager
|
try {
|
||||||
* when tiles are requested by tileset id. The miso tile manager
|
InputStream in = rmgr.getResource(FRINGE_CONFIG_PATH);
|
||||||
* requires a miso tileset repository which provides it with
|
FringeConfiguration config = (FringeConfiguration)
|
||||||
* information about fringe configuration in addition to the tilesets.
|
CompiledConfig.loadConfig(in);
|
||||||
*/
|
|
||||||
public void setMisoTileSetRepository (MisoTileSetRepository setrep)
|
|
||||||
{
|
|
||||||
setTileSetRepository(setrep);
|
|
||||||
|
|
||||||
// now that we have a miso tileset repository, we can create our
|
// if we've found it, create our auto fringer with it
|
||||||
// auto fringer
|
_fringer = new AutoFringer(config, this);
|
||||||
_fringer = new AutoFringer(setrep.getFringeConfiguration(), this);
|
|
||||||
|
} catch (IOException ioe) {
|
||||||
|
Log.warning("Unable to load fringe configuration " +
|
||||||
|
"[path=" + FRINGE_CONFIG_PATH +
|
||||||
|
", error=" + ioe + "].");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -52,4 +60,9 @@ public class MisoTileManager extends TileManager
|
|||||||
|
|
||||||
/** The entity that performs the automatic fringe layer generation. */
|
/** The entity that performs the automatic fringe layer generation. */
|
||||||
protected AutoFringer _fringer;
|
protected AutoFringer _fringer;
|
||||||
|
|
||||||
|
/** The path (in the classpath) to the serialized fringe
|
||||||
|
* configuration. */
|
||||||
|
protected static final String FRINGE_CONFIG_PATH =
|
||||||
|
"config/miso/tile/fringeconf.dat";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,18 +0,0 @@
|
|||||||
//
|
|
||||||
// $Id: MisoTileSetRepository.java,v 1.1 2002/04/06 01:46:56 mdb Exp $
|
|
||||||
|
|
||||||
package com.threerings.miso.tile;
|
|
||||||
|
|
||||||
import com.threerings.media.tile.TileSetRepository;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Extends the regular tile set repository and provides access to
|
|
||||||
* configuration information for the {@link AutoFringer}.
|
|
||||||
*/
|
|
||||||
public interface MisoTileSetRepository extends TileSetRepository
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Returns the configuration information for the {@link AutoFringer}.
|
|
||||||
*/
|
|
||||||
public FringeConfiguration getFringeConfiguration ();
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user