diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWFInputStream.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWFInputStream.java index 0445030e7..19d61af64 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWFInputStream.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWFInputStream.java @@ -1182,10 +1182,10 @@ public class SWFInputStream implements AutoCloseable { try { switch (tag.getId()) { case 0: - ret = new EndTag(swf, data); + ret = new EndTag(sis, data); break; case 1: - ret = new ShowFrameTag(swf, data); + ret = new ShowFrameTag(sis, data); break; case 2: ret = new DefineShapeTag(sis, data, lazy); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/CSMTextSettingsTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/CSMTextSettingsTag.java index daaf1f4c6..a84035953 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/CSMTextSettingsTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/CSMTextSettingsTag.java @@ -101,6 +101,11 @@ public class CSMTextSettingsTag extends Tag { */ public CSMTextSettingsTag(SWFInputStream sis, ByteArrayRange data) throws IOException { super(sis.getSwf(), ID, "CSMTextSettings", data); + readData(sis, data, 0, false, false, false); + } + + @Override + public final void readData(SWFInputStream sis, ByteArrayRange data, int level, boolean parallel, boolean skipUnusualTags, boolean lazy) throws IOException { textID = sis.readUI16("textID"); useFlashType = (int) sis.readUB(2, "useFlashType"); gridFit = (int) sis.readUB(3, "gridFit"); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DebugIDTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DebugIDTag.java index e3959c07b..ee079bad2 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DebugIDTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DebugIDTag.java @@ -1,18 +1,19 @@ /* * Copyright (C) 2010-2015 JPEXS, All rights reserved. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3.0 of the License, or (at your option) any later version. - * + * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.tags; import com.jpexs.decompiler.flash.SWF; @@ -74,6 +75,11 @@ public class DebugIDTag extends Tag { */ public DebugIDTag(SWFInputStream sis, ByteArrayRange data) throws IOException { super(sis.getSwf(), ID, "DebugID", data); + readData(sis, data, 0, false, false, false); + } + + @Override + public final void readData(SWFInputStream sis, ByteArrayRange data, int level, boolean parallel, boolean skipUnusualTags, boolean lazy) throws IOException { debugId = sis.readBytesEx(16, "debugId"); } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineBinaryDataTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineBinaryDataTag.java index acfb09a69..9ecd56fec 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineBinaryDataTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineBinaryDataTag.java @@ -83,6 +83,11 @@ public class DefineBinaryDataTag extends CharacterTag { public DefineBinaryDataTag(SWFInputStream sis, ByteArrayRange data) throws IOException { super(sis.getSwf(), ID, "DefineBinaryData", data); + readData(sis, data, 0, false, false, false); + } + + @Override + public final void readData(SWFInputStream sis, ByteArrayRange data, int level, boolean parallel, boolean skipUnusualTags, boolean lazy) throws IOException { tag = sis.readUI16("tag"); reserved = sis.readUI32("reserved"); binaryData = sis.readByteRangeEx(sis.available(), "binaryData"); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineBitsJPEG2Tag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineBitsJPEG2Tag.java index 5be591e94..e0d882a82 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineBitsJPEG2Tag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineBitsJPEG2Tag.java @@ -1,18 +1,19 @@ /* * Copyright (C) 2010-2015 JPEXS, All rights reserved. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3.0 of the License, or (at your option) any later version. - * + * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.tags; import com.jpexs.decompiler.flash.SWF; @@ -88,6 +89,11 @@ public class DefineBitsJPEG2Tag extends ImageTag implements AloneTag { public DefineBitsJPEG2Tag(SWFInputStream sis, ByteArrayRange data) throws IOException { super(sis.getSwf(), ID, "DefineBitsJPEG2", data); + readData(sis, data, 0, false, false, false); + } + + @Override + public final void readData(SWFInputStream sis, ByteArrayRange data, int level, boolean parallel, boolean skipUnusualTags, boolean lazy) throws IOException { characterID = sis.readUI16("characterID"); imageData = sis.readByteRangeEx(sis.available(), "imageData"); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineBitsJPEG3Tag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineBitsJPEG3Tag.java index c6e87ff98..059f08f8f 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineBitsJPEG3Tag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineBitsJPEG3Tag.java @@ -130,6 +130,11 @@ public class DefineBitsJPEG3Tag extends ImageTag implements AloneTag { public DefineBitsJPEG3Tag(SWFInputStream sis, ByteArrayRange data) throws IOException { super(sis.getSwf(), ID, "DefineBitsJPEG3", data); + readData(sis, data, 0, false, false, false); + } + + @Override + public final void readData(SWFInputStream sis, ByteArrayRange data, int level, boolean parallel, boolean skipUnusualTags, boolean lazy) throws IOException { characterID = sis.readUI16("characterID"); long alphaDataOffset = sis.readUI32("alphaDataOffset"); imageData = sis.readByteRangeEx(alphaDataOffset, "imageData"); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineBitsJPEG4Tag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineBitsJPEG4Tag.java index dfc2c33af..f7115a098 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineBitsJPEG4Tag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineBitsJPEG4Tag.java @@ -160,6 +160,11 @@ public class DefineBitsJPEG4Tag extends ImageTag implements AloneTag { */ public DefineBitsJPEG4Tag(SWFInputStream sis, ByteArrayRange data) throws IOException { super(sis.getSwf(), ID, "DefineBitsJPEG4", data); + readData(sis, data, 0, false, false, false); + } + + @Override + public final void readData(SWFInputStream sis, ByteArrayRange data, int level, boolean parallel, boolean skipUnusualTags, boolean lazy) throws IOException { characterID = sis.readUI16("characterID"); long alphaDataOffset = sis.readUI32("alphaDataOffset"); deblockParam = sis.readUI16("deblockParam"); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineBitsLossless2Tag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineBitsLossless2Tag.java index a80b59b37..3a621649e 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineBitsLossless2Tag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineBitsLossless2Tag.java @@ -160,6 +160,11 @@ public class DefineBitsLossless2Tag extends ImageTag implements AloneTag { public DefineBitsLossless2Tag(SWFInputStream sis, ByteArrayRange data) throws IOException { super(sis.getSwf(), ID, "DefineBitsLossless2", data); + readData(sis, data, 0, false, false, false); + } + + @Override + public final void readData(SWFInputStream sis, ByteArrayRange data, int level, boolean parallel, boolean skipUnusualTags, boolean lazy) throws IOException { characterID = sis.readUI16("characterID"); bitmapFormat = sis.readUI8("bitmapFormat"); bitmapWidth = sis.readUI16("bitmapWidth"); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineBitsLosslessTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineBitsLosslessTag.java index fd2bf68da..73274029d 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineBitsLosslessTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineBitsLosslessTag.java @@ -232,6 +232,11 @@ public class DefineBitsLosslessTag extends ImageTag implements AloneTag { public DefineBitsLosslessTag(SWFInputStream sis, ByteArrayRange data) throws IOException { super(sis.getSwf(), ID, "DefineBitsLossless", data); + readData(sis, data, 0, false, false, false); + } + + @Override + public final void readData(SWFInputStream sis, ByteArrayRange data, int level, boolean parallel, boolean skipUnusualTags, boolean lazy) throws IOException { characterID = sis.readUI16("characterID"); bitmapFormat = sis.readUI8("bitmapFormat"); bitmapWidth = sis.readUI16("bitmapWidth"); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineBitsTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineBitsTag.java index 8f2baefb1..b788897c8 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineBitsTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineBitsTag.java @@ -1,18 +1,19 @@ /* * Copyright (C) 2010-2015 JPEXS, All rights reserved. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3.0 of the License, or (at your option) any later version. - * + * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.tags; import com.jpexs.decompiler.flash.SWF; @@ -64,6 +65,11 @@ public class DefineBitsTag extends ImageTag implements TagChangedListener { public DefineBitsTag(SWFInputStream sis, ByteArrayRange data) throws IOException { super(sis.getSwf(), ID, "DefineBits", data); + readData(sis, data, 0, false, false, false); + } + + @Override + public final void readData(SWFInputStream sis, ByteArrayRange data, int level, boolean parallel, boolean skipUnusualTags, boolean lazy) throws IOException { characterID = sis.readUI16("characterID"); jpegData = sis.readByteRangeEx(sis.available(), "jpegData"); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineButton2Tag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineButton2Tag.java index 0394deeb0..143be0e91 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineButton2Tag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineButton2Tag.java @@ -118,6 +118,11 @@ public class DefineButton2Tag extends ButtonTag implements ASMSourceContainer { */ public DefineButton2Tag(SWFInputStream sis, ByteArrayRange data) throws IOException { super(sis.getSwf(), ID, "DefineButton2", data); + readData(sis, data, 0, false, false, false); + } + + @Override + public final void readData(SWFInputStream sis, ByteArrayRange data, int level, boolean parallel, boolean skipUnusualTags, boolean lazy) throws IOException { buttonId = sis.readUI16("buttonId"); reserved = (int) sis.readUB(7, "reserved"); trackAsMenu = sis.readUB(1, "trackAsMenu") == 1; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineButtonCxformTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineButtonCxformTag.java index e75daeb10..8e91d3ca8 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineButtonCxformTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineButtonCxformTag.java @@ -79,6 +79,11 @@ public class DefineButtonCxformTag extends Tag { */ public DefineButtonCxformTag(SWFInputStream sis, ByteArrayRange data) throws IOException { super(sis.getSwf(), ID, "DefineButtonCxform", data); + readData(sis, data, 0, false, false, false); + } + + @Override + public final void readData(SWFInputStream sis, ByteArrayRange data, int level, boolean parallel, boolean skipUnusualTags, boolean lazy) throws IOException { buttonId = sis.readUI16("buttonId"); buttonColorTransform = sis.readCXFORM("buttonColorTransform"); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineButtonSoundTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineButtonSoundTag.java index 9986f1ad5..59a028905 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineButtonSoundTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineButtonSoundTag.java @@ -117,6 +117,11 @@ public class DefineButtonSoundTag extends CharacterIdTag { */ public DefineButtonSoundTag(SWFInputStream sis, ByteArrayRange data) throws IOException { super(sis.getSwf(), ID, "DefineButtonSound", data); + readData(sis, data, 0, false, false, false); + } + + @Override + public final void readData(SWFInputStream sis, ByteArrayRange data, int level, boolean parallel, boolean skipUnusualTags, boolean lazy) throws IOException { buttonId = sis.readUI16("buttonId"); buttonSoundChar0 = sis.readUI16("buttonSoundChar0"); if (buttonSoundChar0 != 0) { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineButtonTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineButtonTag.java index 43da85db9..2562cb546 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineButtonTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineButtonTag.java @@ -120,6 +120,11 @@ public class DefineButtonTag extends ButtonTag implements ASMSource { */ public DefineButtonTag(SWFInputStream sis, ByteArrayRange data) throws IOException { super(sis.getSwf(), ID, "DefineButton", data); + readData(sis, data, 0, false, false, false); + } + + @Override + public final void readData(SWFInputStream sis, ByteArrayRange data, int level, boolean parallel, boolean skipUnusualTags, boolean lazy) throws IOException { buttonId = sis.readUI16("buttonId"); characters = sis.readBUTTONRECORDList(false, "characters"); actionBytes = sis.readByteRangeEx(sis.available(), "actionBytes"); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineEditTextTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineEditTextTag.java index bf27450f1..45efdad4d 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineEditTextTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineEditTextTag.java @@ -762,6 +762,11 @@ public class DefineEditTextTag extends TextTag { */ public DefineEditTextTag(SWFInputStream sis, ByteArrayRange data) throws IOException { super(sis.getSwf(), ID, "DefineEditText", data); + readData(sis, data, 0, false, false, false); + } + + @Override + public final void readData(SWFInputStream sis, ByteArrayRange data, int level, boolean parallel, boolean skipUnusualTags, boolean lazy) throws IOException { characterID = sis.readUI16("characterID"); bounds = sis.readRECT("bounds"); hasText = sis.readUB(1, "hasText") == 1; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineFont2Tag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineFont2Tag.java index 4a253659c..e53274ffb 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineFont2Tag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineFont2Tag.java @@ -227,6 +227,11 @@ public class DefineFont2Tag extends FontTag { */ public DefineFont2Tag(SWFInputStream sis, ByteArrayRange data) throws IOException { super(sis.getSwf(), ID, "DefineFont2", data); + readData(sis, data, 0, false, false, false); + } + + @Override + public final void readData(SWFInputStream sis, ByteArrayRange data, int level, boolean parallel, boolean skipUnusualTags, boolean lazy) throws IOException { fontId = sis.readUI16("fontId"); fontFlagsHasLayout = sis.readUB(1, "fontFlagsHasLayout") == 1; fontFlagsShiftJIS = sis.readUB(1, "fontFlagsShiftJIS") == 1; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineFont3Tag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineFont3Tag.java index e837dad0c..3872ee91f 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineFont3Tag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineFont3Tag.java @@ -140,6 +140,11 @@ public class DefineFont3Tag extends FontTag { public DefineFont3Tag(SWFInputStream sis, ByteArrayRange data) throws IOException { super(sis.getSwf(), ID, "DefineFont3", data); + readData(sis, data, 0, false, false, false); + } + + @Override + public final void readData(SWFInputStream sis, ByteArrayRange data, int level, boolean parallel, boolean skipUnusualTags, boolean lazy) throws IOException { fontId = sis.readUI16("fontId"); fontFlagsHasLayout = sis.readUB(1, "fontFlagsHasLayout") == 1; fontFlagsShiftJIS = sis.readUB(1, "fontFlagsShiftJIS") == 1; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineFont4Tag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineFont4Tag.java index 048e48b7e..384995991 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineFont4Tag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineFont4Tag.java @@ -68,6 +68,11 @@ public class DefineFont4Tag extends CharacterTag { public DefineFont4Tag(SWFInputStream sis, ByteArrayRange data) throws IOException { super(sis.getSwf(), ID, "DefineFont4", data); + readData(sis, data, 0, false, false, false); + } + + @Override + public final void readData(SWFInputStream sis, ByteArrayRange data, int level, boolean parallel, boolean skipUnusualTags, boolean lazy) throws IOException { fontID = sis.readUI16("fontID"); reserved = (int) sis.readUB(5, "reserved"); fontFlagsHasFontData = sis.readUB(1, "fontFlagsHasFontData") == 1; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineFontAlignZonesTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineFontAlignZonesTag.java index 797aa0324..431989b99 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineFontAlignZonesTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineFontAlignZonesTag.java @@ -60,6 +60,11 @@ public class DefineFontAlignZonesTag extends Tag { public DefineFontAlignZonesTag(SWFInputStream sis, ByteArrayRange data) throws IOException { super(sis.getSwf(), ID, "DefineFontAlignZones", data); + readData(sis, data, 0, false, false, false); + } + + @Override + public final void readData(SWFInputStream sis, ByteArrayRange data, int level, boolean parallel, boolean skipUnusualTags, boolean lazy) throws IOException { fontID = sis.readUI16("fontID"); CSMTableHint = (int) sis.readUB(2, "CSMTableHint"); reserved = (int) sis.readUB(6, "reserved"); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineFontInfo2Tag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineFontInfo2Tag.java index d9b580358..03c2c4fa8 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineFontInfo2Tag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineFontInfo2Tag.java @@ -119,6 +119,11 @@ public class DefineFontInfo2Tag extends Tag { */ public DefineFontInfo2Tag(SWFInputStream sis, ByteArrayRange data) throws IOException { super(sis.getSwf(), ID, "DefineFontInfo2", data); + readData(sis, data, 0, false, false, false); + } + + @Override + public final void readData(SWFInputStream sis, ByteArrayRange data, int level, boolean parallel, boolean skipUnusualTags, boolean lazy) throws IOException { fontID = sis.readUI16("fontID"); int fontNameLen = sis.readUI8("fontNameLen"); if (swf.version >= 6) { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineFontInfoTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineFontInfoTag.java index 0fa87942c..b6036f8e3 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineFontInfoTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineFontInfoTag.java @@ -118,6 +118,11 @@ public class DefineFontInfoTag extends Tag { */ public DefineFontInfoTag(SWFInputStream sis, ByteArrayRange data) throws IOException { super(sis.getSwf(), ID, "DefineFontInfo", data); + readData(sis, data, 0, false, false, false); + } + + @Override + public final void readData(SWFInputStream sis, ByteArrayRange data, int level, boolean parallel, boolean skipUnusualTags, boolean lazy) throws IOException { fontId = sis.readUI16("fontId"); int fontNameLen = sis.readUI8("fontNameLen"); if (swf.version >= 6) { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineFontNameTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineFontNameTag.java index 3f119bce2..9eae64a46 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineFontNameTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineFontNameTag.java @@ -50,6 +50,11 @@ public class DefineFontNameTag extends Tag { public DefineFontNameTag(SWFInputStream sis, ByteArrayRange data) throws IOException { super(sis.getSwf(), ID, "DefineFontName", data); + readData(sis, data, 0, false, false, false); + } + + @Override + public final void readData(SWFInputStream sis, ByteArrayRange data, int level, boolean parallel, boolean skipUnusualTags, boolean lazy) throws IOException { fontId = sis.readUI16("fontId"); fontName = sis.readString("fontName"); fontCopyright = sis.readString("fontCopyright"); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineFontTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineFontTag.java index b8b1c9fca..6bf607695 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineFontTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineFontTag.java @@ -160,6 +160,11 @@ public class DefineFontTag extends FontTag { */ public DefineFontTag(SWFInputStream sis, ByteArrayRange data) throws IOException { super(sis.getSwf(), ID, "DefineFont", data); + readData(sis, data, 0, false, false, false); + } + + @Override + public final void readData(SWFInputStream sis, ByteArrayRange data, int level, boolean parallel, boolean skipUnusualTags, boolean lazy) throws IOException { fontId = sis.readUI16("fontId"); glyphShapeTable = new ArrayList<>(); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineMorphShape2Tag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineMorphShape2Tag.java index 95bbc6265..6c8e40ffa 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineMorphShape2Tag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineMorphShape2Tag.java @@ -191,6 +191,11 @@ public class DefineMorphShape2Tag extends MorphShapeTag { */ public DefineMorphShape2Tag(SWFInputStream sis, ByteArrayRange data) throws IOException { super(sis.getSwf(), ID, "DefineMorphShape2", data); + readData(sis, data, 0, false, false, false); + } + + @Override + public final void readData(SWFInputStream sis, ByteArrayRange data, int level, boolean parallel, boolean skipUnusualTags, boolean lazy) throws IOException { characterId = sis.readUI16("characterId"); startBounds = sis.readRECT("startBounds"); endBounds = sis.readRECT("endBounds"); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineMorphShapeTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineMorphShapeTag.java index cabbdd63b..e64c8815d 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineMorphShapeTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineMorphShapeTag.java @@ -162,6 +162,11 @@ public class DefineMorphShapeTag extends MorphShapeTag { */ public DefineMorphShapeTag(SWFInputStream sis, ByteArrayRange data) throws IOException { super(sis.getSwf(), ID, "DefineMorphShape", data); + readData(sis, data, 0, false, false, false); + } + + @Override + public final void readData(SWFInputStream sis, ByteArrayRange data, int level, boolean parallel, boolean skipUnusualTags, boolean lazy) throws IOException { characterId = sis.readUI16("characterId"); startBounds = sis.readRECT("startBounds"); endBounds = sis.readRECT("endBounds"); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineScalingGridTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineScalingGridTag.java index 16a583ff0..206ba9bdf 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineScalingGridTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineScalingGridTag.java @@ -51,6 +51,11 @@ public class DefineScalingGridTag extends Tag { public DefineScalingGridTag(SWFInputStream sis, ByteArrayRange data) throws IOException { super(sis.getSwf(), ID, "DefineScalingGrid", data); + readData(sis, data, 0, false, false, false); + } + + @Override + public final void readData(SWFInputStream sis, ByteArrayRange data, int level, boolean parallel, boolean skipUnusualTags, boolean lazy) throws IOException { characterId = sis.readUI16("characterId"); splitter = sis.readRECT("splitter"); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineSceneAndFrameLabelDataTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineSceneAndFrameLabelDataTag.java index 0ddc756f3..6415e4c10 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineSceneAndFrameLabelDataTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineSceneAndFrameLabelDataTag.java @@ -101,6 +101,11 @@ public class DefineSceneAndFrameLabelDataTag extends Tag { */ public DefineSceneAndFrameLabelDataTag(SWFInputStream sis, ByteArrayRange data) throws IOException { super(sis.getSwf(), ID, "DefineSceneAndFrameLabelData", data); + readData(sis, data, 0, false, false, false); + } + + @Override + public final void readData(SWFInputStream sis, ByteArrayRange data, int level, boolean parallel, boolean skipUnusualTags, boolean lazy) throws IOException { int sceneCount = (int) sis.readEncodedU32("sceneCount"); sceneOffsets = new long[sceneCount]; sceneNames = new String[sceneCount]; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineShape2Tag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineShape2Tag.java index d193ef5f5..80dcbbbab 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineShape2Tag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineShape2Tag.java @@ -38,7 +38,7 @@ public class DefineShape2Tag extends ShapeTag { @SWFType(BasicType.UI16) public int shapeId; - private final RECT shapeBounds; + private RECT shapeBounds; public SHAPEWITHSTYLE shapes; @@ -105,6 +105,11 @@ public class DefineShape2Tag extends ShapeTag { public DefineShape2Tag(SWFInputStream sis, ByteArrayRange data, boolean lazy) throws IOException { super(sis.getSwf(), ID, "DefineShape2", data); + readData(sis, data, 0, false, false, lazy); + } + + @Override + public final void readData(SWFInputStream sis, ByteArrayRange data, int level, boolean parallel, boolean skipUnusualTags, boolean lazy) throws IOException { shapeId = sis.readUI16("shapeId"); shapeBounds = sis.readRECT("shapeBounds"); if (!lazy) { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineShape3Tag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineShape3Tag.java index 1c65807de..c129ea888 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineShape3Tag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineShape3Tag.java @@ -105,6 +105,11 @@ public class DefineShape3Tag extends ShapeTag { public DefineShape3Tag(SWFInputStream sis, ByteArrayRange data, boolean lazy) throws IOException { super(sis.getSwf(), ID, "DefineShape3", data); + readData(sis, data, 0, false, false, lazy); + } + + @Override + public final void readData(SWFInputStream sis, ByteArrayRange data, int level, boolean parallel, boolean skipUnusualTags, boolean lazy) throws IOException { shapeId = sis.readUI16("shapeId"); shapeBounds = sis.readRECT("shapeBounds"); if (!lazy) { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineShape4Tag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineShape4Tag.java index 01517e4b5..08aaccd65 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineShape4Tag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineShape4Tag.java @@ -119,6 +119,11 @@ public class DefineShape4Tag extends ShapeTag { public DefineShape4Tag(SWFInputStream sis, ByteArrayRange data, boolean lazy) throws IOException { super(sis.getSwf(), ID, "DefineShape4", data); + readData(sis, data, 0, false, false, lazy); + } + + @Override + public final void readData(SWFInputStream sis, ByteArrayRange data, int level, boolean parallel, boolean skipUnusualTags, boolean lazy) throws IOException { shapeId = sis.readUI16("shapeId"); shapeBounds = sis.readRECT("shapeBounds"); edgeBounds = sis.readRECT("edgeBounds"); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineShapeTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineShapeTag.java index 7b1d1f5a7..72811bf37 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineShapeTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineShapeTag.java @@ -99,6 +99,11 @@ public class DefineShapeTag extends ShapeTag { public DefineShapeTag(SWFInputStream sis, ByteArrayRange data, boolean lazy) throws IOException { super(sis.getSwf(), ID, "DefineShape", data); + readData(sis, data, 0, false, false, lazy); + } + + @Override + public final void readData(SWFInputStream sis, ByteArrayRange data, int level, boolean parallel, boolean skipUnusualTags, boolean lazy) throws IOException { shapeId = sis.readUI16("shapeId"); shapeBounds = sis.readRECT("shapeBounds"); if (!lazy) { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineSoundTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineSoundTag.java index 6af247303..6e9a7bfdd 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineSoundTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineSoundTag.java @@ -118,6 +118,11 @@ public class DefineSoundTag extends CharacterTag implements SoundTag { */ public DefineSoundTag(SWFInputStream sis, ByteArrayRange data) throws IOException { super(sis.getSwf(), ID, "DefineSound", data); + readData(sis, data, 0, false, false, false); + } + + @Override + public final void readData(SWFInputStream sis, ByteArrayRange data, int level, boolean parallel, boolean skipUnusualTags, boolean lazy) throws IOException { soundId = sis.readUI16("soundId"); soundFormat = (int) sis.readUB(4, "soundFormat"); soundRate = (int) sis.readUB(2, "soundRate"); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineSpriteTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineSpriteTag.java index 40b0dce87..dc5405b54 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineSpriteTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineSpriteTag.java @@ -218,6 +218,11 @@ public class DefineSpriteTag extends CharacterTag implements DrawableTag, Timeli */ public DefineSpriteTag(SWFInputStream sis, int level, ByteArrayRange data, boolean parallel, boolean skipUnusualTags) throws IOException, InterruptedException { super(sis.getSwf(), ID, "DefineSprite", data); + readData(sis, data, level, parallel, skipUnusualTags, false); + } + + @Override + public final void readData(SWFInputStream sis, ByteArrayRange data, int level, boolean parallel, boolean skipUnusualTags, boolean lazy) throws IOException, InterruptedException { spriteId = sis.readUI16("spriteId"); frameCount = sis.readUI16("frameCount"); List subTags = sis.readTagList(this, level + 1, parallel, skipUnusualTags, true); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineText2Tag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineText2Tag.java index 38f6e8bc0..863ca15ab 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineText2Tag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineText2Tag.java @@ -64,9 +64,9 @@ public class DefineText2Tag extends TextTag { @SWFType(BasicType.UI16) public int characterID; - private final int glyphBits; + private int glyphBits; - private final int advanceBits; + private int advanceBits; public RECT textBounds; @@ -527,6 +527,11 @@ public class DefineText2Tag extends TextTag { */ public DefineText2Tag(SWFInputStream sis, ByteArrayRange data) throws IOException { super(sis.getSwf(), ID, "DefineText2", data); + readData(sis, data, 0, false, false, false); + } + + @Override + public final void readData(SWFInputStream sis, ByteArrayRange data, int level, boolean parallel, boolean skipUnusualTags, boolean lazy) throws IOException { characterID = sis.readUI16("characterID"); textBounds = sis.readRECT("textBounds"); textMatrix = sis.readMatrix("textMatrix"); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineTextTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineTextTag.java index 923216df5..f000dbd46 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineTextTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineTextTag.java @@ -65,9 +65,9 @@ public class DefineTextTag extends TextTag { @SWFType(BasicType.UI16) public int characterID; - private final int glyphBits; + private int glyphBits; - private final int advanceBits; + private int advanceBits; public RECT textBounds; @@ -540,6 +540,11 @@ public class DefineTextTag extends TextTag { */ public DefineTextTag(SWFInputStream sis, ByteArrayRange data) throws IOException { super(sis.getSwf(), ID, "DefineText", data); + readData(sis, data, 0, false, false, false); + } + + @Override + public final void readData(SWFInputStream sis, ByteArrayRange data, int level, boolean parallel, boolean skipUnusualTags, boolean lazy) throws IOException { characterID = sis.readUI16("characterID"); textBounds = sis.readRECT("textBounds"); textMatrix = sis.readMatrix("textMatrix"); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineVideoStreamTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineVideoStreamTag.java index 5b239e772..e2399f363 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineVideoStreamTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineVideoStreamTag.java @@ -121,6 +121,11 @@ public class DefineVideoStreamTag extends CharacterTag implements BoundedTag { */ public DefineVideoStreamTag(SWFInputStream sis, ByteArrayRange data) throws IOException { super(sis.getSwf(), ID, "DefineVideoStream", data); + readData(sis, data, 0, false, false, false); + } + + @Override + public final void readData(SWFInputStream sis, ByteArrayRange data, int level, boolean parallel, boolean skipUnusualTags, boolean lazy) throws IOException { characterID = sis.readUI16("characterID"); numFrames = sis.readUI16("numFrames"); width = sis.readUI16("width"); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DoABCDefineTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DoABCDefineTag.java index 08a1015b2..d69f8c523 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DoABCDefineTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DoABCDefineTag.java @@ -43,7 +43,7 @@ public class DoABCDefineTag extends Tag implements ABCContainerTag { */ @HideInRawEdit @SWFField - private final ABC abc; + private ABC abc; /** * A 32-bit flags value, which may contain the following bits set: @@ -91,6 +91,11 @@ public class DoABCDefineTag extends Tag implements ABCContainerTag { */ public DoABCDefineTag(SWFInputStream sis, ByteArrayRange data) throws IOException { super(sis.getSwf(), ID, "DoABCDefine", data); + readData(sis, data, 0, false, false, false); + } + + @Override + public final void readData(SWFInputStream sis, ByteArrayRange data, int level, boolean parallel, boolean skipUnusualTags, boolean lazy) throws IOException { flags = sis.readUI32("flags"); name = sis.readString("name"); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DoABCTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DoABCTag.java index c7e2ba464..2ad209aad 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DoABCTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DoABCTag.java @@ -41,7 +41,7 @@ public class DoABCTag extends Tag implements ABCContainerTag { */ @HideInRawEdit @SWFField - private final ABC abc; + private ABC abc; public static final int ID = 72; @@ -74,7 +74,11 @@ public class DoABCTag extends Tag implements ABCContainerTag { */ public DoABCTag(SWFInputStream sis, ByteArrayRange data) throws IOException { super(sis.getSwf(), ID, "DoABC", data); + readData(sis, data, 0, false, false, false); + } + @Override + public final void readData(SWFInputStream sis, ByteArrayRange data, int level, boolean parallel, boolean skipUnusualTags, boolean lazy) throws IOException { ABCInputStream ais = new ABCInputStream(sis.getBaseStream()); // put it to the dumpview: sis.readByteRangeEx(sis.available(), "abcBytes"); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DoActionTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DoActionTag.java index 2ae62d9d5..c9f89900d 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DoActionTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DoActionTag.java @@ -67,6 +67,11 @@ public class DoActionTag extends Tag implements ASMSource { */ public DoActionTag(SWFInputStream sis, ByteArrayRange data) throws IOException { super(sis.getSwf(), ID, "DoAction", data); + readData(sis, data, 0, false, false, false); + } + + @Override + public final void readData(SWFInputStream sis, ByteArrayRange data, int level, boolean parallel, boolean skipUnusualTags, boolean lazy) throws IOException { actionBytes = sis.readByteRangeEx(sis.available(), "actionBytes"); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DoInitActionTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DoInitActionTag.java index ed02820d0..202378bb1 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DoInitActionTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DoInitActionTag.java @@ -74,6 +74,11 @@ public class DoInitActionTag extends CharacterIdTag implements ASMSource { */ public DoInitActionTag(SWFInputStream sis, ByteArrayRange data) throws IOException { super(sis.getSwf(), ID, "DoInitAction", data); + readData(sis, data, 0, false, false, false); + } + + @Override + public final void readData(SWFInputStream sis, ByteArrayRange data, int level, boolean parallel, boolean skipUnusualTags, boolean lazy) throws IOException { spriteId = sis.readUI16("spriteId"); actionBytes = sis.readByteRangeEx(sis.available(), "actionBytes"); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/EnableDebugger2Tag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/EnableDebugger2Tag.java index f6c35db6c..14afbcedc 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/EnableDebugger2Tag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/EnableDebugger2Tag.java @@ -84,6 +84,11 @@ public class EnableDebugger2Tag extends Tag { */ public EnableDebugger2Tag(SWFInputStream sis, ByteArrayRange data) throws IOException { super(sis.getSwf(), ID, "EnableDebugger2", data); + readData(sis, data, 0, false, false, false); + } + + @Override + public final void readData(SWFInputStream sis, ByteArrayRange data, int level, boolean parallel, boolean skipUnusualTags, boolean lazy) throws IOException { reserved = sis.readUI16("reserved"); passwordHash = sis.readString("passwordHash"); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/EnableDebuggerTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/EnableDebuggerTag.java index 9c84544e4..f84f74c3e 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/EnableDebuggerTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/EnableDebuggerTag.java @@ -77,6 +77,11 @@ public class EnableDebuggerTag extends Tag { */ public EnableDebuggerTag(SWFInputStream sis, ByteArrayRange data) throws IOException { super(sis.getSwf(), ID, "EnableDebugger", data); + readData(sis, data, 0, false, false, false); + } + + @Override + public final void readData(SWFInputStream sis, ByteArrayRange data, int level, boolean parallel, boolean skipUnusualTags, boolean lazy) throws IOException { passwordHash = sis.readString("passwordHash"); } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/EnableTelemetryTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/EnableTelemetryTag.java index fb8c130a4..87f173720 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/EnableTelemetryTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/EnableTelemetryTag.java @@ -1,18 +1,19 @@ /* * Copyright (C) 2010-2015 JPEXS, All rights reserved. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3.0 of the License, or (at your option) any later version. - * + * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.tags; import com.jpexs.decompiler.flash.SWF; @@ -84,6 +85,11 @@ public class EnableTelemetryTag extends Tag { */ public EnableTelemetryTag(SWFInputStream sis, ByteArrayRange data) throws IOException { super(sis.getSwf(), ID, "", data); + readData(sis, data, 0, false, false, false); + } + + @Override + public final void readData(SWFInputStream sis, ByteArrayRange data, int level, boolean parallel, boolean skipUnusualTags, boolean lazy) throws IOException { reserved = (int) sis.readUB(16, "reserved"); if (sis.available() > 0) { passwordHash = sis.readBytesEx(32, "passwordHash"); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/EndTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/EndTag.java index 2b7105f26..64f89d90b 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/EndTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/EndTag.java @@ -1,21 +1,23 @@ /* * Copyright (C) 2010-2015 JPEXS, All rights reserved. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3.0 of the License, or (at your option) any later version. - * + * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.tags; import com.jpexs.decompiler.flash.SWF; +import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.helpers.ByteArrayRange; import java.io.IOException; @@ -50,12 +52,16 @@ public class EndTag extends Tag { /** * Constructor * - * @param swf + * @param sis * @param data * @throws IOException */ - public EndTag(SWF swf, ByteArrayRange data) throws IOException { - super(swf, ID, "End", data); + public EndTag(SWFInputStream sis, ByteArrayRange data) throws IOException { + super(sis.getSwf(), ID, "End", data); + readData(sis, data, 0, false, false, false); + } + @Override + public final void readData(SWFInputStream sis, ByteArrayRange data, int level, boolean parallel, boolean skipUnusualTags, boolean lazy) throws IOException { } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/ExportAssetsTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/ExportAssetsTag.java index 507a41743..bc9ecfc02 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/ExportAssetsTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/ExportAssetsTag.java @@ -68,6 +68,11 @@ public class ExportAssetsTag extends Tag { */ public ExportAssetsTag(SWFInputStream sis, ByteArrayRange data) throws IOException { super(sis.getSwf(), ID, "ExportAssets", data); + readData(sis, data, 0, false, false, false); + } + + @Override + public final void readData(SWFInputStream sis, ByteArrayRange data, int level, boolean parallel, boolean skipUnusualTags, boolean lazy) throws IOException { int count = sis.readUI16("count"); tags = new ArrayList<>(); names = new ArrayList<>(); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/FileAttributesTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/FileAttributesTag.java index e80fc2e15..9150d48f7 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/FileAttributesTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/FileAttributesTag.java @@ -64,6 +64,11 @@ public class FileAttributesTag extends Tag { public FileAttributesTag(SWFInputStream sis, ByteArrayRange data) throws IOException { super(sis.getSwf(), ID, "FileAttributes", data); + readData(sis, data, 0, false, false, false); + } + + @Override + public final void readData(SWFInputStream sis, ByteArrayRange data, int level, boolean parallel, boolean skipUnusualTags, boolean lazy) throws IOException { reserved1 = sis.readUB(1, "reserved1") == 1; // reserved // UB[1] == 0 (reserved) useDirectBlit = sis.readUB(1, "useDirectBlit") != 0; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/FrameLabelTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/FrameLabelTag.java index fa0c9e06b..96ff71508 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/FrameLabelTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/FrameLabelTag.java @@ -52,6 +52,11 @@ public class FrameLabelTag extends Tag { public FrameLabelTag(SWFInputStream sis, ByteArrayRange data) throws IOException { super(sis.getSwf(), ID, "FrameLabel", data); + readData(sis, data, 0, false, false, false); + } + + @Override + public final void readData(SWFInputStream sis, ByteArrayRange data, int level, boolean parallel, boolean skipUnusualTags, boolean lazy) throws IOException { name = sis.readString("name"); if (sis.available() > 0) { if (sis.readUI8("namedAnchor") == 1) { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/ImportAssets2Tag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/ImportAssets2Tag.java index 122699b45..e3a7e6dcd 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/ImportAssets2Tag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/ImportAssets2Tag.java @@ -82,6 +82,11 @@ public class ImportAssets2Tag extends Tag implements ImportTag { */ public ImportAssets2Tag(SWFInputStream sis, ByteArrayRange data) throws IOException { super(sis.getSwf(), ID, "ImportAssets2", data); + readData(sis, data, 0, false, false, false); + } + + @Override + public final void readData(SWFInputStream sis, ByteArrayRange data, int level, boolean parallel, boolean skipUnusualTags, boolean lazy) throws IOException { tags = new ArrayList<>(); names = new ArrayList<>(); url = sis.readString("url"); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/ImportAssetsTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/ImportAssetsTag.java index 3cc386168..aa0634f4f 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/ImportAssetsTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/ImportAssetsTag.java @@ -73,6 +73,11 @@ public class ImportAssetsTag extends Tag implements ImportTag { */ public ImportAssetsTag(SWFInputStream sis, ByteArrayRange data) throws IOException { super(sis.getSwf(), ID, "ImportAssets", data); + readData(sis, data, 0, false, false, false); + } + + @Override + public final void readData(SWFInputStream sis, ByteArrayRange data, int level, boolean parallel, boolean skipUnusualTags, boolean lazy) throws IOException { tags = new ArrayList<>(); names = new ArrayList<>(); url = sis.readString("url"); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/JPEGTablesTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/JPEGTablesTag.java index 5736d3405..0a0f4a719 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/JPEGTablesTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/JPEGTablesTag.java @@ -44,6 +44,11 @@ public class JPEGTablesTag extends Tag { public JPEGTablesTag(SWFInputStream sis, ByteArrayRange data) throws IOException { super(sis.getSwf(), ID, "JPEGTables", data); + readData(sis, data, 0, false, false, false); + } + + @Override + public final void readData(SWFInputStream sis, ByteArrayRange data, int level, boolean parallel, boolean skipUnusualTags, boolean lazy) throws IOException { jpegData = sis.readBytesEx(sis.available(), "jpegData"); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/MetadataTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/MetadataTag.java index 46aa333df..020615c80 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/MetadataTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/MetadataTag.java @@ -44,6 +44,11 @@ public class MetadataTag extends Tag { public MetadataTag(SWFInputStream sis, ByteArrayRange data) { super(sis.getSwf(), ID, "Metadata", data); + readData(sis, data, 0, false, false, false); + } + + @Override + public final void readData(SWFInputStream sis, ByteArrayRange data, int level, boolean parallel, boolean skipUnusualTags, boolean lazy) { try { xmlMetadata = sis.readString("xmlMetadata"); } catch (IOException ex) { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/PlaceObject2Tag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/PlaceObject2Tag.java index f469de27a..761eeda0c 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/PlaceObject2Tag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/PlaceObject2Tag.java @@ -245,6 +245,11 @@ public class PlaceObject2Tag extends PlaceObjectTypeTag implements ASMSourceCont */ public PlaceObject2Tag(SWFInputStream sis, ByteArrayRange data) throws IOException { super(sis.getSwf(), ID, "PlaceObject2", data); + readData(sis, data, 0, false, false, false); + } + + @Override + public final void readData(SWFInputStream sis, ByteArrayRange data, int level, boolean parallel, boolean skipUnusualTags, boolean lazy) throws IOException { placeFlagHasClipActions = sis.readUB(1, "placeFlagHasClipActions") == 1; placeFlagHasClipDepth = sis.readUB(1, "placeFlagHasClipDepth") == 1; placeFlagHasName = sis.readUB(1, "placeFlagHasName") == 1; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/PlaceObject3Tag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/PlaceObject3Tag.java index 351101b7a..1388864a5 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/PlaceObject3Tag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/PlaceObject3Tag.java @@ -346,6 +346,11 @@ public class PlaceObject3Tag extends PlaceObjectTypeTag implements ASMSourceCont */ public PlaceObject3Tag(SWFInputStream sis, ByteArrayRange data) throws IOException { super(sis.getSwf(), ID, "PlaceObject3", data); + readData(sis, data, 0, false, false, false); + } + + @Override + public final void readData(SWFInputStream sis, ByteArrayRange data, int level, boolean parallel, boolean skipUnusualTags, boolean lazy) throws IOException { placeFlagHasClipActions = sis.readUB(1, "placeFlagHasClipActions") == 1; placeFlagHasClipDepth = sis.readUB(1, "placeFlagHasClipDepth") == 1; placeFlagHasName = sis.readUB(1, "placeFlagHasName") == 1; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/PlaceObject4Tag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/PlaceObject4Tag.java index 1a92c9518..99343d58a 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/PlaceObject4Tag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/PlaceObject4Tag.java @@ -348,6 +348,11 @@ public class PlaceObject4Tag extends PlaceObjectTypeTag implements ASMSourceCont */ public PlaceObject4Tag(SWFInputStream sis, ByteArrayRange data) throws IOException { super(sis.getSwf(), ID, "PlaceObject4", data); + readData(sis, data, 0, false, false, false); + } + + @Override + public final void readData(SWFInputStream sis, ByteArrayRange data, int level, boolean parallel, boolean skipUnusualTags, boolean lazy) throws IOException { placeFlagHasClipActions = sis.readUB(1, "placeFlagHasClipActions") == 1; placeFlagHasClipDepth = sis.readUB(1, "placeFlagHasClipDepth") == 1; placeFlagHasName = sis.readUB(1, "placeFlagHasName") == 1; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/PlaceObjectTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/PlaceObjectTag.java index a94f3d087..382a06335 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/PlaceObjectTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/PlaceObjectTag.java @@ -120,6 +120,11 @@ public class PlaceObjectTag extends PlaceObjectTypeTag { */ public PlaceObjectTag(SWFInputStream sis, ByteArrayRange data) throws IOException { super(sis.getSwf(), ID, "PlaceObject", data); + readData(sis, data, 0, false, false, false); + } + + @Override + public final void readData(SWFInputStream sis, ByteArrayRange data, int level, boolean parallel, boolean skipUnusualTags, boolean lazy) throws IOException { characterId = sis.readUI16("characterId"); depth = sis.readUI16("depth"); matrix = sis.readMatrix("matrix"); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/ProductInfoTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/ProductInfoTag.java index 380f17b64..ac0081e18 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/ProductInfoTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/ProductInfoTag.java @@ -65,6 +65,11 @@ public class ProductInfoTag extends Tag { public ProductInfoTag(SWFInputStream sis, ByteArrayRange data) throws IOException { super(sis.getSwf(), ID, "ProductInfo", data); + readData(sis, data, 0, false, false, false); + } + + @Override + public final void readData(SWFInputStream sis, ByteArrayRange data, int level, boolean parallel, boolean skipUnusualTags, boolean lazy) throws IOException { /* * 0: Unknown * 1: Macromedia Flex for J2EE diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/ProtectTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/ProtectTag.java index 08c6815d3..ed3d2770d 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/ProtectTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/ProtectTag.java @@ -77,6 +77,11 @@ public class ProtectTag extends Tag { */ public ProtectTag(SWFInputStream sis, ByteArrayRange data) throws IOException { super(sis.getSwf(), ID, "Protect", data); + readData(sis, data, 0, false, false, false); + } + + @Override + public final void readData(SWFInputStream sis, ByteArrayRange data, int level, boolean parallel, boolean skipUnusualTags, boolean lazy) throws IOException { if (sis.available() > 0) { passwordHash = sis.readString("passwordHash"); } else { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/RemoveObject2Tag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/RemoveObject2Tag.java index 04fdca5cc..10fd07bc2 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/RemoveObject2Tag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/RemoveObject2Tag.java @@ -45,6 +45,11 @@ public class RemoveObject2Tag extends Tag implements RemoveTag { public RemoveObject2Tag(SWFInputStream sis, ByteArrayRange data) throws IOException { super(sis.getSwf(), ID, "RemoveObject2", data); + readData(sis, data, 0, false, false, false); + } + + @Override + public final void readData(SWFInputStream sis, ByteArrayRange data, int level, boolean parallel, boolean skipUnusualTags, boolean lazy) throws IOException { depth = sis.readUI16("depth"); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/RemoveObjectTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/RemoveObjectTag.java index 2cbd90319..adcff4344 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/RemoveObjectTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/RemoveObjectTag.java @@ -87,6 +87,11 @@ public class RemoveObjectTag extends CharacterIdTag implements RemoveTag { */ public RemoveObjectTag(SWFInputStream sis, ByteArrayRange data) throws IOException { super(sis.getSwf(), ID, "RemoveObject", data); + readData(sis, data, 0, false, false, false); + } + + @Override + public final void readData(SWFInputStream sis, ByteArrayRange data, int level, boolean parallel, boolean skipUnusualTags, boolean lazy) throws IOException { characterId = sis.readUI16("characterId"); depth = sis.readUI16("depth"); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/ScriptLimitsTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/ScriptLimitsTag.java index 75d3ed48d..de3d44c64 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/ScriptLimitsTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/ScriptLimitsTag.java @@ -1,18 +1,19 @@ /* * Copyright (C) 2010-2015 JPEXS, All rights reserved. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3.0 of the License, or (at your option) any later version. - * + * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.tags; import com.jpexs.decompiler.flash.SWF; @@ -46,6 +47,11 @@ public class ScriptLimitsTag extends Tag { public ScriptLimitsTag(SWFInputStream sis, ByteArrayRange data) throws IOException { super(sis.getSwf(), ID, "ScriptLimits", data); + readData(sis, data, 0, false, false, false); + } + + @Override + public final void readData(SWFInputStream sis, ByteArrayRange data, int level, boolean parallel, boolean skipUnusualTags, boolean lazy) throws IOException { maxRecursionDepth = sis.readUI16("maxRecursionDepth"); scriptTimeoutSeconds = sis.readUI16("scriptTimeoutSeconds"); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/SetBackgroundColorTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/SetBackgroundColorTag.java index 2508a81ee..da46ba75c 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/SetBackgroundColorTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/SetBackgroundColorTag.java @@ -40,16 +40,21 @@ public class SetBackgroundColorTag extends Tag { backgroundColor = new RGB(); } - public SetBackgroundColorTag(SWFInputStream sis, ByteArrayRange data) throws IOException { - super(sis.getSwf(), ID, "SetBackgroundColor", data); - backgroundColor = sis.readRGB("backgroundColor"); - } - public SetBackgroundColorTag(SWF swf, RGB backgroundColor) { super(swf, ID, "SetBackgroundColor", null); this.backgroundColor = backgroundColor; } + public SetBackgroundColorTag(SWFInputStream sis, ByteArrayRange data) throws IOException { + super(sis.getSwf(), ID, "SetBackgroundColor", data); + readData(sis, data, 0, false, false, false); + } + + @Override + public final void readData(SWFInputStream sis, ByteArrayRange data, int level, boolean parallel, boolean skipUnusualTags, boolean lazy) throws IOException { + backgroundColor = sis.readRGB("backgroundColor"); + } + @Override public byte[] getData() { ByteArrayOutputStream baos = new ByteArrayOutputStream(); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/SetTabIndexTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/SetTabIndexTag.java index 1f4147891..193c78e77 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/SetTabIndexTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/SetTabIndexTag.java @@ -84,6 +84,11 @@ public class SetTabIndexTag extends Tag { */ public SetTabIndexTag(SWFInputStream sis, ByteArrayRange data) throws IOException { super(sis.getSwf(), ID, "SetTabIndex", data); + readData(sis, data, 0, false, false, false); + } + + @Override + public final void readData(SWFInputStream sis, ByteArrayRange data, int level, boolean parallel, boolean skipUnusualTags, boolean lazy) throws IOException { depth = sis.readUI16("depth"); tabIndex = sis.readUI16("tabIndex"); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/ShowFrameTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/ShowFrameTag.java index 175220381..173d9c7a1 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/ShowFrameTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/ShowFrameTag.java @@ -1,21 +1,23 @@ /* * Copyright (C) 2010-2015 JPEXS, All rights reserved. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3.0 of the License, or (at your option) any later version. - * + * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.tags; import com.jpexs.decompiler.flash.SWF; +import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.helpers.ByteArrayRange; import java.util.ArrayList; import java.util.List; @@ -59,11 +61,16 @@ public class ShowFrameTag extends Tag { /** * Constructor * - * @param swf + * @param sis * @param data */ - public ShowFrameTag(SWF swf, ByteArrayRange data) { - super(swf, ID, "ShowFrame", data); + public ShowFrameTag(SWFInputStream sis, ByteArrayRange data) { + super(sis.getSwf(), ID, "ShowFrame", data); + readData(sis, data, 0, false, false, false); + } + + @Override + public final void readData(SWFInputStream sis, ByteArrayRange data, int level, boolean parallel, boolean skipUnusualTags, boolean lazy) { } /** diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/SoundStreamBlockTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/SoundStreamBlockTag.java index e684bdca2..96ea58607 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/SoundStreamBlockTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/SoundStreamBlockTag.java @@ -1,16 +1,16 @@ /* * Copyright (C) 2010-2015 JPEXS, All rights reserved. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3.0 of the License, or (at your option) any later version. - * + * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public * License along with this library. */ @@ -56,6 +56,11 @@ public class SoundStreamBlockTag extends Tag { */ public SoundStreamBlockTag(SWFInputStream sis, ByteArrayRange data) throws IOException { super(sis.getSwf(), ID, "SoundStreamBlock", data); + readData(sis, data, 0, false, false, false); + } + + @Override + public final void readData(SWFInputStream sis, ByteArrayRange data, int level, boolean parallel, boolean skipUnusualTags, boolean lazy) throws IOException { //all data is streamSoundData streamSoundData = sis.readByteRangeEx(sis.available(), "streamSoundData"); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/SoundStreamHead2Tag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/SoundStreamHead2Tag.java index 69bbe6066..71aaef8b0 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/SoundStreamHead2Tag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/SoundStreamHead2Tag.java @@ -157,6 +157,11 @@ public class SoundStreamHead2Tag extends CharacterIdTag implements SoundStreamHe */ public SoundStreamHead2Tag(SWFInputStream sis, ByteArrayRange data) throws IOException { super(sis.getSwf(), ID, "SoundStreamHead2", data); + readData(sis, data, 0, false, false, false); + } + + @Override + public final void readData(SWFInputStream sis, ByteArrayRange data, int level, boolean parallel, boolean skipUnusualTags, boolean lazy) throws IOException { reserved = (int) sis.readUB(4, "reserved"); playBackSoundRate = (int) sis.readUB(2, "playBackSoundRate"); playBackSoundSize = sis.readUB(1, "playBackSoundSize") == 1; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/SoundStreamHeadTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/SoundStreamHeadTag.java index ab86905a6..541902a8f 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/SoundStreamHeadTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/SoundStreamHeadTag.java @@ -156,6 +156,11 @@ public class SoundStreamHeadTag extends CharacterIdTag implements SoundStreamHea */ public SoundStreamHeadTag(SWFInputStream sis, ByteArrayRange data) throws IOException { super(sis.getSwf(), ID, "SoundStreamHead", data); + readData(sis, data, 0, false, false, false); + } + + @Override + public final void readData(SWFInputStream sis, ByteArrayRange data, int level, boolean parallel, boolean skipUnusualTags, boolean lazy) throws IOException { reserved = (int) sis.readUB(4, "reserved"); playBackSoundRate = (int) sis.readUB(2, "playBackSoundRate"); playBackSoundSize = sis.readUB(1, "playBackSoundSize") == 1; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/StartSound2Tag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/StartSound2Tag.java index 032e4d029..f0ef211af 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/StartSound2Tag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/StartSound2Tag.java @@ -77,6 +77,11 @@ public class StartSound2Tag extends Tag { */ public StartSound2Tag(SWFInputStream sis, ByteArrayRange data) throws IOException { super(sis.getSwf(), ID, "StartSound2", data); + readData(sis, data, 0, false, false, false); + } + + @Override + public final void readData(SWFInputStream sis, ByteArrayRange data, int level, boolean parallel, boolean skipUnusualTags, boolean lazy) throws IOException { soundClassName = sis.readString("soundClassName"); soundInfo = sis.readSOUNDINFO("soundInfo"); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/StartSoundTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/StartSoundTag.java index 5c0276c23..a6af6a494 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/StartSoundTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/StartSoundTag.java @@ -79,6 +79,11 @@ public class StartSoundTag extends Tag { */ public StartSoundTag(SWFInputStream sis, ByteArrayRange data) throws IOException { super(sis.getSwf(), ID, "StartSound", data); + readData(sis, data, 0, false, false, false); + } + + @Override + public final void readData(SWFInputStream sis, ByteArrayRange data, int level, boolean parallel, boolean skipUnusualTags, boolean lazy) throws IOException { soundId = sis.readUI16("soundId"); soundInfo = sis.readSOUNDINFO("soundInfo"); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/SymbolClassTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/SymbolClassTag.java index 426f772d4..aded07cf0 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/SymbolClassTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/SymbolClassTag.java @@ -51,6 +51,11 @@ public class SymbolClassTag extends Tag { public SymbolClassTag(SWFInputStream sis, ByteArrayRange data) throws IOException { super(sis.getSwf(), ID, "SymbolClass", data); + readData(sis, data, 0, false, false, false); + } + + @Override + public final void readData(SWFInputStream sis, ByteArrayRange data, int level, boolean parallel, boolean skipUnusualTags, boolean lazy) throws IOException { int numSymbols = sis.readUI16("numSymbols"); tags = new int[numSymbols]; names = new String[numSymbols]; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/Tag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/Tag.java index 69b062b5b..3afa77483 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/Tag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/Tag.java @@ -140,6 +140,8 @@ public abstract class Tag implements NeedsCharacters, Exportable, Serializable { } } + public abstract void readData(SWFInputStream sis, ByteArrayRange data, int level, boolean parallel, boolean skipUnusualTags, boolean lazy) throws IOException, InterruptedException; + private static final Object lockObject = new Object(); private volatile static List knownTagIds; @@ -457,6 +459,13 @@ public abstract class Tag implements NeedsCharacters, Exportable, Serializable { return SWFInputStream.resolveTag(copy, 0, false, true, false); } + public void undo() throws InterruptedException, IOException { + byte[] data = getOriginalData(); + SWFInputStream tagDataStream = new SWFInputStream(swf, data, getDataPos(), data.length); + readData(tagDataStream, getOriginalRange(), 0, false, true, false); + setModified(false); + } + /** * Returns string representation of the object * diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/TagStub.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/TagStub.java index 7583f496b..38ab71f68 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/TagStub.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/TagStub.java @@ -1,23 +1,25 @@ /* * Copyright (C) 2010-2015 JPEXS, All rights reserved. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3.0 of the License, or (at your option) any later version. - * + * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.tags; import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.helpers.ByteArrayRange; +import java.io.IOException; /** * @@ -42,6 +44,10 @@ public class TagStub extends Tag { dataStream = sis; } + @Override + public final void readData(SWFInputStream sis, ByteArrayRange data, int level, boolean parallel, boolean skipUnusualTags, boolean lazy) throws IOException { + } + /** * Gets data bytes * diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/UnknownTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/UnknownTag.java index 8ed8f9ff2..1323a6b2a 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/UnknownTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/UnknownTag.java @@ -17,7 +17,9 @@ package com.jpexs.decompiler.flash.tags; import com.jpexs.decompiler.flash.SWF; +import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.helpers.ByteArrayRange; +import java.io.IOException; /** * @@ -29,6 +31,10 @@ public class UnknownTag extends Tag { super(swf, id, "Unknown", data); } + @Override + public final void readData(SWFInputStream sis, ByteArrayRange data, int level, boolean parallel, boolean skipUnusualTags, boolean lazy) throws IOException { + } + /** * Gets data bytes * diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/VideoFrameTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/VideoFrameTag.java index 054c768d4..b49ee7b46 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/VideoFrameTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/VideoFrameTag.java @@ -82,6 +82,11 @@ public class VideoFrameTag extends Tag { */ public VideoFrameTag(SWFInputStream sis, ByteArrayRange data) throws IOException { super(sis.getSwf(), ID, "VideoFrame", data); + readData(sis, data, 0, false, false, false); + } + + @Override + public final void readData(SWFInputStream sis, ByteArrayRange data, int level, boolean parallel, boolean skipUnusualTags, boolean lazy) throws IOException { streamID = sis.readUI16("streamID"); frameNum = sis.readUI16("frameNum"); videoData = sis.readByteRangeEx(sis.available(), "videoData"); //TODO: Parse video packets diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/base/CharacterTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/base/CharacterTag.java index 3977a3f54..e5af04803 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/base/CharacterTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/base/CharacterTag.java @@ -1,18 +1,19 @@ /* * Copyright (C) 2010-2015 JPEXS, All rights reserved. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3.0 of the License, or (at your option) any later version. - * + * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.tags.base; import com.jpexs.decompiler.flash.SWF; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/DefineCompactedFont.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/DefineCompactedFont.java index 912855c64..044d3d94e 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/DefineCompactedFont.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/DefineCompactedFont.java @@ -108,7 +108,11 @@ public final class DefineCompactedFont extends FontTag implements DrawableTag { */ public DefineCompactedFont(SWFInputStream sis, ByteArrayRange data) throws IOException { super(sis.getSwf(), ID, "DefineCompactedFont", data); + readData(sis, data, 0, false, false, false); + } + @Override + public final void readData(SWFInputStream sis, ByteArrayRange data, int level, boolean parallel, boolean skipUnusualTags, boolean lazy) throws IOException { fontId = sis.readUI16("fontId"); fonts = new ArrayList<>(); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalGradient.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalGradient.java index 502bd0c58..c623ae840 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalGradient.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalGradient.java @@ -79,6 +79,11 @@ public class DefineExternalGradient extends Tag { */ public DefineExternalGradient(SWFInputStream sis, ByteArrayRange data) throws IOException { super(sis.getSwf(), ID, "DefineExternalGradient", data); + readData(sis, data, 0, false, false, false); + } + + @Override + public final void readData(SWFInputStream sis, ByteArrayRange data, int level, boolean parallel, boolean skipUnusualTags, boolean lazy) throws IOException { gradientId = sis.readUI16("gradientId"); bitmapsFormat = sis.readUI16("bitmapsFormat"); gradientSize = sis.readUI16("gradientSize"); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalImage.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalImage.java index 99acde96c..07a961bad 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalImage.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalImage.java @@ -82,6 +82,11 @@ public class DefineExternalImage extends Tag { */ public DefineExternalImage(SWFInputStream sis, ByteArrayRange data) throws IOException { super(sis.getSwf(), ID, "DefineExternalImage", data); + readData(sis, data, 0, false, false, false); + } + + @Override + public final void readData(SWFInputStream sis, ByteArrayRange data, int level, boolean parallel, boolean skipUnusualTags, boolean lazy) throws IOException { characterId = sis.readUI16("characterId"); bitmapFormat = sis.readUI16("bitmapFormat"); targetWidth = sis.readUI16("targetWidth"); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalImage2.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalImage2.java index 896bdeded..f4ac52254 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalImage2.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalImage2.java @@ -92,6 +92,11 @@ public class DefineExternalImage2 extends Tag { */ public DefineExternalImage2(SWFInputStream sis, ByteArrayRange data) throws IOException { super(sis.getSwf(), ID, "DefineExternalImage2", data); + readData(sis, data, 0, false, false, false); + } + + @Override + public final void readData(SWFInputStream sis, ByteArrayRange data, int level, boolean parallel, boolean skipUnusualTags, boolean lazy) throws IOException { characterId = sis.readUI32("characterId"); bitmapFormat = sis.readUI16("bitmapFormat"); targetWidth = sis.readUI16("targetWidth"); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalSound.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalSound.java index 14d262fa0..23992a0b6 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalSound.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalSound.java @@ -92,6 +92,11 @@ public class DefineExternalSound extends Tag { */ public DefineExternalSound(SWFInputStream sis, ByteArrayRange data) throws IOException { super(sis.getSwf(), ID, "DefineExternalSound", data); + readData(sis, data, 0, false, false, false); + } + + @Override + public final void readData(SWFInputStream sis, ByteArrayRange data, int level, boolean parallel, boolean skipUnusualTags, boolean lazy) throws IOException { characterId = sis.readUI16("characterId"); soundFormat = sis.readUI16("soundFormat"); bits = sis.readUI16("bits"); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalStreamSound.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalStreamSound.java index f426a3e24..676ca8e3d 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalStreamSound.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalStreamSound.java @@ -90,6 +90,11 @@ public class DefineExternalStreamSound extends Tag { */ public DefineExternalStreamSound(SWFInputStream sis, ByteArrayRange data) throws IOException { super(sis.getSwf(), ID, "DefineExternalStreamSound", data); + readData(sis, data, 0, false, false, false); + } + + @Override + public final void readData(SWFInputStream sis, ByteArrayRange data, int level, boolean parallel, boolean skipUnusualTags, boolean lazy) throws IOException { soundFormat = sis.readUI16("soundFormat"); bits = sis.readUI16("bits"); channels = sis.readUI16("channels"); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/DefineGradientMap.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/DefineGradientMap.java index 5f8bcb1ef..b79635174 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/DefineGradientMap.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/DefineGradientMap.java @@ -65,6 +65,11 @@ public class DefineGradientMap extends Tag { */ public DefineGradientMap(SWFInputStream sis, ByteArrayRange data) throws IOException { super(sis.getSwf(), ID, "DefineGradientMap", data); + readData(sis, data, 0, false, false, false); + } + + @Override + public final void readData(SWFInputStream sis, ByteArrayRange data, int level, boolean parallel, boolean skipUnusualTags, boolean lazy) throws IOException { int numGradients = sis.readUI16("numGradients"); indices = new int[numGradients]; for (int i = 0; i < numGradients; i++) { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/DefineSubImage.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/DefineSubImage.java index b12b599de..a5f4c937e 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/DefineSubImage.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/DefineSubImage.java @@ -77,6 +77,11 @@ public class DefineSubImage extends Tag { */ public DefineSubImage(SWFInputStream sis, ByteArrayRange data) throws IOException { super(sis.getSwf(), ID, "DefineSubImage", data); + readData(sis, data, 0, false, false, false); + } + + @Override + public final void readData(SWFInputStream sis, ByteArrayRange data, int level, boolean parallel, boolean skipUnusualTags, boolean lazy) throws IOException { characterId = sis.readUI16("characterId"); imageCharacterId = sis.readUI16("imageCharacterId"); x1 = sis.readUI16("x1"); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/ExporterInfo.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/ExporterInfo.java index 5bab3b0dc..8e690b729 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/ExporterInfo.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/ExporterInfo.java @@ -101,6 +101,11 @@ public class ExporterInfo extends Tag { */ public ExporterInfo(SWFInputStream sis, ByteArrayRange data) throws IOException { super(sis.getSwf(), ID, "ExporterInfo", data); + readData(sis, data, 0, false, false, false); + } + + @Override + public final void readData(SWFInputStream sis, ByteArrayRange data, int level, boolean parallel, boolean skipUnusualTags, boolean lazy) throws IOException { this.version = sis.readUI16("version"); if (this.version >= 0x10a) { flags = sis.readUI32("flags"); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/FontTextureInfo.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/FontTextureInfo.java index 60982b0d4..783d6cc69 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/FontTextureInfo.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/FontTextureInfo.java @@ -105,6 +105,11 @@ public class FontTextureInfo extends Tag { */ public FontTextureInfo(SWFInputStream sis, ByteArrayRange data) throws IOException { super(sis.getSwf(), ID, "FontTextureInfo", data); + readData(sis, data, 0, false, false, false); + } + + @Override + public final void readData(SWFInputStream sis, ByteArrayRange data, int level, boolean parallel, boolean skipUnusualTags, boolean lazy) throws IOException { textureID = sis.readUI32("textureID"); textureFormat = sis.readUI16("textureFormat"); int fileNameLen = sis.readUI8("fileNameLen"); diff --git a/src/com/jpexs/decompiler/flash/gui/TextPanel.java b/src/com/jpexs/decompiler/flash/gui/TextPanel.java index b4ae4b6ad..fd10ea922 100644 --- a/src/com/jpexs/decompiler/flash/gui/TextPanel.java +++ b/src/com/jpexs/decompiler/flash/gui/TextPanel.java @@ -19,6 +19,7 @@ package com.jpexs.decompiler.flash.gui; import com.jpexs.decompiler.flash.configuration.Configuration; import com.jpexs.decompiler.flash.gui.abc.LineMarkedEditorPane; import com.jpexs.decompiler.flash.tags.DefineEditTextTag; +import com.jpexs.decompiler.flash.tags.Tag; import com.jpexs.decompiler.flash.tags.base.FontTag; import com.jpexs.decompiler.flash.tags.base.MissingCharacterHandler; import com.jpexs.decompiler.flash.tags.base.TextTag; @@ -32,6 +33,8 @@ import java.awt.Insets; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.IOException; +import java.util.logging.Level; +import java.util.logging.Logger; import javax.swing.JButton; import javax.swing.JPanel; import javax.swing.JScrollPane; @@ -59,6 +62,8 @@ public class TextPanel extends JPanel implements ActionListener { private static final String ACTION_TEXT_ALIGN_JUSTIFY = "TEXTALIGNJUSTIFY"; + private static final String ACTION_UNDO_CHANGES = "UNDOCHANGES"; + private final MainPanel mainPanel; private final SearchPanel textSearchPanel; @@ -79,6 +84,8 @@ public class TextPanel extends JPanel implements ActionListener { private final JButton textAlignJustifyButton; + private final JButton undoChangesButton; + public TextPanel(final MainPanel mainPanel) { super(new BorderLayout()); @@ -147,6 +154,11 @@ public class TextPanel extends JPanel implements ActionListener { textAlignJustifyButton.setActionCommand(ACTION_TEXT_ALIGN_JUSTIFY); textAlignJustifyButton.addActionListener(this); + undoChangesButton = new JButton("", View.getIcon("reload16")); + undoChangesButton.setMargin(new Insets(3, 3, 3, 10)); + undoChangesButton.setActionCommand(ACTION_UNDO_CHANGES); + undoChangesButton.addActionListener(this); + textButtonsPanel.add(textEditButton); textButtonsPanel.add(textSaveButton); textButtonsPanel.add(textCancelButton); @@ -154,6 +166,7 @@ public class TextPanel extends JPanel implements ActionListener { textButtonsPanel.add(textAlignCenterButton); textButtonsPanel.add(textAlignRightButton); textButtonsPanel.add(textAlignJustifyButton); + textButtonsPanel.add(undoChangesButton); textSaveButton.setVisible(false); textCancelButton.setVisible(false); @@ -186,6 +199,8 @@ public class TextPanel extends JPanel implements ActionListener { textAlignCenterButton.setVisible(alignable); textAlignRightButton.setVisible(alignable); textAlignJustifyButton.setVisible(false); // todo + + undoChangesButton.setVisible(item != null && item instanceof TextTag && ((Tag) item).isModified()); } public void updateSearchPos() { @@ -253,6 +268,20 @@ public class TextPanel extends JPanel implements ActionListener { } break; } + case ACTION_UNDO_CHANGES: { + TreeItem item = mainPanel.tagTree.getCurrentTreeItem(); + if (item instanceof TextTag) { + try { + ((Tag) item).undo(); + } catch (InterruptedException | IOException ex) { + Logger.getLogger(TextPanel.class.getName()).log(Level.SEVERE, null, ex); + } + + item.getSwf().clearImageCache(); + mainPanel.refreshTree(); + } + break; + } } } diff --git a/src/com/jpexs/decompiler/flash/gui/locales/MainFrame.properties b/src/com/jpexs/decompiler/flash/gui/locales/MainFrame.properties index fbb329d58..1f1249c4e 100644 --- a/src/com/jpexs/decompiler/flash/gui/locales/MainFrame.properties +++ b/src/com/jpexs/decompiler/flash/gui/locales/MainFrame.properties @@ -554,3 +554,6 @@ contextmenu.exportSwfXml = Export SWF as XML contextmenu.importSwfXml = Import SWF XML filter.xml = XML + +#after version 4.1.0 +contextmenu.undo = Undo diff --git a/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_hu.properties b/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_hu.properties index a41ce9a73..867f7e31b 100644 --- a/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_hu.properties +++ b/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_hu.properties @@ -554,3 +554,6 @@ contextmenu.exportSwfXml = SWF export\u00e1l\u00e1sa XML-k\u00e9nt contextmenu.importSwfXml = SWF XML import\u00e1l\u00e1s filter.xml = XML + +#after version 4.1.0 +contextmenu.undo = Visszavon\u00e1s diff --git a/src/com/jpexs/decompiler/flash/gui/tagtree/TagTreeContextMenu.java b/src/com/jpexs/decompiler/flash/gui/tagtree/TagTreeContextMenu.java index 03bd0a5c8..c94ee717e 100644 --- a/src/com/jpexs/decompiler/flash/gui/tagtree/TagTreeContextMenu.java +++ b/src/com/jpexs/decompiler/flash/gui/tagtree/TagTreeContextMenu.java @@ -69,6 +69,8 @@ public class TagTreeContextMenu extends JPopupMenu implements ActionListener { private static final String ACTION_REMOVE_ITEM_WITH_DEPENDENCIES = "REMOVEITEMWITHDEPENDENCIES"; + private static final String ACTION_UNDO_TAG = "UNDOTAG"; + private static final String ACTION_CLOSE_SWF = "CLOSESWF"; private static final String ACTION_EXPAND_RECURSIVE = "EXPANDRECURSIVE"; @@ -85,6 +87,8 @@ public class TagTreeContextMenu extends JPopupMenu implements ActionListener { private JMenuItem removeWithDependenciesMenuItem; + private JMenuItem undoTagMenuItem; + private JMenuItem exportSelectionMenuItem; private JMenuItem replaceMenuItem; @@ -127,6 +131,11 @@ public class TagTreeContextMenu extends JPopupMenu implements ActionListener { removeWithDependenciesMenuItem.setActionCommand(ACTION_REMOVE_ITEM_WITH_DEPENDENCIES); add(removeWithDependenciesMenuItem); + undoTagMenuItem = new JMenuItem(mainPanel.translate("contextmenu.undo")); + undoTagMenuItem.addActionListener(this); + undoTagMenuItem.setActionCommand(ACTION_UNDO_TAG); + add(undoTagMenuItem); + exportSelectionMenuItem = new JMenuItem(mainPanel.translate("menu.file.export.selection")); exportSelectionMenuItem.setActionCommand(MainFrameRibbonMenu.ACTION_EXPORT_SEL); exportSelectionMenuItem.addActionListener(mainPanel); @@ -235,6 +244,21 @@ public class TagTreeContextMenu extends JPopupMenu implements ActionListener { } } + boolean allSelectedIsTag = true; + for (TreeItem item : items) { + if (!(item instanceof Tag)) { + if (item instanceof TagScript) { + Tag tag = ((TagScript) item).getTag(); + if (tag instanceof DoActionTag || tag instanceof DoInitActionTag) { + continue; + } + } + + allSelectedIsTag = false; + break; + } + } + boolean allSelectedIsBinaryData = true; for (TreeItem item : items) { if (!(item instanceof DefineBinaryDataTag)) { @@ -260,6 +284,7 @@ public class TagTreeContextMenu extends JPopupMenu implements ActionListener { expandRecursiveMenuItem.setVisible(false); removeMenuItem.setVisible(allSelectedIsTagOrFrame); removeWithDependenciesMenuItem.setVisible(allSelectedIsTagOrFrame); + undoTagMenuItem.setVisible(allSelectedIsTag); exportSelectionMenuItem.setEnabled(tagTree.hasExportableNodes()); replaceMenuItem.setVisible(false); rawEditMenuItem.setVisible(false); @@ -432,8 +457,8 @@ public class TagTreeContextMenu extends JPopupMenu implements ActionListener { } mainPanel.loadFromBinaryTag(binaryDatas); + break; } - break; case ACTION_RAW_EDIT: { TreeItem itemr = tagTree.getCurrentTreeItem(); if (itemr == null) { @@ -441,8 +466,8 @@ public class TagTreeContextMenu extends JPopupMenu implements ActionListener { } mainPanel.showGenericTag((Tag) itemr); + break; } - break; case ACTION_JUMP_TO_CHARACTER: { TreeItem itemj = tagTree.getCurrentTreeItem(); if (itemj == null || !(itemj instanceof CharacterIdTag)) { @@ -451,28 +476,28 @@ public class TagTreeContextMenu extends JPopupMenu implements ActionListener { CharacterIdTag characterIdTag = (CharacterIdTag) itemj; mainPanel.setTagTreeSelectedNode(itemj.getSwf().getCharacter(characterIdTag.getCharacterId())); + break; } - break; case ACTION_EXPAND_RECURSIVE: { TreePath path = tagTree.getSelectionPath(); if (path == null) { return; } View.expandTreeNodes(tagTree, path, true); + break; } - break; case ACTION_REMOVE_ITEM: case ACTION_REMOVE_ITEM_WITH_DEPENDENCIES: { List sel = tagTree.getSelected(tagTree); List tagsToRemove = new ArrayList<>(); - for (TreeItem tag : sel) { - if (tag instanceof Tag) { - tagsToRemove.add((Tag) tag); - } else if (tag instanceof TagScript) { - tagsToRemove.add(((TagScript) tag).getTag()); - } else if (tag instanceof Frame) { - Frame frameNode = (Frame) tag; + for (TreeItem item : sel) { + if (item instanceof Tag) { + tagsToRemove.add((Tag) item); + } else if (item instanceof TagScript) { + tagsToRemove.add(((TagScript) item).getTag()); + } else if (item instanceof Frame) { + Frame frameNode = (Frame) item; Frame frame = frameNode.timeline.getFrame(frameNode.frame); if (frame.showFrameTag != null) { tagsToRemove.add(frame.showFrameTag); @@ -498,8 +523,26 @@ public class TagTreeContextMenu extends JPopupMenu implements ActionListener { mainPanel.refreshTree(); } } + break; + } + case ACTION_UNDO_TAG: { + List sel = tagTree.getSelected(tagTree); + + for (TreeItem item : sel) { + if (item instanceof Tag) { + try { + Tag tag = (Tag) item; + tag.undo(); + tag.getSwf().clearAllCache(); + } catch (InterruptedException | IOException ex) { + Logger.getLogger(TagTreeContextMenu.class.getName()).log(Level.SEVERE, null, ex); + } + } + } + + mainPanel.refreshTree(); + break; } - break; case ACTION_CLOSE_SWF: { List sel = tagTree.getSelected(tagTree); for (TreeItem item : sel) { @@ -516,8 +559,8 @@ public class TagTreeContextMenu extends JPopupMenu implements ActionListener { Main.closeFile((SWFList) item); } } + break; } - break; } } }