From 461164dd4adefc0036d1e244fbd0e5e805bbef9d Mon Sep 17 00:00:00 2001 From: Adam NAILI Date: Tue, 9 Jan 2018 15:45:25 +0100 Subject: Changing the end of the program to let the user retry his morphing --- src/gui/gui.c | 2 +- src/gui/window.c | 15 +++++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/gui/gui.c b/src/gui/gui.c index bf73bdb..16e9a19 100644 --- a/src/gui/gui.c +++ b/src/gui/gui.c @@ -104,7 +104,7 @@ void gui_handle_event(GUI *gui) { mode = WAITING_BUTTON_SHOW; break; case RENDERING: - window_rendering(gui->window, gui->pictureFrame1, gui->canvasSrc, gui->canvasTrg, gui->morphing); + window_rendering(gui->window, *(gui->pictureFrame1), gui->canvasSrc, gui->canvasTrg, gui->morphing); break; case INSERT_TARGET: if (keyboardButton == MLV_KEYBOARD_ESCAPE) { diff --git a/src/gui/window.c b/src/gui/window.c index e4eacea..a0c97a8 100644 --- a/src/gui/window.c +++ b/src/gui/window.c @@ -1,6 +1,7 @@ #include "gui/window.h" #include #include +#include #include "painter/rasterizer.h" #include "common/mem.h" @@ -69,16 +70,18 @@ void window_click_keyboard_handler(Window *window, MLV_Keyboard_button *keyboard group_click_handler(*mouse_x, *mouse_y, &(window->group_pictureframe->component)); } -void window_rendering(Window *window, PictureFrame *pictureFrame1, Canvas *canvasSrc, Canvas *canvasTarget, +void window_rendering(Window *window, PictureFrame pictureFrame1, Canvas *canvasSrc, Canvas *canvasTarget, Morphing *morphing) { int i; window_print_pictureframes(window); for (i = 1; i <= frame; ++i) { - pictureFrame1->canvas = rasterize(canvasSrc, canvasTarget, morphing, (TimeVector) (i / (float) frame)); - pictureframe_draw_canvas(pictureFrame1); + pictureFrame1.canvas = rasterize(canvasSrc, canvasTarget, morphing, (TimeVector) (i / (float) frame)); + pictureframe_draw_canvas(&pictureFrame1); MLV_actualise_window(); - canvas_destroy(pictureFrame1->canvas); + canvas_destroy(pictureFrame1.canvas); + MLV_wait_milliseconds(16); } - mode = EXITING; - MLV_wait_seconds(15); + mode = WAITING_BUTTON_SHOW; + window_print_pictureframes(window); + MLV_actualise_window(); } -- cgit v1.2.3