Register images, to fix movies like Swirl of Power

Oh hey, turns out I was missing a step in movie clip stuff! Images aren't just for sprite sheets, but also sometimes they just want the raw images!

Here, we register them, uwu

Items like "Swirl of Power Effect" and probably others work correctly now!

That said, Swirl of Power takes WAY too much CPU lmao, I want to maybe add some kind of automatic kill switch lol
This commit is contained in:
Emi Matchu 2021-06-16 15:49:56 -07:00
parent 617ffd9a38
commit 25376a8fa8

View file

@ -320,9 +320,13 @@ export async function loadMovieLibrary(librarySrc) {
await Promise.all(manifestImages.values()); await Promise.all(manifestImages.values());
// Finally, once we have the images loaded, the library object expects us to // Finally, once we have the images loaded, the library object expects us to
// mutate it (!) to give it the actual sprite sheet objects based on the // mutate it (!) to give it the actual image and sprite sheet objects from
// loaded images. That's how the MovieClip's objects will access the loaded // the loaded images. That's how the MovieClip's internal JS objects will
// versions! // access the loaded data!
const images = composition.getImages();
for (const [id, image] of manifestImages.entries()) {
images[id] = await image;
}
const spriteSheets = composition.getSpriteSheet(); const spriteSheets = composition.getSpriteSheet();
for (const { name, frames } of library.ssMetadata) { for (const { name, frames } of library.ssMetadata) {
const image = await manifestImages.get(name); const image = await manifestImages.get(name);