about summary refs log tree commit diff
path: root/src/game/client/components/particles.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/client/components/particles.cpp')
-rw-r--r--src/game/client/components/particles.cpp38
1 files changed, 19 insertions, 19 deletions
diff --git a/src/game/client/components/particles.cpp b/src/game/client/components/particles.cpp
index 25c9dd36..c4583cb1 100644
--- a/src/game/client/components/particles.cpp
+++ b/src/game/client/components/particles.cpp
@@ -26,7 +26,7 @@ void CParticles::OnReset()
 		m_aParticles[i].m_PrevPart = i-1;
 		m_aParticles[i].m_NextPart = i+1;
 	}
-	
+
 	m_aParticles[0].m_PrevPart = 0;
 	m_aParticles[MAX_PARTICLES-1].m_NextPart = -1;
 	m_FirstFree = 0;
@@ -39,30 +39,30 @@ void CParticles::Add(int Group, CParticle *pPart)
 {
 	if(Client()->State() == IClient::STATE_DEMOPLAYBACK)
 	{
-		const IDemoPlayer::CInfo *pInfo = DemoPlayer()->BaseInfo();		
+		const IDemoPlayer::CInfo *pInfo = DemoPlayer()->BaseInfo();
 		if(pInfo->m_Paused)
 			return;
 	}
 
 	if (m_FirstFree == -1)
 		return;
-		
+
 	// remove from the free list
 	int Id = m_FirstFree;
 	m_FirstFree = m_aParticles[Id].m_NextPart;
 	if(m_FirstFree != -1)
 		m_aParticles[m_FirstFree].m_PrevPart = -1;
-	
+
 	// copy data
 	m_aParticles[Id] = *pPart;
-	
+
 	// insert to the group list
 	m_aParticles[Id].m_PrevPart = -1;
 	m_aParticles[Id].m_NextPart = m_aFirstPart[Group];
 	if(m_aFirstPart[Group] != -1)
 		m_aParticles[m_aFirstPart[Group]].m_PrevPart = Id;
 	m_aFirstPart[Group] = Id;
-	
+
 	// set some parameters
 	m_aParticles[Id].m_Life = 0;
 }
@@ -74,14 +74,14 @@ void CParticles::Update(float TimePassed)
 
 	if(FrictionFraction > 2.0f) // safty messure
 		FrictionFraction = 0;
-	
+
 	int FrictionCount = 0;
 	while(FrictionFraction > 0.05f)
 	{
 		FrictionCount++;
 		FrictionFraction -= 0.05f;
 	}
-	
+
 	for(int g = 0; g < NUM_GROUPS; g++)
 	{
 		int i = m_aFirstPart[g];
@@ -90,15 +90,15 @@ void CParticles::Update(float TimePassed)
 			int Next = m_aParticles[i].m_NextPart;
 			//m_aParticles[i].vel += flow_get(m_aParticles[i].pos)*time_passed * m_aParticles[i].flow_affected;
 			m_aParticles[i].m_Vel.y += m_aParticles[i].m_Gravity*TimePassed;
-			
+
 			for(int f = 0; f < FrictionCount; f++) // apply friction
 				m_aParticles[i].m_Vel *= m_aParticles[i].m_Friction;
-			
+
 			// move the point
 			vec2 Vel = m_aParticles[i].m_Vel*TimePassed;
 			Collision()->MovePoint(&m_aParticles[i].m_Pos, &Vel, 0.1f+0.9f*frandom(), NULL);
 			m_aParticles[i].m_Vel = Vel* (1.0f/TimePassed);
-			
+
 			m_aParticles[i].m_Life += TimePassed;
 			m_aParticles[i].m_Rot += TimePassed * m_aParticles[i].m_Rotspeed;
 
@@ -110,10 +110,10 @@ void CParticles::Update(float TimePassed)
 					m_aParticles[m_aParticles[i].m_PrevPart].m_NextPart = m_aParticles[i].m_NextPart;
 				else
 					m_aFirstPart[g] = m_aParticles[i].m_NextPart;
-					
+
 				if(m_aParticles[i].m_NextPart != -1)
 					m_aParticles[m_aParticles[i].m_NextPart].m_PrevPart = m_aParticles[i].m_PrevPart;
-					
+
 				// insert to the free list
 				if(m_FirstFree != -1)
 					m_aParticles[m_FirstFree].m_PrevPart = i;
@@ -121,7 +121,7 @@ void CParticles::Update(float TimePassed)
 				m_aParticles[i].m_NextPart = m_FirstFree;
 				m_FirstFree = i;
 			}
-			
+
 			i = Next;
 		}
 	}
@@ -134,16 +134,16 @@ void CParticles::OnRender()
 
 	static int64 LastTime = 0;
 	int64 t = time_get();
-	
+
 	if(Client()->State() == IClient::STATE_DEMOPLAYBACK)
 	{
-		const IDemoPlayer::CInfo *pInfo = DemoPlayer()->BaseInfo();		
+		const IDemoPlayer::CInfo *pInfo = DemoPlayer()->BaseInfo();
 		if(!pInfo->m_Paused)
 			Update((float)((t-LastTime)/(double)time_freq())*pInfo->m_Speed);
 	}
 	else
 		Update((float)((t-LastTime)/(double)time_freq()));
-	
+
 	LastTime = t;
 }
 
@@ -168,11 +168,11 @@ void CParticles::RenderGroup(int Group)
 			m_aParticles[i].m_Color.r,
 			m_aParticles[i].m_Color.g,
 			m_aParticles[i].m_Color.b,
-			m_aParticles[i].m_Color.a); // pow(a, 0.75f) * 
+			m_aParticles[i].m_Color.a); // pow(a, 0.75f) *
 
 		IGraphics::CQuadItem QuadItem(p.x, p.y, Size, Size);
 		Graphics()->QuadsDraw(&QuadItem, 1);
-		
+
 		i = m_aParticles[i].m_NextPart;
 	}
 	Graphics()->QuadsEnd();