Split the runtime-adjustment functionality of ImageManager out. In order to preserve backwards compatibility, the complete functionality including runtime-adjustment can be found in ImageManager which now extends BaseImageManager. The bulk of functionality is now in BaseImageManager and anyone who wants an image manager without the RuntimeAdjustment bits (it uses ClientPrefs and thus isn't friendly in server-land) should use that directly.

git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@433 ed5b42cb-e716-0410-a449-f6a68f950b19
This commit is contained in:
Mike Thomas
2008-03-06 18:31:04 +00:00
parent 9c3a7e2904
commit f00ff51a7b
17 changed files with 594 additions and 528 deletions
@@ -24,9 +24,9 @@ package com.threerings.media.tile;
import java.awt.Rectangle;
import java.awt.image.BufferedImage;
import com.threerings.media.image.BaseImageManager;
import com.threerings.media.image.Colorization;
import com.threerings.media.image.ImageDataProvider;
import com.threerings.media.image.ImageManager;
import com.threerings.media.image.Mirage;
/**
@@ -35,13 +35,13 @@ import com.threerings.media.image.Mirage;
*/
public class IMImageProvider implements ImageProvider
{
public IMImageProvider (ImageManager imgr, ImageDataProvider dprov)
public IMImageProvider (BaseImageManager imgr, ImageDataProvider dprov)
{
_imgr = imgr;
_dprov = dprov;
}
public IMImageProvider (ImageManager imgr, String rset)
public IMImageProvider (BaseImageManager imgr, String rset)
{
_imgr = imgr;
_rset = rset;
@@ -59,12 +59,12 @@ public class IMImageProvider implements ImageProvider
return _imgr.getMirage(getImageKey(path), bounds, zations);
}
protected final ImageManager.ImageKey getImageKey (String path)
protected final BaseImageManager.ImageKey getImageKey (String path)
{
return (_dprov == null) ? _imgr.getImageKey(_rset, path) : _imgr.getImageKey(_dprov, path);
}
protected ImageManager _imgr;
protected BaseImageManager _imgr;
protected ImageDataProvider _dprov;
protected String _rset;
}
@@ -28,7 +28,7 @@ import java.util.HashMap;
import com.samskivert.io.PersistenceException;
import com.threerings.media.Log;
import com.threerings.media.image.ImageManager;
import com.threerings.media.image.BaseImageManager;
/**
* The tile manager provides a simplified interface for retrieving and
@@ -55,7 +55,7 @@ public class TileManager
* @param imgr the image manager via which the tile manager will
* decode and cache images.
*/
public TileManager (ImageManager imgr)
public TileManager (BaseImageManager imgr)
{
_imgr = imgr;
_defaultProvider = new IMImageProvider(_imgr, (String)null);
@@ -242,7 +242,7 @@ public class TileManager
}
/** The entity through which we decode and cache images. */
protected ImageManager _imgr;
protected BaseImageManager _imgr;
/** A cache of tilesets that have been loaded by hand. */
protected HashMap _handcache = new HashMap();
@@ -30,7 +30,7 @@ import com.threerings.resource.ResourceBundle;
import com.threerings.resource.ResourceManager;
import com.threerings.media.Log;
import com.threerings.media.image.ImageManager;
import com.threerings.media.image.BaseImageManager;
import com.threerings.media.tile.IMImageProvider;
import com.threerings.media.tile.NoSuchTileSetException;
import com.threerings.media.tile.TileSet;
@@ -57,7 +57,7 @@ public class BundledTileSetRepository
* loading our tile data.
*/
public BundledTileSetRepository (final ResourceManager rmgr,
final ImageManager imgr,
final BaseImageManager imgr,
final String name)
{
_imgr = imgr;
@@ -222,7 +222,7 @@ public class BundledTileSetRepository
}
/** The image manager via which we load our images. */
protected ImageManager _imgr;
protected BaseImageManager _imgr;
/** A mapping from tileset id to tileset. */
protected HashIntMap _idmap;