예제 #1
0
 /** Used to load and cache tilesets loaded via {@link #loadTileSet}. */
 protected UniformTileSet loadCachedTileSet(String bundle, String imgPath, int width, int height) {
   String key = bundle + "::" + imgPath;
   SoftReference<UniformTileSet> ref = _handcache.get(key);
   UniformTileSet uts = (ref == null) ? null : ref.get();
   if (uts == null) {
     uts = new UniformTileSet();
     uts.setImageProvider(_defaultProvider);
     uts.setImagePath(imgPath);
     uts.setWidth(width);
     uts.setHeight(height);
     _handcache.put(key, new SoftReference<UniformTileSet>(uts));
   }
   return uts;
 }
예제 #2
0
 public UniformTileSet loadTileSet(
     ImageProvider improv, String improvKey, String imgPath, int width, int height) {
   UniformTileSet uts = loadCachedTileSet(improvKey, imgPath, width, height);
   uts.setImageProvider(improv);
   return uts;
 }