Major media subsystem revamp:

- All images are loaded through the image manager
- Architected to allow the use of prepared or unprepared images (and
  volatile images when the day comes that they support alpha)
- Tunable caches for images and tiles
- Resource manager caches unpacked resources on the filesystem
- Various and sundry other cleanups


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2116 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2003-01-13 22:49:47 +00:00
parent 8743be2131
commit 100aa3ace3
46 changed files with 1602 additions and 888 deletions
@@ -1,12 +1,11 @@
//
// $Id: SingleFrameImageImpl.java,v 1.4 2003/01/08 04:09:03 mdb Exp $
// $Id: SingleFrameImageImpl.java,v 1.5 2003/01/13 22:49:47 mdb Exp $
package com.threerings.media.util;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.Graphics2D;
import com.threerings.media.image.ImageUtil;
import com.threerings.media.image.Mirage;
/**
* The single frame image class is a basic implementation of the {@link
@@ -18,9 +17,9 @@ public class SingleFrameImageImpl implements MultiFrameImage
/**
* Constructs a single frame image object.
*/
public SingleFrameImageImpl (Image img)
public SingleFrameImageImpl (Mirage mirage)
{
_img = img;
_mirage = mirage;
}
// documentation inherited
@@ -32,27 +31,27 @@ public class SingleFrameImageImpl implements MultiFrameImage
// documentation inherited from interface
public int getWidth (int index)
{
return _img.getWidth(null);
return _mirage.getWidth();
}
// documentation inherited from interface
public int getHeight (int index)
{
return _img.getHeight(null);
return _mirage.getHeight();
}
// documentation inherited from interface
public void paintFrame (Graphics g, int index, int x, int y)
public void paintFrame (Graphics2D g, int index, int x, int y)
{
g.drawImage(_img, x, y, null);
_mirage.paint(g, x, y);
}
// documentation inherited from interface
public boolean hitTest (int index, int x, int y)
{
return ImageUtil.hitTest(_img, x, y);
return _mirage.hitTest(x, y);
}
/** The frame image. */
protected Image _img;
protected Mirage _mirage;
}