Files
narya/src/java/com/threerings/media/util/SingleFrameImageImpl.java
T
Michael Bayne 100aa3ace3 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
2003-01-13 22:49:47 +00:00

58 lines
1.3 KiB
Java

//
// $Id: SingleFrameImageImpl.java,v 1.5 2003/01/13 22:49:47 mdb Exp $
package com.threerings.media.util;
import java.awt.Graphics2D;
import com.threerings.media.image.Mirage;
/**
* The single frame image class is a basic implementation of the {@link
* MultiFrameImage} interface intended to facilitate the creation of MFIs
* whose display frames consist of only a single image.
*/
public class SingleFrameImageImpl implements MultiFrameImage
{
/**
* Constructs a single frame image object.
*/
public SingleFrameImageImpl (Mirage mirage)
{
_mirage = mirage;
}
// documentation inherited
public int getFrameCount ()
{
return 1;
}
// documentation inherited from interface
public int getWidth (int index)
{
return _mirage.getWidth();
}
// documentation inherited from interface
public int getHeight (int index)
{
return _mirage.getHeight();
}
// documentation inherited from interface
public void paintFrame (Graphics2D g, int index, int x, int y)
{
_mirage.paint(g, x, y);
}
// documentation inherited from interface
public boolean hitTest (int index, int x, int y)
{
return _mirage.hitTest(x, y);
}
/** The frame image. */
protected Mirage _mirage;
}