aboutsummaryrefslogtreecommitdiff
path: root/src/user.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/user.c')
-rw-r--r--src/user.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/src/user.c b/src/user.c
index 9d1b437..7469708 100644
--- a/src/user.c
+++ b/src/user.c
@@ -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");