mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-07-06 01:08:07 +00:00
show frame number during play
FlashPlayer - show controls for DefineSprite display Goto frame on click
This commit is contained in:
@@ -288,4 +288,22 @@ public final class Matrix implements Cloneable {
|
||||
public double getTotalScaleY() {
|
||||
return Math.sqrt(rotateSkew1 * rotateSkew1 + scaleY * scaleY);
|
||||
}
|
||||
|
||||
private int fromFloat(double f){
|
||||
return (int)(f * (1 << 16));
|
||||
}
|
||||
|
||||
public MATRIX toMATRIX(){
|
||||
MATRIX result = new MATRIX();
|
||||
|
||||
result.translateX = (int)translateX;
|
||||
result.translateY = (int)translateY;
|
||||
result.hasRotate = true;
|
||||
result.hasScale = true;
|
||||
result.scaleX = fromFloat(scaleX);
|
||||
result.scaleY = fromFloat(scaleY);
|
||||
result.rotateSkew0 = fromFloat(rotateSkew0);
|
||||
result.rotateSkew1 = fromFloat(rotateSkew1);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -409,4 +409,15 @@ public class PlaceObject2Tag extends CharacterIdTag implements Container, PlaceO
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeTagWithMatrix(SWFOutputStream sos, MATRIX m) throws IOException {
|
||||
MATRIX old=matrix;
|
||||
matrix = m;
|
||||
boolean mod=isModified();
|
||||
setModified(true);
|
||||
super.writeTag(sos);
|
||||
setModified(mod);
|
||||
matrix = old;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -538,4 +538,15 @@ public class PlaceObject3Tag extends CharacterIdTag implements Container, PlaceO
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeTagWithMatrix(SWFOutputStream sos, MATRIX m) throws IOException {
|
||||
MATRIX old=matrix;
|
||||
matrix = m;
|
||||
boolean mod=isModified();
|
||||
setModified(true);
|
||||
super.writeTag(sos);
|
||||
setModified(mod);
|
||||
matrix = old;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -541,4 +541,15 @@ public class PlaceObject4Tag extends CharacterIdTag implements Container, PlaceO
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeTagWithMatrix(SWFOutputStream sos, MATRIX m) throws IOException {
|
||||
MATRIX old=matrix;
|
||||
matrix = m;
|
||||
boolean mod=isModified();
|
||||
setModified(true);
|
||||
super.writeTag(sos);
|
||||
setModified(mod);
|
||||
matrix = old;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -218,4 +218,17 @@ public class PlaceObjectTag extends CharacterIdTag implements PlaceObjectTypeTag
|
||||
public CLIPACTIONS getClipActions() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeTagWithMatrix(SWFOutputStream sos, MATRIX m) throws IOException {
|
||||
MATRIX old=matrix;
|
||||
matrix = m;
|
||||
boolean mod=isModified();
|
||||
setModified(true);
|
||||
super.writeTag(sos);
|
||||
setModified(mod);
|
||||
matrix = old;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -12,14 +12,17 @@
|
||||
* 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.SWFOutputStream;
|
||||
import com.jpexs.decompiler.flash.types.CLIPACTIONS;
|
||||
import com.jpexs.decompiler.flash.types.ColorTransform;
|
||||
import com.jpexs.decompiler.flash.types.MATRIX;
|
||||
import com.jpexs.decompiler.flash.types.RGBA;
|
||||
import com.jpexs.decompiler.flash.types.filters.FILTER;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -61,4 +64,6 @@ public interface PlaceObjectTypeTag {
|
||||
public int getRatio();
|
||||
|
||||
public CLIPACTIONS getClipActions();
|
||||
|
||||
public void writeTagWithMatrix(SWFOutputStream sos,MATRIX m) throws IOException;
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
*/
|
||||
package com.jpexs.decompiler.flash.types;
|
||||
|
||||
import com.jpexs.decompiler.flash.exporters.commonshape.Matrix;
|
||||
import com.jpexs.decompiler.flash.types.annotations.Calculated;
|
||||
import com.jpexs.decompiler.flash.types.annotations.Conditional;
|
||||
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
||||
@@ -107,6 +108,8 @@ public class MATRIX implements Serializable {
|
||||
return "[MATRIX scale:" + getScaleXFloat() + "," + getScaleYFloat() + ", rotate:" + getRotateSkew0Float() + "," + getRotateSkew1Float() + ", translate:" + translateX + "," + translateY + "]";
|
||||
}
|
||||
|
||||
|
||||
|
||||
private float toFloat(int i) {
|
||||
return ((float) i) / (1 << 16);
|
||||
}
|
||||
@@ -160,21 +163,7 @@ public class MATRIX implements Serializable {
|
||||
public int getScaleY() {
|
||||
return (hasScale ? (scaleY) : (1 << 16));
|
||||
}
|
||||
|
||||
public MATRIX merge(MATRIX m) {
|
||||
MATRIX ret = new MATRIX();
|
||||
ret.translateX = m.translateX + this.translateX;
|
||||
ret.translateY = m.translateY + this.translateY;
|
||||
|
||||
ret.scaleX = (m.hasScale ? m.scaleX : 1) * (this.hasScale ? this.scaleX : 1);
|
||||
ret.scaleY = (m.hasScale ? m.scaleY : 1) * (this.hasScale ? this.scaleY : 1);
|
||||
ret.rotateSkew0 = m.rotateSkew0 + this.rotateSkew0;
|
||||
ret.rotateSkew1 = m.rotateSkew1 + this.rotateSkew1;
|
||||
ret.hasScale = true;
|
||||
ret.hasRotate = true;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
public boolean isEmpty() {
|
||||
return (translateX == 0) && (translateY == 0) && (!hasRotate) && (!hasScale);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user