Estimate memory usage in bytes rather than pixel area, assuming an int per

pixel for now.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2034 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Walter Korman
2002-12-07 02:04:32 +00:00
parent ea545bcb66
commit acaf39b070
6 changed files with 85 additions and 25 deletions
@@ -1,5 +1,5 @@
//
// $Id: CompositedActionFrames.java,v 1.8 2002/09/17 19:11:13 mdb Exp $
// $Id: CompositedActionFrames.java,v 1.9 2002/12/07 02:04:31 shaper Exp $
package com.threerings.cast;
@@ -114,6 +114,21 @@ public class CompositedActionFrames
throw new RuntimeException("What you talkin' about Willis?");
}
// documentation inherited from interface
public long getEstimatedMemoryUsage ()
{
long size = 0;
for (int orient = 0; orient < _orientCount; orient++) {
for (int ii = 0; ii < _images[orient].length; ii++) {
Image image = _images[orient][ii];
if (image != null) {
size += ImageUtil.getEstimatedMemoryUsage(image);
}
}
}
return size;
}
// documentation inherited
protected Image getFrame (int orient, int index)
{