diff --git a/hyperlap2d-runtime-libgdx b/hyperlap2d-runtime-libgdx index 758c37a1..d2978bf2 160000 --- a/hyperlap2d-runtime-libgdx +++ b/hyperlap2d-runtime-libgdx @@ -1 +1 @@ -Subproject commit 758c37a1798419646a6dc1004c59f22f9a1d4c16 +Subproject commit d2978bf212e9d19472585d9eccc29599a003c1c5 diff --git a/src/main/java/games/rednblack/editor/proxy/ResourceManager.java b/src/main/java/games/rednblack/editor/proxy/ResourceManager.java index 42a3e68e..386a9ec5 100644 --- a/src/main/java/games/rednblack/editor/proxy/ResourceManager.java +++ b/src/main/java/games/rednblack/editor/proxy/ResourceManager.java @@ -52,7 +52,7 @@ public class ResourceManager extends Proxy implements IResourceRetriever { private static final String TAG = ResourceManager.class.getCanonicalName(); public static final String NAME = TAG; - private final HashMap particleEffects = new HashMap<>(1); + private final HashMap particleEffects = new HashMap<>(1); private final HashMap talosVFXs = new HashMap<>(1); private HashMap currentProjectAtlas = new HashMap<>(1); @@ -152,7 +152,7 @@ public class ResourceManager extends Proxy implements IResourceRetriever { @Override public ParticleEffect getParticleEffect(String name) { - return new ParticleEffect(particleEffects.get(name)); + return particleEffects.get(name).obtain(); } /** @@ -245,7 +245,8 @@ public class ResourceManager extends Proxy implements IResourceRetriever { break; } catch (Exception ignore) { } } - particleEffects.put(filename, particleEffect); + ParticleEffectPool effectPool = new ParticleEffectPool(particleEffect, 1, games.rednblack.editor.renderer.resources.ResourceManager.PARTICLE_POOL_SIZE); + particleEffects.put(filename, effectPool); } } @@ -505,7 +506,7 @@ public class ResourceManager extends Proxy implements IResourceRetriever { return spriteAnimAtlases; } - public HashMap getProjectParticleList() { + public HashMap getProjectParticleList() { return particleEffects; }