private void read() throws IOException {
LittleEndianInputStream in = new LittleEndianInputStream(
GameFiles.open(name + "_0.z2raw"));
try {
int ver = in.readInt();
if (ver < 0 || ver > 1)
throw new FileFormatException("Unrecognized version");
width = in.readInt();
height = in.readInt();
bits = in.readInt();
BufferedImage im = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
if (ver == 0)
readRaw(im, in);
else
readRLE(im, in);
texture = new TexturePaint(im, new Rectangle2D.Double(0, 0, 0x8000, 0x8000));
originalTexture = texture;
}
catch (ArrayIndexOutOfBoundsException e) {
throw new FileFormatException("Invalid array index", e);
}
finally {
in.close();
}
}
Bitmap.java 文件源码
java
阅读 19
收藏 0
点赞 0
评论 0
项目:BattleNationsAnimation
作者:
评论列表
文章目录