Compact declaration of default color in ray trace function

This commit is contained in:
Eryn Wells 2013-09-07 18:26:59 -07:00
parent 974ebd6ccd
commit a73cce8dbf

View file

@ -104,7 +104,7 @@ scene_render(Scene *scene)
// Assemble a ray and trace it. // Assemble a ray and trace it.
direction = vector_init(xx, yy, 1); direction = vector_init(xx, yy, 1);
primary_ray = ray_init(ZeroVector3, direction); primary_ray = ray_init(ZeroVector3, vector_normalize(direction));
scene->pixels[y * scene->height + x] = _scene_trace(scene, primary_ray, 0); scene->pixels[y * scene->height + x] = _scene_trace(scene, primary_ray, 0);
} }
} }
@ -116,11 +116,7 @@ scene_render(Scene *scene)
Color Color
_scene_trace(Scene *scene, const Ray ray, const int depth) _scene_trace(Scene *scene, const Ray ray, const int depth)
{ {
Color out_color; Color out_color = {0, 0, 0};
out_color.red = 0;
out_color.blue = 0;
out_color.green = 0;
out_color.alpha = 255;
return out_color; return out_color;
} }