mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-07-13 05:18:45 +00:00
drawabletag is always a character tag => drawabletag changed to abstract class which implements charactertag
This commit is contained in:
@@ -56,7 +56,7 @@ import java.util.Set;
|
||||
* @author JPEXS
|
||||
*/
|
||||
@SWFVersion(from = 3)
|
||||
public class DefineSpriteTag extends CharacterTag implements DrawableTag, Timelined {
|
||||
public class DefineSpriteTag extends DrawableTag implements Timelined {
|
||||
|
||||
public static final int ID = 39;
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ import java.util.Set;
|
||||
*
|
||||
* @author JPEXS
|
||||
*/
|
||||
public abstract class ButtonTag extends CharacterTag implements DrawableTag, Timelined {
|
||||
public abstract class ButtonTag extends DrawableTag implements Timelined {
|
||||
|
||||
public static int FRAME_UP = 0;
|
||||
|
||||
|
||||
@@ -16,9 +16,11 @@
|
||||
*/
|
||||
package com.jpexs.decompiler.flash.tags.base;
|
||||
|
||||
import com.jpexs.decompiler.flash.SWF;
|
||||
import com.jpexs.decompiler.flash.exporters.commonshape.Matrix;
|
||||
import com.jpexs.decompiler.flash.exporters.commonshape.SVGExporter;
|
||||
import com.jpexs.decompiler.flash.types.ColorTransform;
|
||||
import com.jpexs.helpers.ByteArrayRange;
|
||||
import com.jpexs.helpers.SerializableImage;
|
||||
import java.awt.Shape;
|
||||
import java.io.IOException;
|
||||
@@ -27,7 +29,7 @@ import java.io.IOException;
|
||||
*
|
||||
* @author JPEXS
|
||||
*/
|
||||
public interface DrawableTag extends BoundedTag {
|
||||
public abstract class DrawableTag extends CharacterTag implements BoundedTag {
|
||||
|
||||
public static final int PARAMETER_FRAME = 1;
|
||||
|
||||
@@ -35,17 +37,21 @@ public interface DrawableTag extends BoundedTag {
|
||||
|
||||
public static final int PARAMETER_RATIO = 4;
|
||||
|
||||
public int getUsedParameters();
|
||||
public DrawableTag(SWF swf, int id, String name, ByteArrayRange data) {
|
||||
super(swf, id, name, data);
|
||||
}
|
||||
|
||||
public Shape getOutline(int frame, int time, int ratio, RenderContext renderContext, Matrix transformation, boolean stroked);
|
||||
public abstract int getUsedParameters();
|
||||
|
||||
public void toImage(int frame, int time, int ratio, RenderContext renderContext, SerializableImage image, boolean isClip, Matrix transformation, Matrix prevTransformation, Matrix absoluteTransformation, ColorTransform colorTransform);
|
||||
public abstract Shape getOutline(int frame, int time, int ratio, RenderContext renderContext, Matrix transformation, boolean stroked);
|
||||
|
||||
public void toSVG(SVGExporter exporter, int ratio, ColorTransform colorTransform, int level) throws IOException;
|
||||
public abstract void toImage(int frame, int time, int ratio, RenderContext renderContext, SerializableImage image, boolean isClip, Matrix transformation, Matrix prevTransformation, Matrix absoluteTransformation, ColorTransform colorTransform);
|
||||
|
||||
public void toHtmlCanvas(StringBuilder result, double unitDivisor);
|
||||
public abstract void toSVG(SVGExporter exporter, int ratio, ColorTransform colorTransform, int level) throws IOException;
|
||||
|
||||
public int getNumFrames();
|
||||
public abstract void toHtmlCanvas(StringBuilder result, double unitDivisor);
|
||||
|
||||
public boolean isSingleFrame();
|
||||
public abstract int getNumFrames();
|
||||
|
||||
public abstract boolean isSingleFrame();
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ import java.util.Set;
|
||||
*
|
||||
* @author JPEXS
|
||||
*/
|
||||
public abstract class FontTag extends CharacterTag implements AloneTag, DrawableTag {
|
||||
public abstract class FontTag extends DrawableTag implements AloneTag {
|
||||
|
||||
public static final int PREVIEWSIZE = 500;
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ import java.util.Set;
|
||||
*
|
||||
* @author JPEXS
|
||||
*/
|
||||
public abstract class ImageTag extends CharacterTag implements DrawableTag {
|
||||
public abstract class ImageTag extends DrawableTag {
|
||||
|
||||
@SWFType(BasicType.UI16)
|
||||
public int characterID;
|
||||
|
||||
@@ -50,7 +50,7 @@ import java.util.Set;
|
||||
*
|
||||
* @author JPEXS
|
||||
*/
|
||||
public abstract class MorphShapeTag extends CharacterTag implements DrawableTag {
|
||||
public abstract class MorphShapeTag extends DrawableTag {
|
||||
|
||||
public static final int MAX_RATIO = 65535;
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ import java.util.logging.Logger;
|
||||
*
|
||||
* @author JPEXS
|
||||
*/
|
||||
public abstract class ShapeTag extends CharacterTag implements DrawableTag, LazyObject {
|
||||
public abstract class ShapeTag extends DrawableTag implements LazyObject {
|
||||
|
||||
@SWFType(BasicType.UI16)
|
||||
public int shapeId;
|
||||
|
||||
@@ -74,7 +74,7 @@ import org.w3c.dom.Element;
|
||||
*
|
||||
* @author JPEXS
|
||||
*/
|
||||
public abstract class TextTag extends CharacterTag implements DrawableTag {
|
||||
public abstract class TextTag extends DrawableTag {
|
||||
|
||||
public TextTag(SWF swf, int id, String name, ByteArrayRange data) {
|
||||
super(swf, id, name, data);
|
||||
|
||||
@@ -119,6 +119,11 @@ public class DepthState {
|
||||
}
|
||||
}
|
||||
|
||||
public boolean cacheAsBitmap() {
|
||||
return (placeObjectTag != null && placeObjectTag.cacheAsBitmap())
|
||||
|| (filters != null && filters.size() > 0);
|
||||
}
|
||||
|
||||
public PlaceObjectTypeTag toPlaceObjectTag(int depth) {
|
||||
if (minPlaceObjectNum <= 1) {
|
||||
CXFORM cxForm0 = colorTransForm == null ? null : new CXFORM(colorTransForm);
|
||||
|
||||
@@ -606,6 +606,22 @@ public class Timeline {
|
||||
Matrix mat = transformation.concatenate(layerMatrix);
|
||||
rect = mat.transform(rect);
|
||||
|
||||
boolean cacheAsBitmap = layer.cacheAsBitmap() && drawable.isSingleFrame();
|
||||
/* // draw bounds
|
||||
AffineTransform trans = mat.preConcatenate(Matrix.getScaleInstance(1 / SWF.unitDivisor)).toTransform();
|
||||
g.setTransform(trans);
|
||||
BoundedTag b = (BoundedTag) drawable;
|
||||
g.setPaint(new Color(255, 255, 255, 128));
|
||||
g.setComposite(BlendComposite.Invert);
|
||||
g.setStroke(new BasicStroke((int) SWF.unitDivisor));
|
||||
RECT r = b.getRect();
|
||||
g.setFont(g.getFont().deriveFont((float) (12 * SWF.unitDivisor)));
|
||||
g.drawString(drawable.toString(), r.Xmin + (int) (3 * SWF.unitDivisor), r.Ymin + (int) (15 * SWF.unitDivisor));
|
||||
g.draw(new Rectangle(r.Xmin, r.Ymin, r.getWidth(), r.getHeight()));
|
||||
g.drawLine(r.Xmin, r.Ymin, r.Xmax, r.Ymax);
|
||||
g.drawLine(r.Xmax, r.Ymin, r.Xmin, r.Ymax);
|
||||
g.setComposite(AlphaComposite.Dst);*/
|
||||
|
||||
if (filters != null && filters.size() > 0) {
|
||||
// calculate size after applying the filters
|
||||
double deltaXMax = 0;
|
||||
|
||||
Reference in New Issue
Block a user