Factor in the percentage of the databuffer a BufferedMirage is using to
estimate its memory if its BufferedImage is a subimage of another BufferedImage. Include the amount of memory used by colorizations in ImageManager's cache usage calculations. Crank ImageManager's cache size up to 32 megs since a) it's actually seeing the memory used by colorizations and b) the new seamonsters are pretty sizable. git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@291 ed5b42cb-e716-0410-a449-f6a68f950b19
This commit is contained in:
@@ -355,10 +355,13 @@ public class BundledComponentRepository
|
||||
{
|
||||
// we don't need our images prepared for screen rendering
|
||||
BufferedImage src = _imgr.getImage(getImageKey(path), zations);
|
||||
float percentageOfDataBuffer = 1;
|
||||
if (bounds != null) {
|
||||
percentageOfDataBuffer =
|
||||
(bounds.height * bounds.width) / (float)(src.getHeight() * src.getWidth());
|
||||
src = src.getSubimage(bounds.x, bounds.y, bounds.width, bounds.height);
|
||||
}
|
||||
return new BufferedMirage(src);
|
||||
return new BufferedMirage(src, percentageOfDataBuffer);
|
||||
}
|
||||
|
||||
/** The resource bundle from which we obtain image data. */
|
||||
|
||||
Reference in New Issue
Block a user