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>2008-07-26 16:48:21 +0000
committerStijn Buys <ingar@osirion.org>2008-07-26 16:48:21 +0000
commit7c5ccbafdf9f72b7b572f2285d126a0a4e9aac74 (patch)
tree8c8faadbbd889dbd8e4656c95ca0b013a0aec134
parentab0e9f429d15fa779b7bc0f145fc5e84eddf93be (diff)
better fix
-rw-r--r--src/render/draw.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/render/draw.cc b/src/render/draw.cc
index 5403172..2e72529 100644
--- a/src/render/draw.cc
+++ b/src/render/draw.cc
@@ -727,8 +727,10 @@ void draw_pass_model_fx(float elapsed)
float fraction = entity->state()->state_engine_trail_offset;
fraction += elapsed * 4.0f * u;
- while (fraction - 1.0001f > 0)
+ if (fraction > 1.0f)
fraction -= 1.0f;
+ math::clamp(fraction, 0.0f, 1.0f);
+
entity->state()->state_engine_trail_offset = fraction;
for(model::Model::Engines::iterator eit = entity->model()->engines().begin(); eit != entity->model()->engines().end(); eit++) {