From 450a232eb8f10fbeea213415abe451b6aa65ae71 Mon Sep 17 00:00:00 2001 From: Cameron Taylor Date: Mon, 29 Apr 2024 01:39:19 -0400 Subject: [PATCH 1/2] hxcodec version commit bump --- hmm.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hmm.json b/hmm.json index c53a1143b..300f0287f 100644 --- a/hmm.json +++ b/hmm.json @@ -80,7 +80,7 @@ "name": "hxCodec", "type": "git", "dir": null, - "ref": "387e1665d6feb5762358134f168e6ebfe46acec8", + "ref": "c0c7f2680cc190c932a549c2e2fdd9b0ba2bd10e", "url": "https://github.com/FunkinCrew/hxCodec" }, { @@ -171,4 +171,4 @@ "url": "https://github.com/FunkinCrew/thx.semver" } ] -} \ No newline at end of file +} From 64b416e956db55a6c334e6a59a6d259821096736 Mon Sep 17 00:00:00 2001 From: Cameron Taylor Date: Mon, 29 Apr 2024 02:31:40 -0400 Subject: [PATCH 2/2] async the LoadingState asset preloads --- source/funkin/ui/transition/LoadingState.hx | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/source/funkin/ui/transition/LoadingState.hx b/source/funkin/ui/transition/LoadingState.hx index 3b53e1b4a..28533e35b 100644 --- a/source/funkin/ui/transition/LoadingState.hx +++ b/source/funkin/ui/transition/LoadingState.hx @@ -326,15 +326,20 @@ class LoadingState extends MusicBeatSubState // I will fix this properly later I swear -eric if (!path.endsWith('.png')) continue; - FunkinSprite.cacheTexture(path); + new Future(function() { + FunkinSprite.cacheTexture(path); + // Another dumb hack: FlxAnimate fetches from OpenFL's BitmapData cache directly and skips the FlxGraphic cache. + // Since FlxGraphic tells OpenFL to not cache it, we have to do it manually. + if (path.endsWith('spritemap1.png')) + { + trace('Preloading FlxAnimate asset: ${path}'); + openfl.Assets.getBitmapData(path, true); + } + return 'Done precaching ${path}'; + }, true); - // Another dumb hack: FlxAnimate fetches from OpenFL's BitmapData cache directly and skips the FlxGraphic cache. - // Since FlxGraphic tells OpenFL to not cache it, we have to do it manually. - if (path.endsWith('spritemap1.png')) - { - trace('Preloading FlxAnimate asset: ${path}'); - openfl.Assets.getBitmapData(path, true); - } + trace("Queued ${path} for precaching"); + // FunkinSprite.cacheTexture(path); } // FunkinSprite.cacheAllNoteStyleTextures(noteStyle) // This will replace the stuff above!