public void vflip() { for (PipAnimateFramePiece piece : pieces) { if (piece instanceof PipAni4AniFramePiece) { piece.dy = -piece.dy; } else { piece.transition = PipImage.vflip(piece.transition); piece.dy = -piece.dy - piece.getHeight(); if (piece.rotate != 0) { int angle = ((piece.rotate % 360) + 360) % 360; piece.rotate = (piece.rotate - angle) + (360 - angle); } } } }
public void load(DataInputStream dis, boolean isctn) throws IOException { if (isctn) { name = "N/A"; } else { name = dis.readUTF(); } int fcount = dis.readByte() & 0xFF; for (int i = 0; i < fcount; i++) { PipAnimateFramePiece piece = new PipAnimateFramePiece(this); piece.load(dis); if (!isctn) { if (piece.getImageID() >= parent.getFileCount()) { // 检查依赖的图片是否存在 continue; } PipImage sourceImg = parent.getSourceImage(piece.getImageID()); if (piece.getFrame() >= sourceImg.getImgCount() * sourceImg.getImagePalettes().size()) { // 检查指定的帧是否存在 continue; } } pieces.add(piece); } }
public int hashCode() { return img.hashCode() + frame + transition; }