mirror of
https://github.com/DarkFlippers/unleashed-firmware.git
synced 2024-12-18 19:01:47 +03:00
d1f523687e
* dolphin scene draft wip * gui/elements multiline framed text added * zoom poc * item callbacks * engine tweaks * move scenes out of services * improve dolphin gfx selection * glitch hints * dialogue typewriter effect * app loading from scenes app, small action changes, passport app(WIP) * removed passport from main dolphin app, added statusbar * small elements position fixes * fix thread alloc, dolphin and dolphin_scene free functions, other minor issues * sleep emote improvements * Dolpin: fix memory leaks, variable namings and etc Co-authored-by: gornekich <44112859+gornekich@users.noreply.github.com> Co-authored-by: DrZlo13 <who.just.the.doctor@gmail.com> Co-authored-by: あく <alleteam@gmail.com>
32 lines
931 B
C
32 lines
931 B
C
#include <furi.h>
|
|
#include "dolphin_scene/dolphin_scene.h"
|
|
|
|
void dolphin_scene_redraw(Canvas* canvas, void* ctx) {
|
|
furi_assert(canvas);
|
|
furi_assert(ctx);
|
|
|
|
SceneState* state = (SceneState*)acquire_mutex((ValueMutex*)ctx, 25);
|
|
if(state == NULL) return; // redraw fail
|
|
uint32_t t = xTaskGetTickCount();
|
|
|
|
canvas_clear(canvas);
|
|
|
|
dolphin_scene_render(state, canvas, t);
|
|
|
|
dolphin_scene_render_dolphin_state(state, canvas);
|
|
|
|
release_mutex((ValueMutex*)ctx, state);
|
|
}
|
|
|
|
void dolphin_scene_handle_input(SceneState* state, InputEvent* input) {
|
|
// printf("[kb] event: %02x %s\n", input->key, input->state ? "pressed" : "released");
|
|
dolphin_scene_handle_user_input(state, input);
|
|
}
|
|
|
|
void dolphin_scene_tick_handler(SceneState* state, uint32_t t, uint32_t dt) {
|
|
// printf("t: %d, dt: %d\n", t, dt);
|
|
|
|
dolphin_scene_coordinates(state, dt);
|
|
dolphin_scene_update_dolphin_state(state, t, dt);
|
|
}
|