TileSet set = (TileSet)m.getTilesets().get(0); MapLayer bg = m.getLayer(0), fg0 = m.getLayer(1), fg1 = m.getLayer(2), fg2 = m.getLayer(3); for(int i=0;i<m.getHeight();i++) { for(int j=0;j<m.getWidth();j++) { int block = (int)((readShort(in)&0x00FF)/BLKSTR_WIDTH);  BlkStr blk = (BlkStr)blocks.get(block);  bg.setTileAt(j,i, set.getTile((int)blk.bg)); fg0.setTileAt(j,i, set.getTile((int)blk.fg0)); fg1.setTileAt(j,i, set.getTile((int)blk.fg1)); fg2.setTileAt(j,i, set.getTile((int)blk.fg2));
TileSet set = (TileSet)m.getTilesets().get(0); MapLayer bg = m.getLayer(0), fg0 = m.getLayer(1), fg1 = m.getLayer(2), fg2 = m.getLayer(3); for(int i=0;i<m.getHeight();i++) { for(int j=0;j<m.getWidth();j++) { int block = (int)((readShort(in)&0x00FF)/BLKSTR_WIDTH);  BlkStr blk = (BlkStr)blocks.get(block);  bg.setTileAt(j,i, set.getTile((int)blk.bg)); fg0.setTileAt(j,i, set.getTile((int)blk.fg0)); fg1.setTileAt(j,i, set.getTile((int)blk.fg1)); fg2.setTileAt(j,i, set.getTile((int)blk.fg2)); }
    private void readBODYChunk(Map m, InputStream in) throws IOException {	TileSet set = (TileSet)m.getTilesets().get(0);	MapLayer bg = m.getLayer(0),		fg0 = m.getLayer(1),		fg1 = m.getLayer(2),		fg2 = m.getLayer(3);	for(int i=0;i<m.getHeight();i++) {		for(int j=0;j<m.getWidth();j++) {			int block = (int)((readShort(in)&0x00FF)/BLKSTR_WIDTH);			//System.out.print(""+block);			BlkStr blk = (BlkStr)blocks.get(block);			//System.out.println("bg: "+blk.bg);			bg.setTileAt(j,i, set.getTile((int)blk.bg));				fg0.setTileAt(j,i, set.getTile((int)blk.fg0));				fg1.setTileAt(j,i, set.getTile((int)blk.fg1));				fg2.setTileAt(j,i, set.getTile((int)blk.fg2));			}		//System.out.println();	}    }