From 5feb96ea3e0616d108a68c14a9a77d0217a686cd Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sun, 31 Jul 2011 19:01:43 +0000 Subject: Added power state to the material context. --- src/render/state.cc | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src/render/state.cc') diff --git a/src/render/state.cc b/src/render/state.cc index 21a142f..dbcb276 100644 --- a/src/render/state.cc +++ b/src/render/state.cc @@ -28,6 +28,8 @@ math::Color State::state_color_primary; math::Color State::state_color_secondary; math::Color State::state_color_engine; +bool State::state_power = true; + void State::init(int width, int height) { resize(width, height); @@ -197,7 +199,12 @@ void State::set_color(const core::Entity *entity) state_color_primary.assign(entity->color()); state_color_secondary.assign(entity->color_second()); } - + +void State::set_power(const bool power) +{ + state_power = power; +} + void State::use_material(const model::Material * material) { math::Color color; @@ -240,11 +247,10 @@ void State::use_material(const model::Material * material) { } // lighted or fullbright - // FIXME entity power - if (material->flags() & model::Material::Bright) { + if (state_power && (material->flags() & model::Material::Bright)) { gl::disable(GL_LIGHTING); - } else if (material->flags() & model::Material::Engine) { + } else if (state_power && (material->flags() & model::Material::Engine)) { gl::disable(GL_LIGHTING); } else { -- cgit v1.2.3