mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-06-23 11:05:32 +00:00
Layer,FrameInfo => TimeLine
(speedup?)
This commit is contained in:
@@ -36,9 +36,11 @@ import java.awt.Graphics2D;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Stack;
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import javax.swing.ImageIcon;
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JColorChooser;
|
||||
@@ -61,7 +63,7 @@ public final class ImagePanel extends JPanel implements ActionListener, FlashDis
|
||||
private SWF swf;
|
||||
private HashMap<Integer, CharacterTag> characters;
|
||||
private boolean loaded;
|
||||
|
||||
|
||||
@Override
|
||||
public void setBackground(Color bg) {
|
||||
if (label != null) {
|
||||
@@ -162,7 +164,7 @@ public final class ImagePanel extends JPanel implements ActionListener, FlashDis
|
||||
setImage(img);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
play();
|
||||
}
|
||||
|
||||
@@ -212,19 +214,16 @@ public final class ImagePanel extends JPanel implements ActionListener, FlashDis
|
||||
}
|
||||
}
|
||||
|
||||
private void drawFrame() {
|
||||
if (drawable == null) {
|
||||
return;
|
||||
}
|
||||
Matrix mat = new Matrix();
|
||||
mat.translateX = swf.displayRect.Xmin;
|
||||
mat.translateY = swf.displayRect.Ymin;
|
||||
private static SerializableImage getFrame(SWF swf,int frame,DrawableTag drawable,Map<Integer,CharacterTag> characters){
|
||||
String key = "drawable_" + frame + "_" + drawable.hashCode();
|
||||
SerializableImage img = SWF.getFromCache(key);
|
||||
if (img == null) {
|
||||
if (drawable instanceof BoundedTag) {
|
||||
BoundedTag bounded = (BoundedTag) drawable;
|
||||
RECT rect = bounded.getRect(characters, new Stack<Integer>());
|
||||
if(rect == null){ //??? Why?
|
||||
rect = new RECT(0,0,1,1);
|
||||
}
|
||||
SerializableImage image = new SerializableImage((int) (rect.getWidth() / SWF.unitDivisor) + 1,
|
||||
(int) (rect.getHeight() / SWF.unitDivisor) + 1, SerializableImage.TYPE_INT_ARGB);
|
||||
//Make all pixels transparent
|
||||
@@ -243,7 +242,17 @@ public final class ImagePanel extends JPanel implements ActionListener, FlashDis
|
||||
}
|
||||
SWF.putToCache(key, img);
|
||||
}
|
||||
ImageIcon icon = new ImageIcon(img.getBufferedImage());
|
||||
return img;
|
||||
}
|
||||
|
||||
private void drawFrame() {
|
||||
if (drawable == null) {
|
||||
return;
|
||||
}
|
||||
Matrix mat = new Matrix();
|
||||
mat.translateX = swf.displayRect.Xmin;
|
||||
mat.translateY = swf.displayRect.Ymin;
|
||||
ImageIcon icon = new ImageIcon(getFrame(swf,frame,drawable,characters).getBufferedImage());
|
||||
label.setIcon(icon);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user