mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-04-24 03:29:57 -07:00
More space efficient icon paths list
This commit is contained in:
@@ -159,7 +159,7 @@ void XTREME_ASSETS_LOAD() {
|
||||
|
||||
for(size_t i = 0; i < ICON_PATHS_COUNT; i++) {
|
||||
if(ICON_PATHS[i].icon->original == NULL) {
|
||||
if(ICON_PATHS[i].animated) {
|
||||
if(ICON_PATHS[i].icon->frame_count > 1) {
|
||||
load_icon_animated(ICON_PATHS[i].icon, ICON_PATHS[i].path, p, f);
|
||||
} else {
|
||||
load_icon_static(ICON_PATHS[i].icon, ICON_PATHS[i].path, p, f);
|
||||
|
||||
@@ -182,7 +182,7 @@ class Main(App):
|
||||
icons_c.write("\n")
|
||||
icons.append((icon_name, width, height, frame_rate, frame_count))
|
||||
p = dirpath.removeprefix(self.args.input_directory)[1:]
|
||||
paths.append((1, icon_name, p.replace("\\", "/")))
|
||||
paths.append((icon_name, p.replace("\\", "/")))
|
||||
else:
|
||||
# process icons
|
||||
for filename in filenames:
|
||||
@@ -206,7 +206,7 @@ class Main(App):
|
||||
icons_c.write("\n")
|
||||
icons.append((icon_name, width, height, 0, 1))
|
||||
p = fullfilename.removeprefix(self.args.input_directory)[1:]
|
||||
paths.append((0, icon_name, p.replace("\\", "/").rsplit(".", 1)[0]))
|
||||
paths.append((icon_name, p.replace("\\", "/").rsplit(".", 1)[0]))
|
||||
# Create array of images:
|
||||
self.logger.debug("Finalizing source file")
|
||||
for name, width, height, frame_rate, frame_count in icons:
|
||||
@@ -226,8 +226,8 @@ const IconPath ICON_PATHS[] = {
|
||||
#if !defined(FURI_RAM_EXEC) && !defined(FURI_DEBUG)
|
||||
"""
|
||||
)
|
||||
for animated, name, path in paths:
|
||||
icons_c.write(f' {{{animated}, &{name}, "{path}"}},\n')
|
||||
for name, path in paths:
|
||||
icons_c.write(f' {{&{name}, "{path}"}},\n')
|
||||
icons_c.write(
|
||||
"""#endif
|
||||
};
|
||||
@@ -250,7 +250,6 @@ const size_t ICON_PATHS_COUNT = COUNT_OF(ICON_PATHS);
|
||||
icons_h.write(
|
||||
"""
|
||||
typedef struct {
|
||||
bool animated;
|
||||
const Icon* icon;
|
||||
const char* path;
|
||||
} IconPath;
|
||||
|
||||
Reference in New Issue
Block a user