String baseCodeStr = rb.getString("GFX_BASE_CODE_TILES_MAP");
_cacheManager.setListCapacity(Integer.parseInt(rb.getString("GFX_BASE_CODE")));
try {
Sprite spTiles = new Sprite(rb.getString("GFX_BASE_CODE_TILES"), true, "image/x-png", _rbGetDim("GFX_BASE_CODE_TILES").ROI.getSize(), true);
spTiles.setTileModeEnabled(true);
ImageReader r = spTiles.getTileReader(true);
ImageReadParam irp = spTiles.getTileReaderParams(r);
int n = 0;
try {
for (String tile : baseCodeStr.split(" ")) {
irp.setSourceRegion(new Rectangle((int) ((float) r.getWidth(0) / (float) Integer.parseInt(rb.getString("GFX_BASE_CODE")) * (float) n), 0, (int) ((float) r.getWidth(0) / (float) Integer.parseInt(rb.getString("GFX_BASE_CODE"))), r.getHeight(0)));
BufferedImage tileImg = r.read(0, irp);
Sprite sp = new Sprite(tileImg, "image/x-png", baseCodeDim = new Dimension(tileImg.getWidth(), tileImg.getHeight()));
sp.setStoreMode(Sprite.MODE_TEXTURE);
_cacheSyncManager.put(tile, sp);
_cacheHashRegistry.put(tile, sp.hashCode());
n++;
}
} catch (IOException ex) {
ex.printStackTrace();
} finally {
r.dispose();
spTiles.clearResource();
Sprite grid = new Sprite();
grid.setSize(100, 100);
grid.clearImageGraphics();
grid.runValidate();