diff --git a/trunk/src/com/jpexs/decompiler/flash/SWF.java b/trunk/src/com/jpexs/decompiler/flash/SWF.java index 400435541..569844a75 100644 --- a/trunk/src/com/jpexs/decompiler/flash/SWF.java +++ b/trunk/src/com/jpexs/decompiler/flash/SWF.java @@ -2194,7 +2194,7 @@ public final class SWF implements TreeItem, Timelined { return ret; } - public static SerializableImage frameToImageGet(Timeline timeline, int frame, DepthState stateUnderCursor, int mouseButton, RECT displayRect, Matrix transformation, ColorTransform colorTransform) { + public static SerializableImage frameToImageGet(Timeline timeline, int frame, int time, DepthState stateUnderCursor, int mouseButton, RECT displayRect, Matrix transformation, ColorTransform colorTransform) { String key = "frame_" + frame + "_" + timeline.id + "_" + timeline.swf.hashCode(); SerializableImage image = getFromCache(key); if (image != null) { @@ -2211,7 +2211,7 @@ public final class SWF implements TreeItem, Timelined { image.fillTransparent(); Matrix m = new Matrix(); m.translate(-rect.Xmin, -rect.Ymin); - frameToImage(timeline, frame, stateUnderCursor, mouseButton, image, m, colorTransform); + frameToImage(timeline, frame,time, stateUnderCursor, mouseButton, image, m, colorTransform); putToCache(key, image); return image; } @@ -2224,7 +2224,7 @@ public final class SWF implements TreeItem, Timelined { image.fillTransparent(); Matrix m = new Matrix(); m.translate(-rect.Xmin, -rect.Ymin); - frameToImage(timeline, f, stateUnderCursor, mouseButton, image, m, colorTransform); + frameToImage(timeline, f,0, stateUnderCursor, mouseButton, image, m, colorTransform); ret.add(image); } } @@ -2241,7 +2241,7 @@ public final class SWF implements TreeItem, Timelined { } - public static void frameToImage(Timeline timeline, int frame, DepthState stateUnderCursor, int mouseButton, SerializableImage image, Matrix transformation, ColorTransform colorTransform) { + public static void frameToImage(Timeline timeline, int frame, int time, DepthState stateUnderCursor, int mouseButton, SerializableImage image, Matrix transformation, ColorTransform colorTransform) { float unzoom = (float) SWF.unitDivisor; if (timeline.frames.size() <= frame) { return; @@ -2290,8 +2290,7 @@ public final class SWF implements TreeItem, Timelined { DrawableTag drawable = (DrawableTag) character; SerializableImage img; Matrix drawMatrix = new Matrix(); - int dframe = 0 + layer.time % drawable.getNumFrames(); - + int dframe = 0 + (time+layer.time) % drawable.getNumFrames(); if (character instanceof ButtonTag) { ButtonTag bt = (ButtonTag) character; dframe = ButtonTag.FRAME_UP; @@ -2346,7 +2345,7 @@ public final class SWF implements TreeItem, Timelined { m.translate(-rect.xMin, -rect.yMin); drawMatrix.translate(rect.xMin, rect.yMin); - drawable.toImage(dframe, layer.ratio, stateUnderCursor, mouseButton, img, m, clrTrans); + drawable.toImage(dframe, layer.time + time, layer.ratio, stateUnderCursor, mouseButton, img, m, clrTrans); //if(stateUnderCursor == layer){ /* if(true){ Graphics2D gg = (Graphics2D)img.getGraphics(); diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/ImagePanel.java b/trunk/src/com/jpexs/decompiler/flash/gui/ImagePanel.java index 7d22e01ae..bfaa55b3f 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/ImagePanel.java +++ b/trunk/src/com/jpexs/decompiler/flash/gui/ImagePanel.java @@ -85,6 +85,7 @@ public final class ImagePanel extends JPanel implements ActionListener, MediaDis private MouseEvent lastMouseEvent = null; private List soundPlayers = new ArrayList<>(); private IconPanel iconPanel; + private int time = 0; private class IconPanel extends JPanel { @@ -373,6 +374,7 @@ public final class ImagePanel extends JPanel implements ActionListener, MediaDis return; } frame = 0; + time = 0; play(); } @@ -422,18 +424,24 @@ public final class ImagePanel extends JPanel implements ActionListener, MediaDis private void nextFrame() { int newframe = frame == timelined.getTimeline().frames.size() - 1 ? 0 : frame + 1; + if(stillFrame){ + newframe = frame; + } if (newframe != frame) { if (newframe == 0) { stopAllSounds(); } frame = newframe; updatePos(lastMouseEvent); - drawFrame(); + time = 0; + }else{ + time++; } + drawFrame(); } - private static SerializableImage getFrame(SWF swf, int frame, Timelined drawable, DepthState stateUnderCursor, int mouseButton) { - String key = "drawable_" + frame + "_" + drawable.hashCode() + "_" + mouseButton + "_" + (stateUnderCursor == null ? "out" : stateUnderCursor.hashCode()); + private static SerializableImage getFrame(SWF swf, int frame,int time, Timelined drawable, DepthState stateUnderCursor, int mouseButton) { + String key = "drawable_" + frame + "_" + drawable.hashCode() + "_" + mouseButton + "_" + (stateUnderCursor == null ? "out" : stateUnderCursor.hashCode())+"_"+time; SerializableImage img = SWF.getFromCache(key); if (img == null) { if (drawable instanceof BoundedTag) { @@ -445,37 +453,12 @@ public final class ImagePanel extends JPanel implements ActionListener, MediaDis int width = rect.getWidth(); int height = rect.getHeight(); double scale = 1.0; - /*if (width > swf.displayRect.getWidth() || height > swf.displayRect.getHeight()) { - //scale = (double) swf.displayRect.getWidth() / (double) width; - //width = swf.displayRect.getWidth(); - - int w1 = width; - int h1 = height; - int w2 = swf.displayRect.getWidth(); - int h2 = swf.displayRect.getHeight(); - - int w; - int h = h1 * w2 / w1; - if (h > h2) { - w = w1 * h2 / h1; - h = h2; - } else { - w = w2; - } - scale = (double) w / (double) width; - - width = w; - height = h; - }*/ SerializableImage image = new SerializableImage((int) (width / SWF.unitDivisor) + 1, (int) (height / SWF.unitDivisor) + 1, SerializableImage.TYPE_INT_ARGB); image.fillTransparent(); Matrix m = new Matrix(); m.translate(-rect.Xmin, -rect.Ymin); - /*m.translate(-rect.getWidth(), -rect.getHeight()); - m.scale(scale); - m.translate(rect.getWidth()*scale, rect.getHeight()*scale);*/ - drawable.getTimeline().toImage(frame, frame, stateUnderCursor, mouseButton, image, m, new ColorTransform()); + drawable.getTimeline().toImage(frame, time, frame, stateUnderCursor, mouseButton, image, m, new ColorTransform()); Graphics2D gg = (Graphics2D) image.getGraphics(); gg.setStroke(new BasicStroke(3)); @@ -508,8 +491,8 @@ public final class ImagePanel extends JPanel implements ActionListener, MediaDis Matrix mat = new Matrix(); mat.translateX = swf.displayRect.Xmin; mat.translateY = swf.displayRect.Ymin; - BufferedImage img = getFrame(swf, frame, timelined, stateUnderCursor, mouseButton).getBufferedImage(); - List sounds = timelined.getTimeline().getSounds(frame, stateUnderCursor, mouseButton); + BufferedImage img = getFrame(swf, frame,time, timelined, stateUnderCursor, mouseButton).getBufferedImage(); + List sounds = timelined.getTimeline().getSounds(frame,time, stateUnderCursor, mouseButton); for (int sndId : sounds) { CharacterTag c = swf.characters.get(sndId); if (c instanceof SoundTag) { @@ -543,7 +526,7 @@ public final class ImagePanel extends JPanel implements ActionListener, MediaDis m.scale(1); List objs = new ArrayList<>(); List outlines = new ArrayList<>(); - timelined.getTimeline().getObjectsOutlines(frame, frame, stateUnderCursor, mouseButton, m, objs, outlines); + timelined.getTimeline().getObjectsOutlines(frame, time, frame, stateUnderCursor, mouseButton, m, objs, outlines); for (int i = 0; i < outlines.size(); i++) { outlines.set(i, SHAPERECORD.twipToPixelShape(outlines.get(i))); } @@ -560,7 +543,7 @@ public final class ImagePanel extends JPanel implements ActionListener, MediaDis @Override public void play() { pause(); - if (!stillFrame && timelined.getTimeline().frames.size() > 1) { + if (timelined!=null) { timer = new Timer(); timer.schedule(new TimerTask() { @Override diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/PreviewImage.java b/trunk/src/com/jpexs/decompiler/flash/gui/PreviewImage.java index 86588c3a7..be0112652 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/PreviewImage.java +++ b/trunk/src/com/jpexs/decompiler/flash/gui/PreviewImage.java @@ -165,7 +165,7 @@ public class PreviewImage extends JPanel { } else if (treeItem instanceof FrameNodeItem) { FrameNodeItem fn = (FrameNodeItem) treeItem; RECT rect = swf.displayRect; - imgSrc = SWF.frameToImageGet(swf.getTimeline(), fn.getFrame() - 1, null, 0, rect, Matrix.getScaleInstance(1 / SWF.unitDivisor), new ColorTransform()); + imgSrc = SWF.frameToImageGet(swf.getTimeline(), fn.getFrame() - 1, 0, null, 0, rect, Matrix.getScaleInstance(1 / SWF.unitDivisor), new ColorTransform()); width = (imgSrc.getWidth()); height = (imgSrc.getHeight()); } else if (treeItem instanceof ImageTag) { @@ -199,12 +199,6 @@ public class PreviewImage extends JPanel { scale = 1; } - /*if (width > PREVIEW_SIZE * SWF.unitDivisor) { - scale = PREVIEW_SIZE * SWF.unitDivisor / width; - } - if (height > PREVIEW_SIZE * SWF.unitDivisor) { - scale = Math.min(scale, PREVIEW_SIZE * SWF.unitDivisor / height); - }*/ m = m.preConcatenate(Matrix.getScaleInstance(scale)); width = (int) (scale * width); height = (int) (scale * height); @@ -216,7 +210,7 @@ public class PreviewImage extends JPanel { image.fillTransparent(); if (imgSrc == null) { DrawableTag drawable = (DrawableTag) treeItem; - drawable.toImage(0, 0, null, 0, image, m, new ColorTransform()); + drawable.toImage(0, 0, 0, null, 0, image, m, new ColorTransform()); } else { Graphics2D g = (Graphics2D) image.getGraphics(); g.setTransform(m.toTransform()); diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DefineEditTextTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DefineEditTextTag.java index 0ffc0abca..ce90ac618 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DefineEditTextTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DefineEditTextTag.java @@ -759,7 +759,7 @@ public class DefineEditTextTag extends TextTag { } @Override - public void toImage(int frame, int ratio, DepthState stateUnderCursor, int mouseButton, SerializableImage image, Matrix transformation, ColorTransform colorTransform) { + public void toImage(int frame, int time, int ratio, DepthState stateUnderCursor, int mouseButton, SerializableImage image, Matrix transformation, ColorTransform colorTransform) { if (border) { // border is always black, fill color is always white? RGB borderColor = new RGBA(Color.black); diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DefineMorphShape2Tag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DefineMorphShape2Tag.java index f818a4f51..20b0ebcb8 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DefineMorphShape2Tag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DefineMorphShape2Tag.java @@ -316,7 +316,7 @@ public class DefineMorphShape2Tag extends CharacterTag implements BoundedTag, Mo } @Override - public void toImage(int frame, int ratio, DepthState stateUnderCursor, int mouseButton, SerializableImage image, Matrix transformation, ColorTransform colorTransform) { + public void toImage(int frame, int time, int ratio, DepthState stateUnderCursor, int mouseButton, SerializableImage image, Matrix transformation, ColorTransform colorTransform) { SHAPEWITHSTYLE shape = getShapeAtRatio(ratio); // shapeNum: 4 // todo: Currently the generated image is not cached, because the cache @@ -338,7 +338,7 @@ public class DefineMorphShape2Tag extends CharacterTag implements BoundedTag, Mo } @Override - public Shape getOutline(int frame, int ratio, DepthState stateUnderCursor, int mouseButton, Matrix transformation) { + public Shape getOutline(int frame, int time, int ratio, DepthState stateUnderCursor, int mouseButton, Matrix transformation) { return transformation.toTransform().createTransformedShape(getShapeAtRatio(ratio).getOutline()); } } diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DefineMorphShapeTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DefineMorphShapeTag.java index 4a5893cb1..10ed2a36e 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DefineMorphShapeTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DefineMorphShapeTag.java @@ -299,7 +299,7 @@ public class DefineMorphShapeTag extends CharacterTag implements BoundedTag, Mor } @Override - public void toImage(int frame, int ratio, DepthState stateUnderCursor, int mouseButton, SerializableImage image, Matrix transformation, ColorTransform colorTransform) { + public void toImage(int frame, int time, int ratio, DepthState stateUnderCursor, int mouseButton, SerializableImage image, Matrix transformation, ColorTransform colorTransform) { SHAPEWITHSTYLE shape = getShapeAtRatio(ratio); // shapeNum: 3 // todo: Currently the generated image is not cached, because the cache @@ -321,7 +321,7 @@ public class DefineMorphShapeTag extends CharacterTag implements BoundedTag, Mor } @Override - public Shape getOutline(int frame, int ratio, DepthState stateUnderCursor, int mouseButton, Matrix transformation) { + public Shape getOutline(int frame, int time, int ratio, DepthState stateUnderCursor, int mouseButton, Matrix transformation) { return transformation.toTransform().createTransformedShape(getShapeAtRatio(ratio).getOutline()); } diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DefineSpriteTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DefineSpriteTag.java index 1a97cbaaa..47635985f 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DefineSpriteTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DefineSpriteTag.java @@ -268,8 +268,8 @@ public class DefineSpriteTag extends CharacterTag implements Container, BoundedT } @Override - public void toImage(int frame, int ratio, DepthState stateUnderCursor, int mouseButton, SerializableImage image, Matrix transformation, ColorTransform colorTransform) { - SWF.frameToImage(getTimeline(), frame, stateUnderCursor, mouseButton, image, transformation, colorTransform); + public void toImage(int frame, int time, int ratio, DepthState stateUnderCursor, int mouseButton, SerializableImage image, Matrix transformation, ColorTransform colorTransform) { + SWF.frameToImage(getTimeline(), frame,time, stateUnderCursor, mouseButton, image, transformation, colorTransform); } @Override @@ -283,7 +283,7 @@ public class DefineSpriteTag extends CharacterTag implements Container, BoundedT } @Override - public Shape getOutline(int frame, int ratio, DepthState stateUnderCursor, int mouseButton, Matrix transformation) { - return getTimeline().getOutline(frame, ratio, stateUnderCursor, mouseButton, transformation); + public Shape getOutline(int frame, int time, int ratio, DepthState stateUnderCursor, int mouseButton, Matrix transformation) { + return getTimeline().getOutline(frame,time, ratio, stateUnderCursor, mouseButton, transformation); } } diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DefineText2Tag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DefineText2Tag.java index 86e4a2808..e15c06d4c 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DefineText2Tag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DefineText2Tag.java @@ -488,7 +488,7 @@ public class DefineText2Tag extends TextTag { } @Override - public void toImage(int frame, int ratio, DepthState stateUnderCursor, int mouseButton, SerializableImage image, Matrix transformation, ColorTransform colorTransform) { + public void toImage(int frame, int time, int ratio, DepthState stateUnderCursor, int mouseButton, SerializableImage image, Matrix transformation, ColorTransform colorTransform) { staticTextToImage(swf, textRecords, 2, image, getTextMatrix(), transformation, colorTransform); } diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DefineTextTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DefineTextTag.java index 45c70751b..b9264af58 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DefineTextTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DefineTextTag.java @@ -504,7 +504,7 @@ public class DefineTextTag extends TextTag { } @Override - public void toImage(int frame, int ratio, DepthState stateUnderCursor, int mouseButton, SerializableImage image, Matrix transformation, ColorTransform colorTransform) { + public void toImage(int frame, int time, int ratio, DepthState stateUnderCursor, int mouseButton, SerializableImage image, Matrix transformation, ColorTransform colorTransform) { staticTextToImage(swf, textRecords, 1, image, getTextMatrix(), transformation, colorTransform); } 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 2d1a1659c..2fd249520 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/base/ButtonTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/base/ButtonTag.java @@ -46,13 +46,13 @@ public abstract class ButtonTag extends CharacterTag implements BoundedTag, Draw public abstract boolean trackAsMenu(); @Override - public Shape getOutline(int frame, int ratio, DepthState stateUnderCursor, int mouseButton, Matrix transformation) { - return getTimeline().getOutline(frame, ratio, stateUnderCursor, mouseButton, transformation); + public Shape getOutline(int frame, int time, int ratio, DepthState stateUnderCursor, int mouseButton, Matrix transformation) { + return getTimeline().getOutline(frame, time, ratio, stateUnderCursor, mouseButton, transformation); } @Override - public void toImage(int frame, int ratio, DepthState stateUnderCursor, int mouseButton, SerializableImage image, Matrix transformation, ColorTransform colorTransform) { - SWF.frameToImage(getTimeline(), frame, stateUnderCursor, mouseButton, image, transformation, colorTransform); + public void toImage(int frame, int time, int ratio, DepthState stateUnderCursor, int mouseButton, SerializableImage image, Matrix transformation, ColorTransform colorTransform) { + SWF.frameToImage(getTimeline(), frame, time, stateUnderCursor, mouseButton, image, transformation, colorTransform); } } 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 1e1156f70..fd129b7a1 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/base/DrawableTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/base/DrawableTag.java @@ -29,11 +29,11 @@ import java.awt.Shape; */ public interface DrawableTag { - public void toImage(int frame, int ratio, DepthState stateUnderCursor, int mouseButton, SerializableImage image, Matrix transformation, ColorTransform colorTransform); + public void toImage(int frame, int time, int ratio, DepthState stateUnderCursor, int mouseButton, SerializableImage image, Matrix transformation, ColorTransform colorTransform); public Point getImagePos(int frame); public int getNumFrames(); - public Shape getOutline(int frame, int ratio, DepthState stateUnderCursor, int mouseButton, Matrix transformation); + public Shape getOutline(int frame, int time, int ratio, DepthState stateUnderCursor, int mouseButton, Matrix transformation); } 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 b26b4be80..4b669be6a 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/base/FontTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/base/FontTag.java @@ -257,7 +257,7 @@ public abstract class FontTag extends CharacterTag implements AloneTag, BoundedT } @Override - public void toImage(int frame, int ratio, DepthState stateUnderCursor, int mouseButton, SerializableImage image, Matrix transformation, ColorTransform colorTransform) { + public void toImage(int frame, int time, int ratio, DepthState stateUnderCursor, int mouseButton, SerializableImage image, Matrix transformation, ColorTransform colorTransform) { Graphics2D g = (Graphics2D) image.getGraphics(); g.setComposite(AlphaComposite.SrcOver); g.drawImage(toImage(0, 0, new Matrix(), colorTransform).getBufferedImage(), transformation.toTransform(), null); @@ -274,7 +274,7 @@ public abstract class FontTag extends CharacterTag implements AloneTag, BoundedT } @Override - public Shape getOutline(int frame, int ratio, DepthState stateUnderCursor, int mouseButton, Matrix transformation) { + public Shape getOutline(int frame, int time, int ratio, DepthState stateUnderCursor, int mouseButton, Matrix transformation) { RECT r = getRect(); return new Area(new Rectangle(r.Xmin, r.Ymin, r.getWidth(), r.getHeight())); } diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/base/ShapeTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/base/ShapeTag.java index 8670f5b6d..adec029e3 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/base/ShapeTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/base/ShapeTag.java @@ -42,11 +42,11 @@ public abstract class ShapeTag extends CharacterTag implements BoundedTag, Drawa public abstract int getShapeNum(); @Override - public Shape getOutline(int frame, int ratio, DepthState stateUnderCursor, int mouseButton, Matrix transformation) { + public Shape getOutline(int frame, int time, int ratio, DepthState stateUnderCursor, int mouseButton, Matrix transformation) { return transformation.toTransform().createTransformedShape(getShapes().getOutline()); } - public void toImage(int frame, int ratio, DepthState stateUnderCursor, int mouseButton, SerializableImage image, Matrix transformation, ColorTransform colorTransform) { + public void toImage(int frame, int time, int ratio, DepthState stateUnderCursor, int mouseButton, SerializableImage image, Matrix transformation, ColorTransform colorTransform) { BitmapExporter.exportTo(swf, getShapes(), null, image, transformation, colorTransform); } } diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/base/TextTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/base/TextTag.java index ae9cf91c7..7bcbbda07 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/base/TextTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/base/TextTag.java @@ -302,7 +302,7 @@ public abstract class TextTag extends CharacterTag implements BoundedTag, Drawab } @Override - public Shape getOutline(int frame, int ratio, DepthState stateUnderCursor, int mouseButton, Matrix transformation) { + public Shape getOutline(int frame, int time, int ratio, DepthState stateUnderCursor, int mouseButton, Matrix transformation) { RECT r = getBounds(); return new Rectangle(r.Xmin, r.Ymin, r.getWidth(), r.getHeight()); //TODO: match character shapes } diff --git a/trunk/src/com/jpexs/decompiler/flash/timeline/DepthState.java b/trunk/src/com/jpexs/decompiler/flash/timeline/DepthState.java index d11aed95a..713c3015b 100644 --- a/trunk/src/com/jpexs/decompiler/flash/timeline/DepthState.java +++ b/trunk/src/com/jpexs/decompiler/flash/timeline/DepthState.java @@ -80,11 +80,4 @@ public class DepthState { } } - public void drawTo(SerializableImage img, Point mousePos, int mouseButton) { - CharacterTag c = swf.characters.get(characterId); - if (c instanceof DrawableTag) { - DrawableTag d = (DrawableTag) c; - d.toImage(time, ratio, null, mouseButton, img, new Matrix(matrix), colorTransForm); - } - } } diff --git a/trunk/src/com/jpexs/decompiler/flash/timeline/Timeline.java b/trunk/src/com/jpexs/decompiler/flash/timeline/Timeline.java index 4f23ff014..f499c9aa4 100644 --- a/trunk/src/com/jpexs/decompiler/flash/timeline/Timeline.java +++ b/trunk/src/com/jpexs/decompiler/flash/timeline/Timeline.java @@ -163,8 +163,8 @@ public class Timeline { } } - public void toImage(int frame, int ratio, DepthState stateUnderCursor, int mouseButton, SerializableImage image, Matrix transformation, ColorTransform colorTransform) { - SWF.frameToImage(this, frame, stateUnderCursor, mouseButton, image, transformation, colorTransform); + public void toImage(int frame, int time, int ratio, DepthState stateUnderCursor, int mouseButton, SerializableImage image, Matrix transformation, ColorTransform colorTransform) { + SWF.frameToImage(this, frame, time, stateUnderCursor, mouseButton, image, transformation, colorTransform); } private class Clip { @@ -179,7 +179,7 @@ public class Timeline { } - public List getSounds(int frame, DepthState stateUnderCursor, int mouseButton) { + public List getSounds(int frame,int time, DepthState stateUnderCursor, int mouseButton) { List ret = new ArrayList<>(); Frame fr = this.frames.get(frame); ret.addAll(fr.sounds); @@ -188,7 +188,7 @@ public class Timeline { if (ds != null) { CharacterTag c = swf.characters.get(ds.characterId); if (c instanceof Timelined) { - int dframe = ds.time % ((Timelined) c).getTimeline().frames.size(); + int dframe = (time+ds.time) % ((Timelined) c).getTimeline().frames.size(); if (c instanceof ButtonTag) { ButtonTag bt = (ButtonTag) c; dframe = ButtonTag.FRAME_UP; @@ -200,14 +200,14 @@ public class Timeline { } } } - ret.addAll(((Timelined) c).getTimeline().getSounds(dframe, stateUnderCursor, mouseButton)); + ret.addAll(((Timelined) c).getTimeline().getSounds(dframe,time+ds.time, stateUnderCursor, mouseButton)); } } } return ret; } - public void getObjectsOutlines(int frame, int ratio, DepthState stateUnderCursor, int mouseButton, Matrix transformation, List objs, List outlines) { + public void getObjectsOutlines(int frame, int time, int ratio, DepthState stateUnderCursor, int mouseButton, Matrix transformation, List objs, List outlines) { Frame fr = this.frames.get(frame); Stack clips = new Stack<>(); for (int d = this.getMaxDepth(); d >= 0; d--) { @@ -248,7 +248,7 @@ public class Timeline { } } } - Shape cshape = ((DrawableTag) c).getOutline(dframe, ds.ratio, stateUnderCursor, mouseButton, m); + Shape cshape = ((DrawableTag) c).getOutline(dframe, ds.time+time, ds.ratio, stateUnderCursor, mouseButton, m); Area addArea = new Area(cshape); if (currentClip != null) { @@ -264,13 +264,13 @@ public class Timeline { outlines.add(addArea); } if (c instanceof Timelined) { - ((Timelined) c).getTimeline().getObjectsOutlines(dframe, ds.ratio, stateUnderCursor, mouseButton, m, objs, outlines); + ((Timelined) c).getTimeline().getObjectsOutlines(dframe,time+ds.time,ds.ratio, stateUnderCursor, mouseButton, m, objs, outlines); } } } } - public Shape getOutline(int frame, int ratio, DepthState stateUnderCursor, int mouseButton, Matrix transformation) { + public Shape getOutline(int frame, int time, int ratio, DepthState stateUnderCursor, int mouseButton, Matrix transformation) { Frame fr = this.frames.get(frame); Area area = new Area(); Stack clips = new Stack<>(); @@ -299,7 +299,7 @@ public class Timeline { int dframe = 0; if (c instanceof Timelined) { - dframe = ds.time % ((Timelined) c).getTimeline().frames.size(); + dframe = (time+ds.time) % ((Timelined) c).getTimeline().frames.size(); if (c instanceof ButtonTag) { ButtonTag bt = (ButtonTag) c; dframe = ButtonTag.FRAME_UP; @@ -312,7 +312,7 @@ public class Timeline { } } } - Shape cshape = ((DrawableTag) c).getOutline(dframe, ds.ratio, stateUnderCursor, mouseButton, m); + Shape cshape = ((DrawableTag) c).getOutline(dframe, time+ds.time,ds.ratio, stateUnderCursor, mouseButton, m); Area addArea = new Area(cshape); if (currentClip != null) {