From 3b7f672ab37cbf68be453ad4d4d476ac5389d52f Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Fri, 13 Sep 2013 18:25:09 -0700 Subject: [PATCH] Add get_ambient() to Scene --- src/scene.cc | 10 +++++++++- src/scene.h | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/scene.cc b/src/scene.cc index 9030439..b73e337 100644 --- a/src/scene.cc +++ b/src/scene.cc @@ -19,7 +19,7 @@ Scene::Scene() : width(640), height(480), max_depth(5), - ambient(NULL), + ambient(new AmbientLight()), shapes(), lights(), nrays(0), @@ -74,6 +74,14 @@ Scene::get_height() } +AmbientLight & +Scene::get_ambient() + const +{ + return *ambient; +} + + const Color * Scene::get_pixels() const diff --git a/src/scene.h b/src/scene.h index 7a01f18..6ba4ea9 100644 --- a/src/scene.h +++ b/src/scene.h @@ -31,6 +31,7 @@ public: bool is_rendered() const; int get_width() const; int get_height() const; + AmbientLight &get_ambient() const; const Color *get_pixels() const; void read(const std::string &filename);