mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-09-26 18:50:50 +00:00
fix displayobject cache (for example clear then zoom changed)
This commit is contained in:
@@ -328,9 +328,6 @@ 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");
|
||||
|
||||
@@ -402,7 +399,6 @@ public final class SWF implements SWFContainerItem, Timelined {
|
||||
as2Cache.clear();
|
||||
as3Cache.clear();
|
||||
frameCache.clear();
|
||||
displayObjectCache.clear();
|
||||
soundCache.clear();
|
||||
|
||||
timeline = null;
|
||||
@@ -2487,13 +2483,6 @@ 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);
|
||||
@@ -2507,17 +2496,12 @@ 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) {
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
package com.jpexs.decompiler.flash.tags.base;
|
||||
|
||||
import com.jpexs.decompiler.flash.timeline.DepthState;
|
||||
import com.jpexs.helpers.Cache;
|
||||
import com.jpexs.helpers.SerializableImage;
|
||||
import java.awt.Point;
|
||||
import java.util.List;
|
||||
@@ -36,4 +37,6 @@ public class RenderContext {
|
||||
public ButtonTag mouseOverButton;
|
||||
|
||||
public SerializableImage borderImage;
|
||||
|
||||
public Cache<PlaceObjectTypeTag, SerializableImage> displayObjectCache;
|
||||
}
|
||||
|
||||
@@ -623,8 +623,8 @@ public class Timeline {
|
||||
g.setComposite(AlphaComposite.Dst);*/
|
||||
|
||||
SerializableImage img = null;
|
||||
if (cacheAsBitmap) {
|
||||
img = swf.getFromCache(layer.placeObjectTag);
|
||||
if (cacheAsBitmap && renderContext.displayObjectCache != null) {
|
||||
img = renderContext.displayObjectCache.get(layer.placeObjectTag);
|
||||
}
|
||||
|
||||
int stateCount = renderContext.stateUnderCursor == null ? 0 : renderContext.stateUnderCursor.size();
|
||||
@@ -704,8 +704,8 @@ public class Timeline {
|
||||
}
|
||||
}
|
||||
|
||||
if (cacheAsBitmap) {
|
||||
swf.putToCache(layer.placeObjectTag, img);
|
||||
if (cacheAsBitmap && renderContext.displayObjectCache != null) {
|
||||
renderContext.displayObjectCache.put(layer.placeObjectTag, img);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user