int tileGroupIdx = index / 32;
int tileIdx = index % 32;
// fetch the land tile
LandTile tile = this.tileGroups[tileGroupIdx].getTiles()[tileIdx];
TexIdx textureIndex = this.texIdxs[(int) tile.getTextureId()];
// fetch the texture object
Texture texture = null;
try {
texture = this.textureCache.get(textureIndex.getStart());
} catch (CacheItemNotFoundException e) {
// not found in cache, so load
texture = textureReader.read(textureIndex);
// put texture into cache
this.textureCache.put(textureIndex.getStart(), texture);
}
// and the image of the texture
Image textureImg = null;
if (texture != null) {