Adds a utility to strip out FileAssetContents for given FileAsset types.

Adds a ```File::stripAssets``` utility method that is optionally compiled in. This allows removing in-band asset bytes from the file. It only does this for the provided asset types. Right now we only put image assets in-band, but in the future we may have fonts, scripts, sounds, other .riv files, etc so allowing the utility to only strip specific concrete file types is nice to have.

The next step will be to use this utility to show how you'd create an atlas out of the in-band images, strip out the images, and save a smaller .riv that uses images from that generated atlas.

I envision adding more utility methods like this for tools that want to manipulate Rive content at build/pre-package time. These should be able to be compiled out as they are rarely necessary at mass-consumption runtime (I doubt anyone wants these in WASM unless they're building their game engine, not just the player, in JS).

Diffs=
698af558e Fix linux build.
cb742eb08 Adds a utility to strip out FileAssetContents for given FileAsset types.
This commit is contained in:
luigi-rosso
2022-08-26 23:40:15 +00:00
parent 8df6ba26a7
commit e04e24606b
12 changed files with 122 additions and 9 deletions

View File

@@ -51,7 +51,7 @@ for var in "$@"; do
fi
done
$PREMAKE --file=./premake5_tess.lua gmake2 --graphics=$GRAPHICS
$PREMAKE --file=./premake5_tess.lua gmake2 --graphics=$GRAPHICS --with_rive_tools
for var in "$@"; do
if [[ $var = "clean" ]]; then