Factor out the painting of the actual tile so we can override this to do wacky stuff in subclasses.
git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@1016 ed5b42cb-e716-0410-a449-f6a68f950b19
This commit is contained in:
@@ -275,6 +275,11 @@ public class BundledComponentRepository
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected TileSetFrameImage createTileSetFrameImage (TileSet aset, ActionSequence actseq)
|
||||||
|
{
|
||||||
|
return new TileSetFrameImage(aset, actseq);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Instances of these provide images to our component action tilesets and frames to our
|
* Instances of these provide images to our component action tilesets and frames to our
|
||||||
* components.
|
* components.
|
||||||
@@ -365,7 +370,7 @@ public class BundledComponentRepository
|
|||||||
|
|
||||||
aset.setImageProvider(this);
|
aset.setImageProvider(this);
|
||||||
_setcache.put(cpath, aset);
|
_setcache.put(cpath, aset);
|
||||||
return new TileSetFrameImage(aset, actseq);
|
return createTileSetFrameImage(aset, actseq);
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.warning("Error loading tset for action '" + imgpath + "' " + component + ".", e);
|
log.warning("Error loading tset for action '" + imgpath + "' " + component + ".", e);
|
||||||
@@ -473,7 +478,7 @@ public class BundledComponentRepository
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void paintFrame (Graphics2D g, int index, int x, int y) {
|
public void paintFrame (Graphics2D g, int index, int x, int y) {
|
||||||
_set.getTile(getTileIndex(orient, index)).paint(g, x + _dx, y + _dy);
|
paintTile(g, orient, index, x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hitTest (int index, int x, int y) {
|
public boolean hitTest (int index, int x, int y) {
|
||||||
@@ -486,6 +491,11 @@ public class BundledComponentRepository
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void paintTile(Graphics2D g, int orient, int index, int x, int y)
|
||||||
|
{
|
||||||
|
_set.getTile(getTileIndex(orient, index)).paint(g, x + _dx, y + _dy);
|
||||||
|
}
|
||||||
|
|
||||||
public void getTrimmedBounds (int orient, int index, Rectangle bounds) {
|
public void getTrimmedBounds (int orient, int index, Rectangle bounds) {
|
||||||
Tile tile = getTile(orient, index);
|
Tile tile = getTile(orient, index);
|
||||||
if (tile instanceof TrimmedTile) {
|
if (tile instanceof TrimmedTile) {
|
||||||
|
|||||||
Reference in New Issue
Block a user