various small fixes

This commit is contained in:
honfika@gmail.com
2015-04-25 20:21:10 +02:00
parent 2900dd90e0
commit e700f91bf7
8 changed files with 59 additions and 28 deletions

View File

@@ -194,7 +194,7 @@ public final class SWF implements SWFContainerItem, Timelined {
public List<Tag> tags = new ArrayList<>();
@Internal
public boolean hasEndTag;
public boolean hasEndTag = true;
/**
* ExportRectangle for the display

View File

@@ -313,18 +313,6 @@ public class DefineSpriteTag extends CharacterTag implements DrawableTag, Timeli
return getTimeline().getFrameCount(); // frameCount
}
private int getRealFrameCount() {
int cnt = 1;
Timeline timeline = getTimeline();
for (int i = 1; i < timeline.getFrameCount(); i++) {
if (timeline.getFrame(i).layersChanged) {
cnt++;
}
}
return cnt;
}
@Override
public boolean isSingleFrame() {
if (!isSingleFrameInitialized) {
@@ -335,7 +323,7 @@ public class DefineSpriteTag extends CharacterTag implements DrawableTag, Timeli
private synchronized void initialiteIsSingleFrame() {
if (!isSingleFrameInitialized) {
if (getRealFrameCount() > 1) {
if (getTimeline().getRealFrameCount() > 1) {
isSingleFrameInitialized = true;
return;
}

View File

@@ -159,6 +159,19 @@ public class Timeline {
return frames.size();
}
public int getRealFrameCount() {
ensureInitialized();
int cnt = 1;
for (int i = 1; i < frames.size(); i++) {
if (frames.get(i).layersChanged) {
cnt++;
}
}
return cnt;
}
public int getFrameForAction(ASMSource asm) {
Integer frame = actionFrames.get(asm);
if (frame == null) {