private void readFrames(LittleEndianInputStream in, int ver)
			throws IOException {
		int numPoints = in.readUnsignedShort();
		int alpha = 0;
		if (ver == 8) {
			switch (in.readShort()) {
			case 0: break;
			case 1: alpha = 1; break;
			case 0x101: alpha = 4; break;
			default: throw new FileFormatException("Unknown point size");
			}
		}

		Vertex[] coords = new Vertex[numPoints];
		for (int i = 0; i < numPoints; i++) {
			Vertex point = new Vertex();
			point.x1 = in.readShort();
			point.y1 = in.readShort();
			if (ver == 4) in.readShort();
			point.x2 = in.readShort();
			point.y2 = in.readShort();
			for (int j = 0; j < alpha; j++)
				point.alpha = Math.min(point.alpha, in.readFloat());
			coords[i] = point;
		}

		xMin = in.readShort();
		xMax = in.readShort();
		yMin = in.readShort();
		yMax = in.readShort();

		int numFrames = in.readUnsignedShort();
		frames = new Frame[numFrames];
		for (int i = 0; i < numFrames; i++) {
			frames[i] = new Frame();
			frames[i].read(in, ver, coords);
		}
	}