This commit is contained in:
honfika@gmail.com
2015-04-18 20:45:29 +02:00
parent 5e6d59a5a8
commit fdbffc4a43
11 changed files with 158 additions and 166 deletions

View File

@@ -106,8 +106,8 @@ public class SetPropertyActionItem extends ActionItem implements SetTypeActionIt
@Override
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) throws CompilationException {
ActionSourceGenerator asGenerator = (ActionSourceGenerator) generator;
int tmpReg=asGenerator.getTempRegister(localData);
try{
int tmpReg = asGenerator.getTempRegister(localData);
try {
return toSourceMerge(localData, generator, target, new ActionPush((Long) (long) propertyIndex), value, new ActionStoreRegister(tmpReg), new ActionSetProperty(), new ActionPush(new RegisterNumber(tmpReg)));
} finally {
asGenerator.releaseTempRegister(localData, tmpReg);

View File

@@ -21,12 +21,9 @@ import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.model.DirectValueActionItem;
import com.jpexs.decompiler.flash.action.parser.script.ActionSourceGenerator;
import com.jpexs.decompiler.flash.action.parser.script.VariableActionItem;
import com.jpexs.decompiler.flash.action.swf4.ActionIf;
import com.jpexs.decompiler.flash.action.swf4.ActionJump;
import com.jpexs.decompiler.flash.action.swf4.ActionPop;
import com.jpexs.decompiler.flash.action.swf4.ActionPush;
import com.jpexs.decompiler.flash.action.swf4.ActionSetVariable;
import com.jpexs.decompiler.flash.action.swf4.RegisterNumber;
import com.jpexs.decompiler.flash.action.swf5.ActionEquals2;
import com.jpexs.decompiler.flash.action.swf5.ActionStoreRegister;
@@ -41,7 +38,6 @@ import com.jpexs.decompiler.graph.GraphSourceItem;
import com.jpexs.decompiler.graph.GraphTargetItem;
import com.jpexs.decompiler.graph.Loop;
import com.jpexs.decompiler.graph.SourceGenerator;
import com.jpexs.decompiler.graph.TypeItem;
import com.jpexs.decompiler.graph.model.ContinueItem;
import com.jpexs.decompiler.graph.model.LocalData;
import java.util.ArrayList;
@@ -134,7 +130,7 @@ public class ForInActionItem extends LoopActionItem implements Block {
List<Action> loopExpr = new ArrayList<>();
int exprReg = asGenerator.getTempRegister(localData);
loopExpr.add(new ActionStoreRegister(exprReg));
loopExpr.add(new ActionPush(new Null()));
loopExpr.add(new ActionEquals2());
@@ -142,7 +138,7 @@ public class ForInActionItem extends LoopActionItem implements Block {
loopExpr.add(forInEndIf);
List<Action> loopBody = new ArrayList<>();
loopBody.add(new ActionPush(new RegisterNumber(exprReg)));
loopBody.addAll(asGenerator.toActionList(variableName.toSourceIgnoreReturnValue(localData, generator)));
loopBody.addAll(asGenerator.toActionList(variableName.toSourceIgnoreReturnValue(localData, generator)));
int oldForIn = asGenerator.getForInLevel(localData);
asGenerator.setForInLevel(localData, oldForIn + 1);
loopBody.addAll(asGenerator.toActionList(asGenerator.generate(localData, commands)));

View File

@@ -250,5 +250,4 @@ public class DoInitActionTag extends Tag implements CharacterIdTag, ASMSource {
public void setCharacterId(int characterId) {
this.spriteId = characterId;
}
}

View File

@@ -59,7 +59,7 @@ public class FolderItem implements TreeItem {
if (subItems == null) {
return false;
}
for (TreeItem ti : subItems) {
if (ti.isModified()) {
return true;