Instead of caching the last 10 sound clips, cache up to 4 megs of clips
git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@509 ed5b42cb-e716-0410-a449-f6a68f950b19
This commit is contained in:
@@ -1010,7 +1010,16 @@ public class SoundManager
|
||||
protected float _clipVol = 1f;
|
||||
|
||||
/** The cache of recent audio clips . */
|
||||
protected LRUHashMap<SoundKey,byte[][]> _clipCache = new LRUHashMap<SoundKey,byte[][]>(10);
|
||||
protected LRUHashMap<SoundKey, byte[][]> _clipCache =
|
||||
new LRUHashMap<SoundKey, byte[][]>(4 * 1024 * 1024, new LRUHashMap.ItemSizer<byte[][]>() {
|
||||
public int computeSize (byte[][] value) {
|
||||
int total = 0;
|
||||
for (byte[] bs : value) {
|
||||
total += bs.length;
|
||||
}
|
||||
return total;
|
||||
}
|
||||
});
|
||||
|
||||
/** The set of locked audio clips; this is separate from the LRU so
|
||||
* that locking clips doesn't booch up an otherwise normal caching
|
||||
|
||||
Reference in New Issue
Block a user