mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-05-28 18:45:33 +00:00
cache display object as it is written in SWF documentation (placeobject cache flag or has filters)
This commit is contained in:
@@ -328,6 +328,9 @@ public final class SWF implements SWFContainerItem, Timelined {
|
||||
@Internal
|
||||
private final Cache<String, SerializableImage> frameCache = Cache.getInstance(false, false, "frame");
|
||||
|
||||
@Internal
|
||||
private final Cache<PlaceObjectTypeTag, SerializableImage> displayObjectCache = Cache.getInstance(false, false, "displayObject");
|
||||
|
||||
@Internal
|
||||
private final Cache<CharacterTag, RECT> rectCache = Cache.getInstance(true, true, "rect");
|
||||
|
||||
@@ -399,6 +402,7 @@ public final class SWF implements SWFContainerItem, Timelined {
|
||||
as2Cache.clear();
|
||||
as3Cache.clear();
|
||||
frameCache.clear();
|
||||
displayObjectCache.clear();
|
||||
soundCache.clear();
|
||||
|
||||
timeline = null;
|
||||
@@ -2483,6 +2487,13 @@ public final class SWF implements SWFContainerItem, Timelined {
|
||||
return null;
|
||||
}
|
||||
|
||||
public SerializableImage getFromCache(PlaceObjectTypeTag key) {
|
||||
if (displayObjectCache.contains(key)) {
|
||||
return displayObjectCache.get(key);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public byte[] getFromCache(SoundTag soundTag) {
|
||||
if (soundCache.contains(soundTag)) {
|
||||
return soundCache.get(soundTag);
|
||||
@@ -2496,12 +2507,17 @@ public final class SWF implements SWFContainerItem, Timelined {
|
||||
}
|
||||
}
|
||||
|
||||
public void putToCache(PlaceObjectTypeTag key, SerializableImage img) {
|
||||
displayObjectCache.put(key, img);
|
||||
}
|
||||
|
||||
public void putToCache(SoundTag soundTag, byte[] data) {
|
||||
soundCache.put(soundTag, data);
|
||||
}
|
||||
|
||||
public void clearImageCache() {
|
||||
frameCache.clear();
|
||||
displayObjectCache.clear();
|
||||
rectCache.clear();
|
||||
for (Tag tag : getTags()) {
|
||||
if (tag instanceof ImageTag) {
|
||||
|
||||
Reference in New Issue
Block a user