diff options
author | Krow Savcik <krow@savcik.xyz> | 2024-07-20 00:22:00 +0300 |
---|---|---|
committer | Krow Savcik <krow@savcik.xyz> | 2024-07-20 00:22:00 +0300 |
commit | b486d1f47e0bbc1a0e3414df1f4f9193a3997300 (patch) | |
tree | f754d3939cffdcf68ab6a3e8bc87cc933368cee5 /src/user.c | |
parent | 689d8faa8638c1d14f79c7960afe3139bd042f96 (diff) |
feature: added frames
Diffstat (limited to 'src/user.c')
-rw-r--r-- | src/user.c | 25 |
1 files changed, 24 insertions, 1 deletions
@@ -168,7 +168,7 @@ void user_layer_add(const Arg *x) { if (cur_canvas == NULL) return; - canvas_add_layer(cur_canvas, cur_canvas->cur_layer+1); + if (canvas_add_layer(cur_canvas, cur_canvas->cur_layer+1)) return; cur_canvas->cur_layer++; ui_redraw_panel(UI_PANELTYPE_CANVAS); ui_redraw_panel(UI_PANELTYPE_TIMELINE); @@ -183,6 +183,29 @@ user_layer_chng(const Arg *x) } void +user_frame_add(const Arg *x) +{ + int i; + if (cur_canvas == NULL) return; + if (canvas_add_frame(cur_canvas, cur_canvas->cur_frame+1)) return; + for (i = 0; i < cur_canvas->layer_arr_cnt; i++) + memcpy(cur_canvas->cells[(cur_canvas->cur_frame + 1) * cur_canvas->layer_arr_cnt+i], + cur_canvas->cells[cur_canvas->cur_frame * cur_canvas->layer_arr_cnt+i], + cur_canvas->w * cur_canvas->h * sizeof *cur_canvas->cells[0]); + canvas_change_frame(cur_canvas, cur_canvas->cur_frame+1); + ui_redraw_panel(UI_PANELTYPE_CANVAS); + ui_redraw_panel(UI_PANELTYPE_TIMELINE); +} + +void +user_frame_chng(const Arg *x) +{ + if (cur_canvas == NULL) return; + canvas_change_frame(cur_canvas, (cur_canvas->cur_frame + (unsigned int)cur_canvas->frame_arr_cnt + (x->i % (int)cur_canvas->frame_arr_cnt)) % cur_canvas->frame_arr_cnt); + ui_redraw_panel(UI_PANELTYPE_TIMELINE); +} + +void user_debug_mem_show(const Arg *x) { fprintf(stdout, "DEBUG INFO:\n"); |