[FL-2150] Dolphin animation refactoring (#938)

* Dolphin Animation Refactoring, part 1
* Remove animations from desktop
* Remove excess, first start
* Split animation_manager with callbacks
* allocate view inside animation_view
* Work on ViewComposed
* Draw white rectangles under bubble corners
* Fix bubbles sequence
* RPC: remove obsolete include "status.pb.h"
* Add animations manifest decoding
* Flipper file: add strict mode
* FFF: Animation structures parsing
* Assembling structure of animation
* Lot of view fixes:
  Add multi-line bubbles
  Add support for passive bubbles (frame_order values starts from passive now)
  Add hard-coded delay (active_shift) for active state enabling
  Fix active state handling
  Fix leaks
  Fix parsing uncorrect bubble_animation meta file
  Fix bubble rules of showing
* Animation load/unload & view freeze/unfreeze
* Blocking & system animations, fixes:
  View correct activation
  Refactoring + blocking animation
  Freeze first passive/active frames
  Many insert/eject SD tests fixes
  Add system animations
  Add Loader events app started/finished
  Add system no_sd animation
* Assets: dolphin packer. Scripts: minor refactoring.
* Desktop: update logging tags. Scripts: add metadata to dolphin bundling process, extra sorting for fs traversing. Make: phony assets rules.
* Github: rebuild assets on build
* Docker: add missing dependencies for assets compilation
* Docker: fix run command syntax
* ReadMe: update naming rules with link to source
* Assets: recompile icons
* Loader: add loader event
* Desktop, Gui, Furi Core: const shenanigans macros

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
This commit is contained in:
Albert Kharisov
2022-01-03 01:39:56 +04:00
committed by GitHub
parent 065241fe5b
commit a39002ce22
349 changed files with 3531 additions and 1912 deletions
+11 -4
View File
@@ -12,6 +12,7 @@ FlipperFile* flipper_file_alloc(Storage* storage) {
FlipperFile* flipper_file = malloc(sizeof(FlipperFile));
flipper_file->storage = storage;
flipper_file->file = storage_file_alloc(flipper_file->storage);
flipper_file->strict_mode = false;
return flipper_file;
}
@@ -25,6 +26,11 @@ void flipper_file_free(FlipperFile* flipper_file) {
free(flipper_file);
}
void flipper_file_set_strict_mode(FlipperFile* flipper_file, bool strict_mode) {
furi_assert(flipper_file);
flipper_file->strict_mode = strict_mode;
}
bool flipper_file_open_existing(FlipperFile* flipper_file, const char* filename) {
furi_assert(flipper_file);
bool result = storage_file_open(
@@ -136,7 +142,7 @@ bool flipper_file_get_value_count(FlipperFile* flipper_file, const char* key, ui
uint32_t position = storage_file_tell(flipper_file->file);
do {
if(!flipper_file_seek_to_key(flipper_file->file, key)) break;
if(!flipper_file_seek_to_key(flipper_file->file, key, flipper_file->strict_mode)) break;
// Balance between speed and memory consumption
// I prefer lower speed but less memory consumption
@@ -208,7 +214,7 @@ bool flipper_file_delete_key_and_call(
if(!storage_file_seek(flipper_file->file, 0, true)) break;
// find key
if(!flipper_file_seek_to_key(flipper_file->file, key)) break;
if(!flipper_file_seek_to_key(flipper_file->file, key, flipper_file->strict_mode)) break;
// get key start position
uint64_t start_position = storage_file_tell(flipper_file->file) - strlen(key);
if(start_position >= 2) {
@@ -326,12 +332,13 @@ bool flipper_file_read_internal(
const char* key,
void* _data,
const uint16_t data_size,
bool strict_mode,
FlipperFileValueType type) {
bool result = false;
string_t value;
string_init(value);
if(flipper_file_seek_to_key(file, key)) {
if(flipper_file_seek_to_key(file, key, strict_mode)) {
result = true;
for(uint16_t i = 0; i < data_size; i++) {
bool last = false;
@@ -392,4 +399,4 @@ File* flipper_file_get_file(FlipperFile* flipper_file) {
furi_assert(flipper_file->file);
return flipper_file->file;
}
}