diff --git a/config.c b/config.c index ff3132b..6704da0 100644 --- a/config.c +++ b/config.c @@ -15,7 +15,7 @@ static inline t_scene parsing_line(char *line, t_scene scene) { scene.line_if_exit = line; - if (line[0] == '#') + if (line[0] == '#' || line[0] == '\n') return (scene); else if (line[0] == 'A') scene = parsing_ambiant(scene); diff --git a/miniRT b/miniRT new file mode 100755 index 0000000..d559f4a Binary files /dev/null and b/miniRT differ diff --git a/one_sphere_plane.rt b/one_sphere_plane.rt index 7edce44..199ce91 100644 --- a/one_sphere_plane.rt +++ b/one_sphere_plane.rt @@ -19,5 +19,3 @@ L 11,40,50 1 255,255,255 sp 0,0,-20 10 0,0,100 pl 0,-5,0 0,1,0 100,55,0 - - diff --git a/render.c b/render.c index 81ea50b..c95e00d 100644 --- a/render.c +++ b/render.c @@ -42,13 +42,13 @@ static void render_pixel(t_app *app, int x, int y) void render_scene(t_app *app) { const int total_pixels = app->win_height * app->win_width; + static int done; + static int progress; int y; int x; - int progress; y = 0; - progress = 0; while (y < app->win_height) { x = 0; @@ -57,7 +57,12 @@ void render_scene(t_app *app) progress = ((y * app->win_width + x + 1) * 100) / total_pixels; render_pixel(app, x, y); x++; - printf("\rChargement de l'écran : %d%%", progress); + if (!done) + printf("\rChargement de l'écran : %d%% ", progress); + else + printf("\rTERMINE "); + if (progress >= 100) + done = 1; } y++; }