diff options
author | Stijn Buys <ingar@osirion.org> | 2008-08-10 18:48:23 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2008-08-10 18:48:23 +0000 |
commit | 9c56ebfdba5fe33476f8d382da6d72e5b81ab4b8 (patch) | |
tree | 3dfee7a93cd591df8ef3a0aef811067ef6451df7 /src/render | |
parent | ae96accdd3c38d3f96b0725020e7a390c53b86d5 (diff) |
added racetrack to the game module, added Odin's new structures to the assets documentation
Diffstat (limited to 'src/render')
-rw-r--r-- | src/render/draw.cc | 19 |
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); |