Only use the set cache value for the current set of managers, don't store it in the RuntimeAdjust

git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@535 ed5b42cb-e716-0410-a449-f6a68f950b19
This commit is contained in:
Charlie Groves
2008-06-10 21:37:57 +00:00
parent 06e3217d6b
commit d67c0bd7b7
2 changed files with 18 additions and 8 deletions
@@ -41,7 +41,7 @@ public class ClientImageManager extends ImageManager
*/
public static void setCacheSize (int cacheKilobytes)
{
_cacheSize.setValue(cacheKilobytes);
_runCacheSize = cacheKilobytes;
}
public ClientImageManager (ResourceManager rmgr, OptimalImageCreator icreator)
@@ -57,7 +57,7 @@ public class ClientImageManager extends ImageManager
@Override
public int getCacheSize ()
{
return _cacheSize.getValue();
return _runCacheSize;
}
@Override
@@ -95,6 +95,12 @@ public class ClientImageManager extends ImageManager
protected static RuntimeAdjust.IntAdjust _cacheSize = new RuntimeAdjust.IntAdjust(
"Size (in kb of memory used) of the image manager LRU cache [requires restart]",
"narya.media.image.cache_size", MediaPrefs.config, DEFAULT_CACHE_SIZE);
/**
* Cache size to be used in this run. Adjusted by setCacheSize without affecting
* the stored value.
*/
protected static int _runCacheSize = _cacheSize.getValue();
/** Controls whether or not we prepare images or use raw versions. */
protected static RuntimeAdjust.BooleanAdjust _prepareImages = new RuntimeAdjust.BooleanAdjust(