diff --git a/source/funkin/backend/system/GraphicCacheSprite.hx b/source/funkin/backend/system/GraphicCacheSprite.hx index 78419ed3..4f0fe98f 100644 --- a/source/funkin/backend/system/GraphicCacheSprite.hx +++ b/source/funkin/backend/system/GraphicCacheSprite.hx @@ -29,15 +29,17 @@ class GraphicCacheSprite extends FlxSprite { if (graphic != null) { // make their useCount one time higher to prevent them from auto being cleared from cache graphic.useCount++; + graphic.destroyOnNoUse = false; cachedGraphics.push(graphic); nonRenderedCachedGraphics.push(graphic); } } public override function destroy() { - for(g in cachedGraphics) - // make their usecount 1 time lower so that it can be cleared again + for(g in cachedGraphics) { + g.destroyOnNoUse = true; g.useCount--; + } graphic = null; super.destroy(); } diff --git a/source/funkin/game/PlayState.hx b/source/funkin/game/PlayState.hx index c14a2f7a..1724ae38 100644 --- a/source/funkin/game/PlayState.hx +++ b/source/funkin/game/PlayState.hx @@ -570,7 +570,7 @@ class PlayState extends MusicBeatState // PRECACHING #if REGION for(content in Paths.getFolderContent('images/game/score/', true, true)) - graphicCache.cache(content); + graphicCache.cache(Paths.getPath(content)); for(i in 1...4) { FlxG.sound.load(Paths.sound('missnote' + Std.string(i)));