This can just be made global at this point lol

This commit is contained in:
Willy-JL
2023-10-26 04:03:42 +01:00
parent f474e8c7ca
commit 28bcc09d9b
64 changed files with 249 additions and 286 deletions

View File

@@ -148,7 +148,7 @@ void animation_manager_check_blocking_process(AnimationManager* animation_manage
const StorageAnimationManifestInfo* manifest_info =
animation_storage_get_meta(animation_manager->current_animation);
bool valid = animation_manager_is_valid_idle_animation(
manifest_info, &stats, XTREME_SETTINGS()->unlock_anims);
manifest_info, &stats, xtreme_settings.unlock_anims);
if(!valid) {
animation_manager_start_new_idle(animation_manager);
@@ -203,9 +203,8 @@ static void animation_manager_start_new_idle(AnimationManager* animation_manager
const BubbleAnimation* bubble_animation =
animation_storage_get_bubble_animation(animation_manager->current_animation);
animation_manager->state = AnimationManagerStateIdle;
XtremeSettings* xtreme_settings = XTREME_SETTINGS();
int32_t duration = (xtreme_settings->cycle_anims == 0) ? (bubble_animation->duration) :
(xtreme_settings->cycle_anims);
int32_t duration = (xtreme_settings.cycle_anims == 0) ? (bubble_animation->duration) :
(xtreme_settings.cycle_anims);
furi_timer_start(
animation_manager->idle_animation_timer, (duration > 0) ? (duration * 1000) : 0);
}
@@ -389,14 +388,14 @@ static StorageAnimation*
furi_record_close(RECORD_DOLPHIN);
uint32_t whole_weight = 0;
bool fallback = XTREME_SETTINGS()->fallback_anim;
bool fallback = xtreme_settings.fallback_anim;
if(StorageAnimationList_size(animation_list) == dolphin_internal_size + 1 && !fallback) {
// One ext anim and fallback disabled, dont skip current anim (current = only ext one)
avoid_animation = NULL;
}
StorageAnimationList_it_t it;
bool unlock = XTREME_SETTINGS()->unlock_anims;
bool unlock = xtreme_settings.unlock_anims;
for(StorageAnimationList_it(it, animation_list); !StorageAnimationList_end_p(it);) {
StorageAnimation* storage_animation = *StorageAnimationList_ref(it);
const StorageAnimationManifestInfo* manifest_info =
@@ -531,7 +530,7 @@ void animation_manager_load_and_continue_animation(AnimationManager* animation_m
const StorageAnimationManifestInfo* manifest_info =
animation_storage_get_meta(restore_animation);
bool valid = animation_manager_is_valid_idle_animation(
manifest_info, &stats, XTREME_SETTINGS()->unlock_anims);
manifest_info, &stats, xtreme_settings.unlock_anims);
if(valid) {
animation_manager_replace_current_animation(
animation_manager, restore_animation);
@@ -545,10 +544,9 @@ void animation_manager_load_and_continue_animation(AnimationManager* animation_m
const BubbleAnimation* bubble_animation =
animation_storage_get_bubble_animation(
animation_manager->current_animation);
XtremeSettings* xtreme_settings = XTREME_SETTINGS();
int32_t duration = (xtreme_settings->cycle_anims == 0) ?
int32_t duration = (xtreme_settings.cycle_anims == 0) ?
(bubble_animation->duration) :
(xtreme_settings->cycle_anims);
(xtreme_settings.cycle_anims);
furi_timer_start(
animation_manager->idle_animation_timer,
(duration > 0) ? (duration * 1000) : 0);

View File

@@ -23,13 +23,12 @@ static void animation_storage_free_animation(BubbleAnimation** storage_animation
static BubbleAnimation* animation_storage_load_animation(const char* name);
void animation_handler_select_manifest() {
XtremeSettings* xtreme_settings = XTREME_SETTINGS();
FuriString* anim_dir = furi_string_alloc();
FuriString* manifest = furi_string_alloc();
bool use_asset_pack = xtreme_settings->asset_pack[0] != '\0';
bool use_asset_pack = xtreme_settings.asset_pack[0] != '\0';
if(use_asset_pack) {
furi_string_printf(
anim_dir, "%s/%s/Anims", XTREME_ASSETS_PATH, xtreme_settings->asset_pack);
anim_dir, "%s/%s/Anims", XTREME_ASSETS_PATH, xtreme_settings.asset_pack);
furi_string_printf(manifest, "%s/manifest.txt", furi_string_get_cstr(anim_dir));
Storage* storage = furi_record_open(RECORD_STORAGE);
if(storage_common_stat(storage, furi_string_get_cstr(manifest), NULL) == FSE_OK) {
@@ -514,7 +513,7 @@ static BubbleAnimation* animation_storage_load_animation(const char* name) {
if(!flipper_format_read_uint32(ff, "Active cycles", &u32value, 1)) break; //-V779
animation->active_cycles = u32value;
if(!flipper_format_read_uint32(ff, "Frame rate", &u32value, 1)) break;
uint32_t anim_speed = XTREME_SETTINGS()->anim_speed;
uint32_t anim_speed = xtreme_settings.anim_speed;
u32value = (u32value * anim_speed) / 100;
FURI_CONST_ASSIGN(animation->icon_animation.frame_rate, u32value < 1 ? 1 : u32value);
if(!flipper_format_read_uint32(ff, "Duration", &u32value, 1)) break;