final Array<Region> regions = new Array();
public TextureAtlasData (FileHandle packFile, FileHandle imagesDir, boolean flip) {
BufferedReader reader = new BufferedReader(new InputStreamReader(packFile.read()), 64);
try {
Page pageImage = null;
while (true) {
String line = reader.readLine();
if (line == null) break;
if (line.trim().length() == 0)
pageImage = null;
else if (pageImage == null) {
FileHandle file = imagesDir.child(line);
float width = 0, height = 0;
if (readTuple(reader) == 2) { // size is only optional for an atlas packed with an old TexturePacker.
width = Integer.parseInt(tuple[0]);
height = Integer.parseInt(tuple[1]);
readTuple(reader);
}
Format format = Format.valueOf(tuple[0]);
readTuple(reader);
TextureFilter min = TextureFilter.valueOf(tuple[0]);
TextureFilter max = TextureFilter.valueOf(tuple[1]);
String direction = readValue(reader);
TextureWrap repeatX = ClampToEdge;
TextureWrap repeatY = ClampToEdge;
if (direction.equals("x"))
repeatX = Repeat;
else if (direction.equals("y"))
repeatY = Repeat;
else if (direction.equals("xy")) {
repeatX = Repeat;
repeatY = Repeat;
}
pageImage = new Page(file, width, height, min.isMipMap(), format, min, max, repeatX, repeatY);
pages.add(pageImage);
} else {
boolean rotate = Boolean.valueOf(readValue(reader));
readTuple(reader);