short cMapLength = flipEndian(dis.readShort()); int width = flipEndian(dis.readShort()); int height = flipEndian(dis.readShort()); ColorMapEntry entry = new ColorMapEntry(); int offset = cMapDepth * i; entry.red = (byte) (int) (getBitsAsByte(cMapData, offset, bitsPerColor) * scalar); entry.green = (byte) (int) (getBitsAsByte(cMapData, offset + bitsPerColor, bitsPerColor) * scalar); entry.blue = (byte) (int) (getBitsAsByte(cMapData, offset + (2 * bitsPerColor), bitsPerColor) * scalar); if (alphaSize <= 0) { entry.alpha = (byte) 255; } else { entry.alpha = (byte) (int) (getBitsAsByte(cMapData, offset + (3 * bitsPerColor), alphaSize) * alphaScalar); data[1] = dis.readByte(); data[0] = dis.readByte(); rawData[rawDataIndex++] = (byte) (int) (getBitsAsByte(data, 1, 5) * scalar); rawData[rawDataIndex++] = (byte) (int) (getBitsAsByte(data, 6, 5) * scalar); rawData[rawDataIndex++] = (byte) (int) (getBitsAsByte(data, 11, 5) * scalar); if (dl == 4) { alpha = getBitsAsByte(data, 0, 1); if (alpha == 1) { alpha = (byte) 255; data[1] = dis.readByte(); data[0] = dis.readByte();
public Object load(AssetInfo info) throws IOException { if (!(info.getKey() instanceof TextureKey)) { throw new IllegalArgumentException("Texture assets must be loaded using a TextureKey"); } boolean flip = ((TextureKey) info.getKey()).isFlipY(); InputStream in = null; try { in = info.openStream(); Image img = load(in, flip); return img; } finally { if (in != null) { in.close(); } } }
short cMapLength = flipEndian(dis.readShort()); int width = flipEndian(dis.readShort()); int height = flipEndian(dis.readShort()); ColorMapEntry entry = new ColorMapEntry(); int offset = cMapDepth * i; entry.red = (byte)(int)(getBitsAsByte(cMapData, offset, bitsPerColor) * scalar); entry.green = (byte)(int)(getBitsAsByte(cMapData, offset+bitsPerColor, bitsPerColor) * scalar); entry.blue = (byte)(int)(getBitsAsByte(cMapData, offset+(2*bitsPerColor), bitsPerColor) * scalar); if (alphaSize <= 0) entry.alpha = (byte)255; else entry.alpha = (byte)(int)(getBitsAsByte(cMapData, offset+(3*bitsPerColor), alphaSize) * alphaScalar); data[1] = dis.readByte(); data[0] = dis.readByte(); rawData[rawDataIndex++] = (byte)(int)(getBitsAsByte(data, 1, 5) * scalar); rawData[rawDataIndex++] = (byte)(int)(getBitsAsByte(data, 6, 5) * scalar); rawData[rawDataIndex++] = (byte)(int)(getBitsAsByte(data, 11, 5) * scalar); if (dl == 4) { alpha = getBitsAsByte(data, 0, 1); if (alpha == 1) alpha = (byte)255; rawData[rawDataIndex++] = alpha; data[1] = dis.readByte(); data[0] = dis.readByte();
public Object load(AssetInfo info) throws IOException{ if (!(info.getKey() instanceof TextureKey)) throw new IllegalArgumentException("Texture assets must be loaded using a TextureKey"); boolean flip = ((TextureKey)info.getKey()).isFlipY(); InputStream in = null; try { in = info.openStream(); Image img = load(in, flip); return img; } finally { if (in != null){ in.close(); } } }
short cMapLength = flipEndian(dis.readShort()); int width = flipEndian(dis.readShort()); int height = flipEndian(dis.readShort()); ColorMapEntry entry = new ColorMapEntry(); int offset = cMapDepth * i; entry.red = (byte) (int) (getBitsAsByte(cMapData, offset, bitsPerColor) * scalar); entry.green = (byte) (int) (getBitsAsByte(cMapData, offset + bitsPerColor, bitsPerColor) * scalar); entry.blue = (byte) (int) (getBitsAsByte(cMapData, offset + (2 * bitsPerColor), bitsPerColor) * scalar); if (alphaSize <= 0) { entry.alpha = (byte) 255; } else { entry.alpha = (byte) (int) (getBitsAsByte(cMapData, offset + (3 * bitsPerColor), alphaSize) * alphaScalar); data[1] = dis.readByte(); data[0] = dis.readByte(); rawData[rawDataIndex++] = (byte) (int) (getBitsAsByte(data, 1, 5) * scalar); rawData[rawDataIndex++] = (byte) (int) (getBitsAsByte(data, 6, 5) * scalar); rawData[rawDataIndex++] = (byte) (int) (getBitsAsByte(data, 11, 5) * scalar); if (dl == 4) { alpha = getBitsAsByte(data, 0, 1); if (alpha == 1) { alpha = (byte) 255; data[1] = dis.readByte(); data[0] = dis.readByte();
public Object load(AssetInfo info) throws IOException { if (!(info.getKey() instanceof TextureKey)) { throw new IllegalArgumentException("Texture assets must be loaded using a TextureKey"); } boolean flip = ((TextureKey) info.getKey()).isFlipY(); InputStream in = null; try { in = info.openStream(); Image img = load(in, flip); return img; } finally { if (in != null) { in.close(); } } }