mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-07-07 09:48:20 +00:00
Fixed: #2266 StartSound/2 and VideoFrame tags, classNames not taken as dependencies (needed chars)
This commit is contained in:
@@ -373,13 +373,15 @@ public class DefineSpriteTag extends DrawableTag implements Timelined {
|
||||
|
||||
@Override
|
||||
public void getNeededCharacters(Set<Integer> needed, SWF swf) {
|
||||
for (Tag t : getTags()) {
|
||||
if (t instanceof PlaceObjectTypeTag) {
|
||||
int chId = ((PlaceObjectTypeTag) t).getCharacterId();
|
||||
if (chId != -1) {
|
||||
needed.add(chId);
|
||||
}
|
||||
}
|
||||
for (Tag t : getTags()) {
|
||||
if (
|
||||
(t instanceof PlaceObjectTypeTag)
|
||||
|| (t instanceof StartSoundTag)
|
||||
|| (t instanceof StartSound2Tag)
|
||||
|| (t instanceof VideoFrameTag)
|
||||
) {
|
||||
t.getNeededCharacters(needed, swf);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -482,6 +482,12 @@ public class PlaceObject3Tag extends PlaceObjectTypeTag implements ASMSourceCont
|
||||
if (placeFlagHasCharacter) {
|
||||
needed.add(characterId);
|
||||
}
|
||||
if (placeFlagHasClassName) {
|
||||
int chId = swf.getCharacterId(swf.getCharacterByClass(className));
|
||||
if (chId != -1) {
|
||||
needed.add(chId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -503,6 +503,12 @@ public class PlaceObject4Tag extends PlaceObjectTypeTag implements ASMSourceCont
|
||||
if (placeFlagHasCharacter) {
|
||||
needed.add(characterId);
|
||||
}
|
||||
if (placeFlagHasClassName) {
|
||||
int chId = swf.getCharacterId(swf.getCharacterByClass(className));
|
||||
if (chId != -1) {
|
||||
needed.add(chId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -24,6 +24,7 @@ import com.jpexs.decompiler.flash.types.annotations.SWFVersion;
|
||||
import com.jpexs.helpers.ByteArrayRange;
|
||||
import java.io.IOException;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* StartSound2 tag - starts a sound playing. Extends functionality of StartSound
|
||||
@@ -89,4 +90,10 @@ public class StartSound2Tag extends Tag {
|
||||
ret.put("cls", "" + soundClassName);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getNeededCharacters(Set<Integer> needed, SWF swf) {
|
||||
int characterId = swf.getCharacterId(swf.getCharacterByClass(soundClassName));
|
||||
needed.add(characterId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,6 +27,7 @@ import com.jpexs.decompiler.flash.types.annotations.SWFVersion;
|
||||
import com.jpexs.helpers.ByteArrayRange;
|
||||
import java.io.IOException;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* StartSound tag - starts a sound playing.
|
||||
@@ -101,4 +102,9 @@ public class StartSoundTag extends Tag implements CharacterIdTag {
|
||||
ret.put("cid", "" + soundId);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getNeededCharacters(Set<Integer> needed, SWF swf) {
|
||||
needed.add(soundId);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user