The image manager now falls back to loading images via the Toolkit if it

can't load the ImageIO classes. This unfortunately means that we're back
to passing a Component instance to the ImageManager at construct time.
Whee!


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@749 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2001-12-07 01:33:29 +00:00
parent 14b9708e9e
commit 940154d7e3
17 changed files with 241 additions and 56 deletions
@@ -1,12 +1,11 @@
//
// $Id: SwissArmyTileSet.java,v 1.4 2001/11/29 21:57:31 mdb Exp $
// $Id: SwissArmyTileSet.java,v 1.5 2001/12/07 01:33:29 mdb Exp $
package com.threerings.media.tile;
import java.awt.Image;
import java.awt.Point;
import java.awt.Dimension;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.io.ObjectInputStream;
@@ -14,7 +13,7 @@ import java.io.ObjectInputStream;
import com.samskivert.util.StringUtil;
import com.threerings.media.Log;
import com.threerings.media.ImageManager;
import com.threerings.media.ImageUtil;
/**
* The swiss army tileset supports a diverse variety of tiles in the
@@ -131,7 +130,7 @@ public class SwissArmyTileSet extends TileSet
// documentation inherited
protected Image extractTileImage (int tileIndex)
{
BufferedImage tsimg = getTilesetImage();
Image tsimg = getTilesetImage();
if (tsimg == null) {
return null;
}
@@ -160,7 +159,8 @@ public class SwissArmyTileSet extends TileSet
// ", tx=" + tx + ", ty=" + ty + "].");
// crop the tile-sized image chunk from the full image
return tsimg.getSubimage(tx, ty, _widths[ridx], _heights[ridx]);
return ImageUtil.getSubimage(
tsimg, tx, ty, _widths[ridx], _heights[ridx]);
}
private void readObject (ObjectInputStream in)