From b4d6464075ada09c639fd36db66a40faed4777cf Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Sat, 6 Apr 2002 01:46:56 +0000 Subject: [PATCH] Miso tile manager extends regular tile manager and provides access to an auto fringer; miso tileset repository does same and provides access to fringe configuration. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1190 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- .../threerings/miso/tile/MisoTileManager.java | 55 +++++++++++++++++++ .../miso/tile/MisoTileSetRepository.java | 18 ++++++ 2 files changed, 73 insertions(+) create mode 100644 src/java/com/threerings/miso/tile/MisoTileManager.java create mode 100644 src/java/com/threerings/miso/tile/MisoTileSetRepository.java diff --git a/src/java/com/threerings/miso/tile/MisoTileManager.java b/src/java/com/threerings/miso/tile/MisoTileManager.java new file mode 100644 index 000000000..a77ad1ec5 --- /dev/null +++ b/src/java/com/threerings/miso/tile/MisoTileManager.java @@ -0,0 +1,55 @@ +// +// $Id: MisoTileManager.java,v 1.1 2002/04/06 01:46:56 mdb Exp $ + +package com.threerings.miso.tile; + +import com.threerings.media.ImageManager; +import com.threerings.media.tile.TileManager; + +/** + * Extends the basic tile manager and provides support for automatically + * generating fringes in between different types of base tiles in a scene. + */ +public class MisoTileManager extends TileManager +{ + /** + * Creates a tile manager and provides it with a reference to the + * image manager from which it will load tileset images. + * + * @param imgr the image manager via which the tile manager will + * decode and cache images. + */ + public MisoTileManager (ImageManager imgr) + { + super(imgr); + } + + /** + * Sets the tileset repository that will be used by the tile manager + * when tiles are requested by tileset id. The miso tile manager + * requires a miso tileset repository which provides it with + * information about fringe configuration in addition to the tilesets. + */ + public void setMisoTileSetRepository (MisoTileSetRepository setrep) + { + setTileSetRepository(setrep); + + // now that we have a miso tileset repository, we can create our + // auto fringer + _fringer = new AutoFringer(setrep.getFringeConfiguration(), this); + } + + /** + * Returns the auto fringer that has been configured for use by this + * tile manager. This will only be valid if this tile manager has been + * provided with a miso tileset repository via {@link + * #setTileSetRepository}. + */ + public AutoFringer getAutoFringer () + { + return _fringer; + } + + /** The entity that performs the automatic fringe layer generation. */ + protected AutoFringer _fringer; +} diff --git a/src/java/com/threerings/miso/tile/MisoTileSetRepository.java b/src/java/com/threerings/miso/tile/MisoTileSetRepository.java new file mode 100644 index 000000000..be0a7a62c --- /dev/null +++ b/src/java/com/threerings/miso/tile/MisoTileSetRepository.java @@ -0,0 +1,18 @@ +// +// $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 (); +}