Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2011-07-31 19:01:43 +0000
committerStijn Buys <ingar@osirion.org>2011-07-31 19:01:43 +0000
commit5feb96ea3e0616d108a68c14a9a77d0217a686cd (patch)
treeacd8919371b950e5c40880b4e561c98baa7da107 /src/render/state.cc
parent45054b224d8f0f8b6d7db4bcd0b0abf6763a60ab (diff)
Added power state to the material context.
Diffstat (limited to 'src/render/state.cc')
-rw-r--r--src/render/state.cc14
1 files changed, 10 insertions, 4 deletions
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 {