From 8fc5b36510c5964873d88069b61b558bc3ef23f6 Mon Sep 17 00:00:00 2001 From: Julian T Date: Mon, 23 Mar 2020 16:14:53 +0100 Subject: Removed dynamic allocation of color in main.c --- main.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'main.c') diff --git a/main.c b/main.c index 36a9372..0e529ad 100644 --- a/main.c +++ b/main.c @@ -93,12 +93,10 @@ int main() for (int x = TESTW; x; x--) { // Random seed seed = x * y; - color_t *c = ray_trace(&cont->space, x, y, 2, &seed); + color_t c; + ray_trace(&cont->space, x, y, 2, &c, &seed); - if (c) { - pgm_write_pixel(stdout, c); - } - free(c); + pgm_write_pixel(stdout, &c); } -- cgit v1.2.3