#1333 Exporting sprites as swf files

This commit is contained in:
2016-12-31 17:06:45 +01:00
parent cf58f71f10
commit b13bd62e5f
21 changed files with 784 additions and 617 deletions
@@ -2173,7 +2173,8 @@ public class AVM2Code implements Cloneable {
ins.operands[j] = updater.updateOperandOffset(target, ins.operands[j]);
}
}*/ //Faster, but not so universal
if (ins.definition instanceof IfTypeIns) {
{
if (ins.definition instanceof IfTypeIns) {
long target = ins.getTargetAddress();
try {
ins.operands[0] = updater.updateOperandOffset(ins.getAddress(), target, ins.operands[0]);
@@ -2181,6 +2182,7 @@ public class AVM2Code implements Cloneable {
throw new ConvertException("Invalid offset (" + ins + ")", i);
}
}
}
ins.setAddress(updater.updateInstructionOffset(ins.getAddress()));
//Note: changing operands here does not change instruction byte length as offsets are always S24 (not variable length)
}
@@ -2605,7 +2607,7 @@ public class AVM2Code implements Cloneable {
return stats;
}
// simplified varions of getStats. This method calculates only the maxlocal value
// simplified version of getStats. This method calculates only the maxlocal value
public CodeStats getMaxLocal() {
CodeStats stats = new CodeStats();
for (AVM2Instruction ins : code) {