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>2009-08-13 19:23:24 +0000
committerStijn Buys <ingar@osirion.org>2009-08-13 19:23:24 +0000
commit69d54b593f96c0f7e525c0dff560ca0614071cf3 (patch)
treecf5e3c4f5427c8867a243eb1eeb2f4c11d2e02c9 /src/render
parent662a564a008e408acd609abb2ef460783ca45e4e (diff)
fixes light/flare renderer bugs
Diffstat (limited to 'src/render')
-rw-r--r--src/render/draw.cc17
1 files changed, 5 insertions, 12 deletions
diff --git a/src/render/draw.cc b/src/render/draw.cc
index 3e2547c..4768b7d 100644
--- a/src/render/draw.cc
+++ b/src/render/draw.cc
@@ -857,23 +857,16 @@ void draw_pass_model_fragments()
void draw_pass_model_fx(float elapsed)
{
- //const size_t count = 8; // number of engine trail particles
-
float t = 0.0f;
float a = 0.0f;
float light_size = 0.0f;
bool power = true;
bool draw_quad = true;
- float thrust;
+ float thrust = 0.0f;
- //math::Vector3f quad[4];
math::Vector3f location;
math::Vector3f offset;
math::Color color;
-
- model::Light *light;
- model::Flare *flare;
-
math::Axis flare_axis;
for (core::Zone::Content::iterator it = zone->content().begin(); it != zone->content().end(); it++) {
@@ -903,7 +896,7 @@ void draw_pass_model_fx(float elapsed)
// draw model lights
for (model::Model::Lights::iterator lit = entity->model()->lights().begin(); lit != entity->model()->lights().end(); lit++) {
- light = (*lit);
+ model::Light *light = (*lit);
draw_quad = true;
// engine activated lights
@@ -973,7 +966,7 @@ void draw_pass_model_fx(float elapsed)
// draw flares
for (model::Model::Flares::iterator flit = entity->model()->flares().begin(); flit != entity->model()->flares().end(); flit++) {
- flare = (*flit);
+ model::Flare *flare = (*flit);
draw_quad = true;
// engine activated flares
@@ -996,8 +989,8 @@ void draw_pass_model_fx(float elapsed)
// strobe frequency
if (draw_quad && flare->strobe()) {
- t = (core::application()->time() + ext_render(entity)->fuzz() - light->offset()) * flare->frequency();
- if ((t - floorf(t)) > light->time()) {
+ t = (core::application()->time() + ext_render(entity)->fuzz() - flare->offset()) * flare->frequency();
+ if ((t - floorf(t)) > flare->time()) {
draw_quad = false;
}
}