Rather than getting the tile count from the raw image each time (as TileSet.getTileCount does for certain tilesets), keep a copy of the number of tiles we're counting.
git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@74 ed5b42cb-e716-0410-a449-f6a68f950b19
This commit is contained in:
@@ -39,6 +39,7 @@ public class TileMultiFrameImage implements MultiFrameImage
|
||||
public TileMultiFrameImage (TileSet source)
|
||||
{
|
||||
_source = source;
|
||||
_tileCount = _source.getTileCount();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -53,7 +54,7 @@ public class TileMultiFrameImage implements MultiFrameImage
|
||||
// documentation inherited from interface
|
||||
public int getFrameCount ()
|
||||
{
|
||||
return _source.getTileCount();
|
||||
return _tileCount;
|
||||
}
|
||||
|
||||
// documentation inherited from interface
|
||||
@@ -81,4 +82,7 @@ public class TileMultiFrameImage implements MultiFrameImage
|
||||
}
|
||||
|
||||
protected TileSet _source;
|
||||
|
||||
/** The number of tiles in the source image. */
|
||||
protected int _tileCount;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user