diff options
author | Julian T <julian@jtle.dk> | 2020-03-23 16:14:53 +0100 |
---|---|---|
committer | Julian T <julian@jtle.dk> | 2020-03-23 16:14:53 +0100 |
commit | 8fc5b36510c5964873d88069b61b558bc3ef23f6 (patch) | |
tree | 849aa4694da76ca000d27137ad35746b3976d81d /ray.c | |
parent | 6ae610fd7f28ba5ba7a8e0233cd6fb0ac5df4a8b (diff) |
Removed dynamic allocation of color in main.c
Diffstat (limited to 'ray.c')
-rw-r--r-- | ray.c | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -309,10 +309,10 @@ exit: return 0; } -color_t *ray_trace(space_t *s, unsigned int x, unsigned int y, unsigned samples, void *seed) +void ray_trace(space_t *s, unsigned int x, unsigned int y, unsigned samples, color_t *c, void *seed) { // Init return color. Will be accumilated with all the detected light. - color_t *c = color_set(NULL, 0, 0, 0); + color_set(c, 0, 0, 0); // Setup primary ray ray_t r; @@ -349,6 +349,4 @@ color_t *ray_trace(space_t *s, unsigned int x, unsigned int y, unsigned samples, // Add ambient color_add(c, c, &s->ambient); - - return c; } |