summaryrefslogtreecommitdiff
path: root/particles.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'particles.cpp')
-rw-r--r--particles.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/particles.cpp b/particles.cpp
index 2603397..2bd9139 100644
--- a/particles.cpp
+++ b/particles.cpp
@@ -66,13 +66,13 @@ void Particles::draw()
glBegin(GL_LINES);
for(i=m_list.begin();i!=m_list.end();i++)
- {
+ {
i->a-=m_alpha_dec;
glColor4f(i->r,i->g,i->b,i->a);
glVertex3f(i->x1,i->y1,i->z1);
glVertex3f(i->x2,i->y2,i->z2);
- }
+ }
glEnd();
}
@@ -85,17 +85,19 @@ void Particles::update()
// Delete dead particles
//
i=m_list.begin();
-
+
while ((i!=m_list.end())&&(i->a<=m_alpha_min))
- {
+ {
m_list.pop_front();
i=m_list.begin();
- }
+ }
// Update them
//
for(i=m_list.begin();i!=m_list.end();i++)
+ {
i->a-=m_alpha_dec;
+ }
}
// END OF FILE //