diff --git a/trunk/src/com/jpexs/decompiler/flash/SWF.java b/trunk/src/com/jpexs/decompiler/flash/SWF.java index 72facd9c5..e09ca61ae 100644 --- a/trunk/src/com/jpexs/decompiler/flash/SWF.java +++ b/trunk/src/com/jpexs/decompiler/flash/SWF.java @@ -1872,7 +1872,7 @@ public final class SWF implements TreeItem, Timelined { switch (mode) { case SVG: try (FileOutputStream fos = new FileOutputStream(file)) { - fos.write(Utf8Helper.getBytes(st.toSVG(new SVGExporterContext(outdir, "assets_" + fcharacterID), 0))); + fos.write(Utf8Helper.getBytes(st.toSVG(new SVGExporterContext(outdir, "assets_" + fcharacterID), -2, 0))); } break; case PNG: @@ -1928,7 +1928,7 @@ public final class SWF implements TreeItem, Timelined { switch (mode) { case SVG: try (FileOutputStream fos = new FileOutputStream(file)) { - fos.write(Utf8Helper.getBytes(mst.toSVG(new SVGExporterContext(outdir, "assets_" + fcharacterID), 0))); + fos.write(Utf8Helper.getBytes(mst.toSVG(new SVGExporterContext(outdir, "assets_" + fcharacterID), -2, 0))); } break; } @@ -2662,7 +2662,7 @@ public final class SWF implements TreeItem, Timelined { exporterContext.exportedTags.put(drawableTag, assetFileName); File file = new File(assetsDir + File.separator + assetFileName); try (FileOutputStream fos = new FileOutputStream(file)) { - fos.write(Utf8Helper.getBytes(drawable.toSVG(exporterContext, level + 1))); + fos.write(Utf8Helper.getBytes(drawable.toSVG(exporterContext, layer.ratio, level + 1))); } } RECT boundRect = drawable.getRect(); diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/MainPanel.java b/trunk/src/com/jpexs/decompiler/flash/gui/MainPanel.java index 4a007b36f..6d324d2d4 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/MainPanel.java +++ b/trunk/src/com/jpexs/decompiler/flash/gui/MainPanel.java @@ -234,9 +234,9 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec private static final String ACTION_EXPAND_RECURSIVE = "EXPANDRECURSIVE"; // play morph shape in 2 second(s) - public static final int morphShapeAnimationLength = 2; + public static final int MORPH_SHAPE_ANIMATION_LENGTH = 2; - public static final int morphShapeAnimationFrameRate = 30; + public static final int MORPH_SHAPE_ANIMATION_FRAME_RATE = 30; private static final Logger logger = Logger.getLogger(MainPanel.class.getName()); @@ -2521,8 +2521,8 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec } tim = new Timeline(tag.getSwf(), new ArrayList(), ((CharacterTag) tag).getCharacterId(), getRect()); if (tag instanceof MorphShapeTag) { - tim.frameRate = morphShapeAnimationFrameRate; - int framesCnt = tim.frameRate * morphShapeAnimationLength; + tim.frameRate = MORPH_SHAPE_ANIMATION_FRAME_RATE; + int framesCnt = tim.frameRate * MORPH_SHAPE_ANIMATION_LENGTH; for (int i = 0; i < framesCnt; i++) { Frame f = new Frame(tim); DepthState ds = new DepthState(tag.getSwf(), f); diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/PreviewPanel.java b/trunk/src/com/jpexs/decompiler/flash/gui/PreviewPanel.java index 47dd57af1..ee3659192 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/PreviewPanel.java +++ b/trunk/src/com/jpexs/decompiler/flash/gui/PreviewPanel.java @@ -504,8 +504,8 @@ public class PreviewPanel extends JSplitPane implements ActionListener { } if ((tagObj instanceof DefineMorphShapeTag) || (tagObj instanceof DefineMorphShape2Tag)) { - frameRate = MainPanel.morphShapeAnimationFrameRate; - frameCount = MainPanel.morphShapeAnimationLength * frameRate; + frameRate = MainPanel.MORPH_SHAPE_ANIMATION_FRAME_RATE; + frameCount = MainPanel.MORPH_SHAPE_ANIMATION_LENGTH * frameRate; } if (tagObj instanceof DefineSoundTag) { diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/locales/MainFrame.properties b/trunk/src/com/jpexs/decompiler/flash/gui/locales/MainFrame.properties index ebf835c4e..f8906ade4 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/locales/MainFrame.properties +++ b/trunk/src/com/jpexs/decompiler/flash/gui/locales/MainFrame.properties @@ -467,4 +467,4 @@ button.next = Next message.action.playerglobal.title = PlayerGlobal library needed message.action.playerglobal.needed = For ActionScript 3 direct editation, a library called "PlayerGlobal.swc" needs to be downloaded from Adobe homepage.\r\n%adobehomepage%\r\nPress OK to go to the download page. -message.action.playerglobal.place = Download the library called PlayerGlobal(.swc), and place it to directory\r\n%libpath%\r\n Press OK to continue. \ No newline at end of file +message.action.playerglobal.place = Download the library called PlayerGlobal(.swc), and place it to directory\r\n%libpath%\r\n Press OK to continue. diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_hu.properties b/trunk/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_hu.properties index ff21decc6..f82ffbb06 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_hu.properties +++ b/trunk/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_hu.properties @@ -464,3 +464,7 @@ error.sound.invalid = \u00c9rv\u00e9nytelen hang. button.prev = El\u0151z\u0151 button.next = K\u00f6vetkez\u0151 + +message.action.playerglobal.title = PlayerGlobal k\u00f6nyvt\u00e1r sz\u00fcks\u00e9ges +message.action.playerglobal.needed = Az ActionScript 3 k\u00f6zvetlen szerkeszt\u00e9s\u00e9hez a "PlayerGlobal.swc" nev\u0171 k\u00f6nyvt\u00e1rra van sz\u00fcks\u00e9g, melyet az Adobe honlapj\u00e1r\u00f3l lehet let\u00f6lteni.\r\n%adobehomepage%\r\nNyomjon OK-t a let\u00f6lt\u00e9si oldal megnyit\u00e1s\u00e1hoz. +message.action.playerglobal.place = T\u00f6ltse le a PlayerGlobal(.swc) nev\u0171 k\u00f6nyvt\u00e1rat \u00e9s helyezze el a k\u00f6vetkez\u0151 mapp\u00e1ban:\r\n%libpath%\r\n Nyomjon OK-t a folytat\u00e1shoz. diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DefineEditTextTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DefineEditTextTag.java index 7d2a4630e..832e62c57 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DefineEditTextTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DefineEditTextTag.java @@ -939,7 +939,7 @@ public class DefineEditTextTag extends TextTag { } @Override - public String toSVG(SVGExporterContext exporterContext, int level) { + public String toSVG(SVGExporterContext exporterContext, int ratio, int level) { return ""; //throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. } diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DefineMorphShape2Tag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DefineMorphShape2Tag.java index c19f0312d..a35b1d15d 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DefineMorphShape2Tag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DefineMorphShape2Tag.java @@ -25,8 +25,8 @@ import com.jpexs.decompiler.flash.exporters.Matrix; import com.jpexs.decompiler.flash.exporters.Point; import com.jpexs.decompiler.flash.exporters.SVGExporterContext; import com.jpexs.decompiler.flash.exporters.morphshape.SVGMorphShapeExporter; +import com.jpexs.decompiler.flash.exporters.shape.SVGShapeExporter; import com.jpexs.decompiler.flash.tags.base.CharacterTag; -import com.jpexs.decompiler.flash.tags.base.DrawableTag; import com.jpexs.decompiler.flash.tags.base.MorphShapeTag; import com.jpexs.decompiler.flash.timeline.DepthState; import com.jpexs.decompiler.flash.types.BasicType; @@ -61,7 +61,7 @@ import java.util.Set; * * @author JPEXS */ -public class DefineMorphShape2Tag extends CharacterTag implements MorphShapeTag, DrawableTag { +public class DefineMorphShape2Tag extends CharacterTag implements MorphShapeTag { @SWFType(BasicType.UI16) public int characterId; @@ -99,16 +99,6 @@ public class DefineMorphShape2Tag extends CharacterTag implements MorphShapeTag, return rect; } - @Override - public String toSVG(SVGExporterContext exporterContext, int level) { - ExportRectangle rect = new ExportRectangle(getRect()); - SHAPEWITHSTYLE beginShapes = getShapeAtRatio(0); - SHAPEWITHSTYLE endShapes = getShapeAtRatio(65535); - SVGMorphShapeExporter exporter = new SVGMorphShapeExporter(swf, beginShapes, endShapes, rect, new ColorTransform() /*FIXME?*/); - exporter.export(); - return exporter.getSVG(); - } - @Override public int getCharacterId() { return characterId; @@ -338,6 +328,23 @@ public class DefineMorphShape2Tag extends CharacterTag implements MorphShapeTag, BitmapExporter.export(swf, shape, null, image, transformation, colorTransform); } + @Override + public String toSVG(SVGExporterContext exporterContext, int ratio, int level) { + ExportRectangle rect = new ExportRectangle(getRect()); + if (ratio == -2) { + SHAPEWITHSTYLE beginShapes = getShapeAtRatio(0); + SHAPEWITHSTYLE endShapes = getShapeAtRatio(65535); + SVGMorphShapeExporter exporter = new SVGMorphShapeExporter(swf, beginShapes, endShapes, rect, new ColorTransform() /*FIXME?*/); + exporter.export(); + return exporter.getSVG(); + } else { + SHAPEWITHSTYLE shapes = getShapeAtRatio(ratio); + SVGShapeExporter exporter = new SVGShapeExporter(swf, shapes, rect, new ColorTransform() /*FIXME?*/); + exporter.export(); + return exporter.getSVG(); + } + } + @Override public Point getImagePos(int frame) { return new Point( diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DefineMorphShapeTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DefineMorphShapeTag.java index 9140651ba..37df7267a 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DefineMorphShapeTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DefineMorphShapeTag.java @@ -25,8 +25,8 @@ import com.jpexs.decompiler.flash.exporters.Matrix; import com.jpexs.decompiler.flash.exporters.Point; import com.jpexs.decompiler.flash.exporters.SVGExporterContext; import com.jpexs.decompiler.flash.exporters.morphshape.SVGMorphShapeExporter; +import com.jpexs.decompiler.flash.exporters.shape.SVGShapeExporter; import com.jpexs.decompiler.flash.tags.base.CharacterTag; -import com.jpexs.decompiler.flash.tags.base.DrawableTag; import com.jpexs.decompiler.flash.tags.base.MorphShapeTag; import com.jpexs.decompiler.flash.timeline.DepthState; import com.jpexs.decompiler.flash.types.BasicType; @@ -60,7 +60,7 @@ import java.util.Set; * * @author JPEXS */ -public class DefineMorphShapeTag extends CharacterTag implements MorphShapeTag, DrawableTag { +public class DefineMorphShapeTag extends CharacterTag implements MorphShapeTag { @SWFType(BasicType.UI16) public int characterId; @@ -147,16 +147,6 @@ public class DefineMorphShapeTag extends CharacterTag implements MorphShapeTag, return rect; } - @Override - public String toSVG(SVGExporterContext exporterContext, int level) { - ExportRectangle rect = new ExportRectangle(getRect()); - SHAPEWITHSTYLE beginShapes = getShapeAtRatio(0); - SHAPEWITHSTYLE endShapes = getShapeAtRatio(65535); - SVGMorphShapeExporter exporter = new SVGMorphShapeExporter(swf, beginShapes, endShapes, rect, new ColorTransform() /*FIXME?*/); - exporter.export(); - return exporter.getSVG(); - } - @Override public RECT getStartBounds() { return startBounds; @@ -321,6 +311,23 @@ public class DefineMorphShapeTag extends CharacterTag implements MorphShapeTag, BitmapExporter.export(swf, shape, null, image, transformation, colorTransform); } + @Override + public String toSVG(SVGExporterContext exporterContext, int ratio, int level) { + ExportRectangle rect = new ExportRectangle(getRect()); + if (ratio == -2) { + SHAPEWITHSTYLE beginShapes = getShapeAtRatio(0); + SHAPEWITHSTYLE endShapes = getShapeAtRatio(65535); + SVGMorphShapeExporter exporter = new SVGMorphShapeExporter(swf, beginShapes, endShapes, rect, new ColorTransform() /*FIXME?*/); + exporter.export(); + return exporter.getSVG(); + } else { + SHAPEWITHSTYLE shapes = getShapeAtRatio(ratio); + SVGShapeExporter exporter = new SVGShapeExporter(swf, shapes, rect, new ColorTransform() /*FIXME?*/); + exporter.export(); + return exporter.getSVG(); + } + } + @Override public Point getImagePos(int frame) { return new Point( diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DefineShape2Tag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DefineShape2Tag.java index 3e4951d79..8801d0660 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DefineShape2Tag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DefineShape2Tag.java @@ -61,7 +61,7 @@ public class DefineShape2Tag extends ShapeTag { } @Override - public String toSVG(SVGExporterContext exporterContext, int level) { + public String toSVG(SVGExporterContext exporterContext, int ratio, int level) { ExportRectangle rect = new ExportRectangle(getRect()); SVGShapeExporter exporter = new SVGShapeExporter(swf, getShapes(), rect, new ColorTransform() /*FIXME?*/); exporter.export(); diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DefineShape3Tag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DefineShape3Tag.java index 801af0af0..a07880ab3 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DefineShape3Tag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DefineShape3Tag.java @@ -66,7 +66,7 @@ public class DefineShape3Tag extends ShapeTag { } @Override - public String toSVG(SVGExporterContext exporterContext, int level) { + public String toSVG(SVGExporterContext exporterContext, int ratio, int level) { ExportRectangle rect = new ExportRectangle(getRect()); SVGShapeExporter exporter = new SVGShapeExporter(swf, getShapes(), rect, new ColorTransform() /*FIXME?*/); exporter.export(); diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DefineShape4Tag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DefineShape4Tag.java index 5407c1903..f1eb44651 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DefineShape4Tag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DefineShape4Tag.java @@ -69,7 +69,7 @@ public class DefineShape4Tag extends ShapeTag { } @Override - public String toSVG(SVGExporterContext exporterContext, int level) { + public String toSVG(SVGExporterContext exporterContext, int ratio, int level) { ExportRectangle rect = new ExportRectangle(getRect()); SVGShapeExporter exporter = new SVGShapeExporter(swf, getShapes(), rect, new ColorTransform() /*FIXME?*/); exporter.export(); diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DefineShapeTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DefineShapeTag.java index 37540400b..bab7a926d 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DefineShapeTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DefineShapeTag.java @@ -94,7 +94,7 @@ public class DefineShapeTag extends ShapeTag { } @Override - public String toSVG(SVGExporterContext exporterContext, int level) { + public String toSVG(SVGExporterContext exporterContext, int ratio, int level) { ExportRectangle rect = new ExportRectangle(getRect()); SVGShapeExporter exporter = new SVGShapeExporter(swf, getShapes(), rect, new ColorTransform() /*FIXME?*/); exporter.export(); diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DefineSpriteTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DefineSpriteTag.java index 4cb3b9d20..8be3172cc 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DefineSpriteTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DefineSpriteTag.java @@ -290,7 +290,7 @@ public class DefineSpriteTag extends CharacterTag implements Container, Drawable } @Override - public String toSVG(SVGExporterContext exporterContext, int level) throws IOException { + public String toSVG(SVGExporterContext exporterContext, int ratio, int level) throws IOException { return SWF.frameToSvg(getTimeline(), 0, 0, null, 0, exporterContext, getRect(), new ColorTransform(), null, level + 1); } diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DefineText2Tag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DefineText2Tag.java index 1988f479c..d20273106 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DefineText2Tag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DefineText2Tag.java @@ -494,7 +494,7 @@ public class DefineText2Tag extends TextTag { } @Override - public String toSVG(SVGExporterContext exporterContext, int level) { + public String toSVG(SVGExporterContext exporterContext, int ratio, int level) { return ""; //throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. } diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DefineTextTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DefineTextTag.java index ada69e2bd..580624c1a 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DefineTextTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DefineTextTag.java @@ -510,7 +510,7 @@ public class DefineTextTag extends TextTag { } @Override - public String toSVG(SVGExporterContext exporterContext, int level) { + public String toSVG(SVGExporterContext exporterContext, int ratio, int level) { return ""; //throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. } diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/base/ButtonTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/base/ButtonTag.java index 1176b54e6..33fc7f35d 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/base/ButtonTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/base/ButtonTag.java @@ -59,7 +59,7 @@ public abstract class ButtonTag extends CharacterTag implements DrawableTag, Tim } @Override - public String toSVG(SVGExporterContext exporterContext, int level) { + public String toSVG(SVGExporterContext exporterContext, int ratio, int level) { return ""; //throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. } diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/base/DrawableTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/base/DrawableTag.java index c5781386b..a7235d8b6 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/base/DrawableTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/base/DrawableTag.java @@ -33,7 +33,7 @@ public interface DrawableTag extends BoundedTag { public void toImage(int frame, int time, int ratio, DepthState stateUnderCursor, int mouseButton, SerializableImage image, Matrix transformation, ColorTransform colorTransform); - public String toSVG(SVGExporterContext exporterContext, int level) throws IOException; + public String toSVG(SVGExporterContext exporterContext, int ratio, int level) throws IOException; public Point getImagePos(int frame); diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/base/FontTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/base/FontTag.java index 441ec4ea0..c54d207cc 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/base/FontTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/base/FontTag.java @@ -260,7 +260,7 @@ public abstract class FontTag extends CharacterTag implements AloneTag, Drawable } @Override - public String toSVG(SVGExporterContext exporterContext, int level) { + public String toSVG(SVGExporterContext exporterContext, int ratio, int level) { return ""; //throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. } diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/base/MorphShapeTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/base/MorphShapeTag.java index 27bc079c9..43fbfe90e 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/base/MorphShapeTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/base/MorphShapeTag.java @@ -16,7 +16,6 @@ */ package com.jpexs.decompiler.flash.tags.base; -import com.jpexs.decompiler.flash.exporters.SVGExporterContext; import com.jpexs.decompiler.flash.types.MORPHFILLSTYLEARRAY; import com.jpexs.decompiler.flash.types.MORPHLINESTYLEARRAY; import com.jpexs.decompiler.flash.types.RECT; @@ -27,7 +26,7 @@ import com.jpexs.decompiler.flash.types.SHAPEWITHSTYLE; * * @author JPEXS */ -public interface MorphShapeTag { +public interface MorphShapeTag extends DrawableTag { public RECT getStartBounds(); @@ -41,8 +40,6 @@ public interface MorphShapeTag { public SHAPE getEndEdges(); - public String toSVG(SVGExporterContext exporterContext, int level); - public int getShapeNum(); public SHAPEWITHSTYLE getShapeAtRatio(int ratio);