A healthy splash of google-collections

git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@822 ed5b42cb-e716-0410-a449-f6a68f950b19
This commit is contained in:
Dave Hoover
2009-05-23 01:31:14 +00:00
parent a20117d922
commit d2b9e2ebb9
52 changed files with 246 additions and 191 deletions
@@ -380,16 +380,13 @@ public class ImageCache
protected ResourceManager _rsrcmgr;
/** A cache of {@link Image} instances. */
protected HashMap<String,WeakReference<Image>> _imgcache =
new HashMap<String,WeakReference<Image>>();
protected HashMap<String,WeakReference<Image>> _imgcache = Maps.newHashMap();
/** A cache of {@link BImage} instances. */
protected HashMap<String,WeakReference<BImage>> _buicache =
new HashMap<String,WeakReference<BImage>>();
protected HashMap<String,WeakReference<BImage>> _buicache = Maps.newHashMap();
/** A cache of {@link BufferedImage} instances. */
protected HashMap<String,WeakReference<BufferedImage>> _bufcache =
new HashMap<String,WeakReference<BufferedImage>>();
protected HashMap<String,WeakReference<BufferedImage>> _bufcache = Maps.newHashMap();
/** Used to create buffered images in a format compatible with OpenGL. */
protected static ComponentColorModel GL_ALPHA_MODEL = new ComponentColorModel(
@@ -218,7 +218,7 @@ public class ShaderCache
public String frag;
/** The set of preprocessor definitions. */
public HashSet<String> defs = new HashSet<String>();
public HashSet<String> defs = Sets.newHashSet();
public ShaderKey (String vert, String frag, String[] defs)
{
@@ -253,8 +253,8 @@ public class ShaderCache
protected ResourceManager _rsrcmgr;
/** Maps shader names to source strings. */
protected HashMap<String, String> _sources = new HashMap<String, String>();
protected HashMap<String, String> _sources = Maps.newHashMap();
/** Maps shader keys to linked program ids. */
protected HashMap<ShaderKey, Integer> _programIds = new HashMap<ShaderKey, Integer>();
protected HashMap<ShaderKey, Integer> _programIds = Maps.newHashMap();
}
@@ -74,11 +74,11 @@ public abstract class ShaderConfig
// reconfigure the shader state, generating the derived definitions only if the
// required configuration isn't in the cache
String vert = getVertexShader(), frag = getFragmentShader();
ArrayList<String> defs = new ArrayList<String>();
ArrayList<String> defs = Lists.newArrayList();
getDefinitions(defs);
String[] darray = defs.toArray(new String[defs.size()]), ddarray = null;
if (!_scache.isLoaded(vert, frag, darray)) {
ArrayList<String> ddefs = new ArrayList<String>();
ArrayList<String> ddefs = Lists.newArrayList();
getDerivedDefinitions(ddefs);
ddarray = ddefs.toArray(new String[ddefs.size()]);
}