mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-04-25 03:29:58 -07:00
Asset Packer: Fix edge cases for animated icons
- FBT allows animated icons with any frame naming scheme - Flipper needs precise naming - This will ensure correct parsing and correct output - If .bm and .png input for packer is mixed, could have issues due to inconsistent naming between input and output (duplicated frames)
This commit is contained in:
@@ -74,6 +74,7 @@ def _packs_emitter(target, source, env):
|
||||
env.Replace(_PACKS_SRC_DIR=source_dir)
|
||||
target = set()
|
||||
|
||||
# Animations
|
||||
target.update(
|
||||
source_dir.rel_path(node)
|
||||
for node in env.GlobRecursive("*/Anims/manifest.txt", source_dir.srcnode())
|
||||
@@ -86,14 +87,33 @@ def _packs_emitter(target, source, env):
|
||||
source_dir.rel_path(node).removesuffix(".png") + ".bm"
|
||||
for node in env.GlobRecursive("*/Anims/**/*.png", source_dir.srcnode())
|
||||
)
|
||||
# Animated icons
|
||||
target.update(
|
||||
source_dir.rel_path(node)
|
||||
for node in env.GlobRecursive("*/Icons/**/*.bmx", source_dir.srcnode())
|
||||
for node in env.GlobRecursive("*/Icons/*/*/meta", source_dir.srcnode())
|
||||
)
|
||||
target.update(
|
||||
source_dir.rel_path(node).removesuffix("frame_rate") + "meta"
|
||||
for node in env.GlobRecursive("*/Icons/*/*/frame_rate", source_dir.srcnode())
|
||||
)
|
||||
target.update(
|
||||
source_dir.rel_path(node)
|
||||
for node in env.GlobRecursive("*/Icons/*/*/*.bm", source_dir.srcnode())
|
||||
)
|
||||
target.update(
|
||||
source_dir.rel_path(node).removesuffix(".png") + ".bm"
|
||||
for node in env.GlobRecursive("*/Icons/*/*/*.png", source_dir.srcnode())
|
||||
)
|
||||
# Static icons
|
||||
target.update(
|
||||
source_dir.rel_path(node)
|
||||
for node in env.GlobRecursive("*/Icons/*/*.bmx", source_dir.srcnode())
|
||||
)
|
||||
target.update(
|
||||
source_dir.rel_path(node).removesuffix(".png") + ".bmx"
|
||||
for node in env.GlobRecursive("*/Icons/**/*.png", source_dir.srcnode())
|
||||
for node in env.GlobRecursive("*/Icons/*/*.png", source_dir.srcnode())
|
||||
)
|
||||
# Fonts
|
||||
target.update(
|
||||
source_dir.rel_path(node)
|
||||
for node in env.GlobRecursive("*/Fonts/*.u8f", source_dir.srcnode())
|
||||
|
||||
Reference in New Issue
Block a user