summaryrefslogtreecommitdiff
path: root/src/gui/window.c
diff options
context:
space:
mode:
authorAdam NAILI2018-01-09 15:45:25 +0100
committerAdam NAILI2018-01-09 15:45:25 +0100
commit461164dd4adefc0036d1e244fbd0e5e805bbef9d (patch)
tree8777a7bb5738a85374e1696126ecf2654a94da99 /src/gui/window.c
parent803524799631bcc96ee1fa7e194516fb23d8d9b3 (diff)
downloadmorpher-461164dd4adefc0036d1e244fbd0e5e805bbef9d.tar.gz
Changing the end of the program to let the user retry his morphing
Diffstat (limited to 'src/gui/window.c')
-rw-r--r--src/gui/window.c15
1 files changed, 9 insertions, 6 deletions
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 @@
1#include "gui/window.h" 1#include "gui/window.h"
2#include <assert.h> 2#include <assert.h>
3#include <MLV/MLV_all.h> 3#include <MLV/MLV_all.h>
4#include <gui/pictureframe.h>
4#include "painter/rasterizer.h" 5#include "painter/rasterizer.h"
5#include "common/mem.h" 6#include "common/mem.h"
6 7
@@ -69,16 +70,18 @@ void window_click_keyboard_handler(Window *window, MLV_Keyboard_button *keyboard
69 group_click_handler(*mouse_x, *mouse_y, &(window->group_pictureframe->component)); 70 group_click_handler(*mouse_x, *mouse_y, &(window->group_pictureframe->component));
70} 71}
71 72
72void window_rendering(Window *window, PictureFrame *pictureFrame1, Canvas *canvasSrc, Canvas *canvasTarget, 73void window_rendering(Window *window, PictureFrame pictureFrame1, Canvas *canvasSrc, Canvas *canvasTarget,
73 Morphing *morphing) { 74 Morphing *morphing) {
74 int i; 75 int i;
75 window_print_pictureframes(window); 76 window_print_pictureframes(window);
76 for (i = 1; i <= frame; ++i) { 77 for (i = 1; i <= frame; ++i) {
77 pictureFrame1->canvas = rasterize(canvasSrc, canvasTarget, morphing, (TimeVector) (i / (float) frame)); 78 pictureFrame1.canvas = rasterize(canvasSrc, canvasTarget, morphing, (TimeVector) (i / (float) frame));
78 pictureframe_draw_canvas(pictureFrame1); 79 pictureframe_draw_canvas(&pictureFrame1);
79 MLV_actualise_window(); 80 MLV_actualise_window();
80 canvas_destroy(pictureFrame1->canvas); 81 canvas_destroy(pictureFrame1.canvas);
82 MLV_wait_milliseconds(16);
81 } 83 }
82 mode = EXITING; 84 mode = WAITING_BUTTON_SHOW;
83 MLV_wait_seconds(15); 85 window_print_pictureframes(window);
86 MLV_actualise_window();
84} 87}