Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2008-08-15 15:50:28 +0000
committerStijn Buys <ingar@osirion.org>2008-08-15 15:50:28 +0000
commitb780874cf4ab23cf9e48aa23da2394169da24887 (patch)
tree620a99ba7229aab7f77745c87b5380838082a1ab /src
parenta58ffdaf01bf67871676130a42304fa5c4c46325 (diff)
full thruster engine texture if impulse is enabled
Diffstat (limited to 'src')
-rw-r--r--src/model/map.cc2
-rw-r--r--src/render/draw.cc22
2 files changed, 16 insertions, 8 deletions
diff --git a/src/model/map.cc b/src/model/map.cc
index 0e124c6..960a1f0 100644
--- a/src/model/map.cc
+++ b/src/model/map.cc
@@ -960,7 +960,7 @@ Model * Map::load(std::string const &name)
mapfile.close();
- // reposition lights, flares and engines according to the model center
+ // reposition docks, lights, flares and engines according to the model center
for (Model::Lights::iterator lit = model->lights().begin(); lit != model->lights().end(); lit++) {
(*lit)->light_location -= mapfile.map_center;
}
diff --git a/src/render/draw.cc b/src/render/draw.cc
index af19abe..3be18e7 100644
--- a/src/render/draw.cc
+++ b/src/render/draw.cc
@@ -572,15 +572,23 @@ void draw_model_fragments(core::Entity *entity)
bool use_color_array = true; // glEnableClientState(GL_COLOR_ARRAY) is set
bool use_light = true; // gl::disable(GL_LIGHTING) is set
+ bool power = true;
float thrust = 0;
- if (entity->type() == core::Entity::Controlable) {
- 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) {
+
+ if (static_cast<core::EntityDynamic *>(entity)->eventstate() == core::Entity::NoPower) {
power = false;
+
+ } else if (entity->type() == core::Entity::Controlable) {
+
+ core::EntityControlable *ec = static_cast<core::EntityControlable *>(entity);
+
+ if (ec->eventstate() == core::Entity::Impulse) {
+ thrust = 1.0f;
+ } else {
+ thrust = ec->thrust();
+ }
}
}
@@ -631,12 +639,12 @@ void draw_model_fragments(core::Entity *entity)
}
}
- if (power && material & Material::Light) {
+ if (power && (material & Material::Light)) {
if (use_light) {
gl::disable(GL_LIGHTING);
use_light = false;
}
- } else if ( power && material & Material::Engine) {
+ } else if (power && (material & Material::Engine)) {
if (use_light) {
gl::disable(GL_LIGHTING);
use_light = false;