Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
path: root/src/ui
diff options
context:
space:
mode:
authorEvan Goers <mega@osirion.org>2012-03-21 14:01:06 +0000
committerEvan Goers <mega@osirion.org>2012-03-21 14:01:06 +0000
commit2bb4648c0a92244d98a3dd0995e912eba80c4450 (patch)
treebf4b6d5fa05e32fddf7d96b9e8db78bf02aee847 /src/ui
parent980b47266c5fba9a7e7fabfa7a6d77167a47cb60 (diff)
Changed create_light() to add_light().
De-duplicated some magic numbers.
Diffstat (limited to 'src/ui')
-rwxr-xr-xsrc/ui/modelview.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/ui/modelview.cc b/src/ui/modelview.cc
index e3a3c79..303f8e2 100755
--- a/src/ui/modelview.cc
+++ b/src/ui/modelview.cc
@@ -20,6 +20,8 @@ namespace ui
{
GLenum modelview_gllight = GL_LIGHT0;
+float modelview_light_distance = -10.0f;
+float modelview_light_attenuation = 0.05f;
ModelView::ModelView(Widget *parent) : Widget(parent)
{
@@ -204,10 +206,10 @@ void ModelView::draw_globe()
glEnableClientState(GL_NORMAL_ARRAY);
// we set up the light in camera space
- float modelview_light_location[] = {-10.0f * reference_radius, 0, 0};
+ float modelview_light_location[] = {modelview_light_distance * reference_radius, 0, 0};
math::Color modelview_light_color;
modelview_light_color.assign(1.0);
- modelview_gllight = render::create_light(modelview_light_location, 0.05f, modelview_light_color);
+ modelview_gllight = render::add_light(modelview_light_location, modelview_light_attenuation, modelview_light_color);
gl::enable(modelview_gllight);
@@ -304,10 +306,10 @@ void ModelView::draw_model()
glEnableClientState(GL_NORMAL_ARRAY);
// we set up the light in camera space
- float modelview_light_location[] = {-10.0f * reference_radius, 0, 0};
+ float modelview_light_location[] = {modelview_light_distance * reference_radius, 0, 0};
math::Color modelview_light_color;
modelview_light_color.assign(1.0);
- modelview_gllight = render::create_light(modelview_light_location, 0.05f, modelview_light_color);
+ modelview_gllight = render::add_light(modelview_light_location, modelview_light_attenuation, modelview_light_color);
gl::enable(modelview_gllight);