public IndexedSprite(Archive container, String name, int entry) {
		Stream image = new Stream(container.get(name + ".dat"));
		Stream index = new Stream(container.get("index.dat"));
		index.offset = image.getUnsignedShort();
		trimWidth = index.getUnsignedShort();
		trimHeight = index.getUnsignedShort();
		int pallete_size = index.getUnsignedByte();
		pallete = new int[pallete_size];
		for (int i = 0; i < pallete_size - 1; i++) {
			pallete[i + 1] = index.get24BitInt();
		}
		for (int i = 0; i < entry; i++) {
			index.offset += 2;
			image.offset += index.getUnsignedShort() * index.getUnsignedShort();
			index.offset++;
		}
		offsetX = index.getUnsignedByte();
		offsetY = index.getUnsignedByte();
		width = index.getUnsignedShort();
		height = index.getUnsignedShort();
		int imageType = index.getUnsignedByte();
		int pixelCount = width * height;
		pixels = new byte[pixelCount];
		if (imageType == 0) {
			for (int i = 0; i < pixelCount; i++) {
				pixels[i] = image.getByte();
			}
			return;
		}
		if (imageType == 1) {
			for (int offX = 0; offX < width; offX++) {
				for (int offY = 0; offY < height; offY++) {
					pixels[offX + offY * width] = image.getByte();
				}
			}
		}
	}