mirror of
https://github.com/FunkinCrew/Funkin.git
synced 2024-11-26 17:46:08 -05:00
async the LoadingState asset preloads
This commit is contained in:
parent
450a232eb8
commit
64b416e956
1 changed files with 13 additions and 8 deletions
|
@ -326,8 +326,8 @@ class LoadingState extends MusicBeatSubState
|
||||||
// I will fix this properly later I swear -eric
|
// I will fix this properly later I swear -eric
|
||||||
if (!path.endsWith('.png')) continue;
|
if (!path.endsWith('.png')) continue;
|
||||||
|
|
||||||
|
new Future<String>(function() {
|
||||||
FunkinSprite.cacheTexture(path);
|
FunkinSprite.cacheTexture(path);
|
||||||
|
|
||||||
// Another dumb hack: FlxAnimate fetches from OpenFL's BitmapData cache directly and skips the FlxGraphic cache.
|
// 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.
|
// Since FlxGraphic tells OpenFL to not cache it, we have to do it manually.
|
||||||
if (path.endsWith('spritemap1.png'))
|
if (path.endsWith('spritemap1.png'))
|
||||||
|
@ -335,6 +335,11 @@ class LoadingState extends MusicBeatSubState
|
||||||
trace('Preloading FlxAnimate asset: ${path}');
|
trace('Preloading FlxAnimate asset: ${path}');
|
||||||
openfl.Assets.getBitmapData(path, true);
|
openfl.Assets.getBitmapData(path, true);
|
||||||
}
|
}
|
||||||
|
return 'Done precaching ${path}';
|
||||||
|
}, true);
|
||||||
|
|
||||||
|
trace("Queued ${path} for precaching");
|
||||||
|
// FunkinSprite.cacheTexture(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
// FunkinSprite.cacheAllNoteStyleTextures(noteStyle) // This will replace the stuff above!
|
// FunkinSprite.cacheAllNoteStyleTextures(noteStyle) // This will replace the stuff above!
|
||||||
|
|
Loading…
Reference in a new issue