Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
path: root/src/ui
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2012-03-22 19:56:35 +0000
committerStijn Buys <ingar@osirion.org>2012-03-22 19:56:35 +0000
commit75fd54748dd65b25f25f84a0bbdc25d6b7d4eb67 (patch)
tree9ba4ad39b8c3ed7615260bd451e54ba9d41614e9 /src/ui
parent2bb4648c0a92244d98a3dd0995e912eba80c4450 (diff)
Cleaned up lighting related variable names.
Diffstat (limited to 'src/ui')
-rwxr-xr-xsrc/ui/modelview.cc27
1 files changed, 12 insertions, 15 deletions
diff --git a/src/ui/modelview.cc b/src/ui/modelview.cc
index 303f8e2..813fddb 100755
--- a/src/ui/modelview.cc
+++ b/src/ui/modelview.cc
@@ -19,9 +19,8 @@
namespace ui
{
-GLenum modelview_gllight = GL_LIGHT0;
-float modelview_light_distance = -10.0f;
-float modelview_light_attenuation = 0.05f;
+const float LIGHT_DISTANCE = -10.0f;
+const float LIGHT_ATTENUATION = 0.05f;
ModelView::ModelView(Widget *parent) : Widget(parent)
{
@@ -206,12 +205,11 @@ void ModelView::draw_globe()
glEnableClientState(GL_NORMAL_ARRAY);
// we set up the light in camera space
- 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::add_light(modelview_light_location, modelview_light_attenuation, modelview_light_color);
+ const math::Vector3f light_location(LIGHT_DISTANCE * reference_radius, 0, 0);
+ const math::Color light_color(1.0f, 1.0f, 1.0f);
+ GLenum gllight = render::add_light(light_location, LIGHT_ATTENUATION, light_color);
- gl::enable(modelview_gllight);
+ gl::enable(gllight);
render::State::set_normalize(true);
@@ -240,7 +238,7 @@ void ModelView::draw_globe()
gl::pop();
render::State::set_normalize(false);
- gl::disable(modelview_gllight);
+ gl::disable(gllight);
glDisableClientState(GL_VERTEX_ARRAY);
glDisableClientState(GL_NORMAL_ARRAY);
@@ -306,12 +304,11 @@ void ModelView::draw_model()
glEnableClientState(GL_NORMAL_ARRAY);
// we set up the light in camera space
- 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::add_light(modelview_light_location, modelview_light_attenuation, modelview_light_color);
+ const math::Vector3f light_location(LIGHT_DISTANCE * reference_radius, 0, 0);
+ const math::Color light_color(1.0f, 1.0f, 1.0f);
+ GLenum gllight = render::add_light(light_location, LIGHT_ATTENUATION, light_color);
- gl::enable(modelview_gllight);
+ gl::enable(gllight);
// push transformation matrix to stack
gl::push();
@@ -335,7 +332,7 @@ void ModelView::draw_model()
gl::pop();
- gl::disable(modelview_gllight);
+ gl::disable(gllight);
glDisableClientState(GL_VERTEX_ARRAY);
glDisableClientState(GL_NORMAL_ARRAY);