Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/render')
-rw-r--r--src/render/draw.cc19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/render/draw.cc b/src/render/draw.cc
index 26b1109..2104981 100644
--- a/src/render/draw.cc
+++ b/src/render/draw.cc
@@ -578,6 +578,13 @@ void draw_model_fragments(core::Entity *entity)
thrust = static_cast<core::EntityControlable *>(entity)->thrust();
}
+ bool power = true;
+ if ((entity->type() == core::Entity::Dynamic) || (entity->type() == core::Entity::Controlable)) {
+ if ((static_cast<core::EntityDynamic *>(entity)->eventstate() & core::Entity::NoPower) == core::Entity::NoPower) {
+ power = false;
+ }
+ }
+
for (Model::Fragments::iterator fit = model->fragments().begin(); fit != model->fragments().end(); fit++) {
Fragment *fragment = (*fit);
@@ -625,12 +632,12 @@ void draw_model_fragments(core::Entity *entity)
}
}
- if (material & Material::Light) {
+ if (power && material & Material::Light) {
if (use_light) {
gl::disable(GL_LIGHTING);
use_light = false;
}
- } else if (material & Material::Engine) {
+ } else if ( power && material & Material::Engine) {
if (use_light) {
gl::disable(GL_LIGHTING);
use_light = false;
@@ -741,8 +748,14 @@ void draw_pass_model_fx(float elapsed)
for (core::Zone::Content::iterator it = zone->content().begin(); it != zone->content().end(); it++) {
core::Entity *entity = (*it);
- if (entity->model() && entity->state() && entity->state()->detailvisible()) {
+ bool power = true;
+ if ((entity->type() == core::Entity::Dynamic) || (entity->type() == core::Entity::Controlable)) {
+ if ((static_cast<core::EntityDynamic *>(entity)->eventstate() & core::Entity::NoPower) == core::Entity::NoPower) {
+ power = false;
+ }
+ }
+ if (entity->model() && entity->state() && entity->state()->detailvisible() && power) {
// draw model lights
for (model::Model::Lights::iterator lit = entity->model()->lights().begin(); lit != entity->model()->lights().end(); lit++) {
light = (*lit);