From 25376a8fa8e94e9f333cdae9d2359cf8558f85a0 Mon Sep 17 00:00:00 2001 From: Matchu Date: Wed, 16 Jun 2021 15:49:56 -0700 Subject: [PATCH] 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 --- src/app/components/OutfitMovieLayer.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/app/components/OutfitMovieLayer.js b/src/app/components/OutfitMovieLayer.js index 30482ea..03f351d 100644 --- a/src/app/components/OutfitMovieLayer.js +++ b/src/app/components/OutfitMovieLayer.js @@ -320,9 +320,13 @@ export async function loadMovieLibrary(librarySrc) { await Promise.all(manifestImages.values()); // 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 - // loaded images. That's how the MovieClip's objects will access the loaded - // versions! + // mutate it (!) to give it the actual image and sprite sheet objects from + // the loaded images. That's how the MovieClip's internal JS objects will + // access the loaded data! + const images = composition.getImages(); + for (const [id, image] of manifestImages.entries()) { + images[id] = await image; + } const spriteSheets = composition.getSpriteSheet(); for (const { name, frames } of library.ssMetadata) { const image = await manifestImages.get(name);