Skip to content

Commit 5c4df79

Browse files
committed
unify(particlesys): Merge minor refactors in ParticleSystem (TheSuperHackers#2153)
1 parent f588071 commit 5c4df79

3 files changed

Lines changed: 7 additions & 10 deletions

File tree

Generals/Code/GameEngine/Source/GameClient/System/ParticleSys.cpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1857,11 +1857,11 @@ const ParticleInfo *ParticleSystem::generateParticleInfo( Int particleNum, Int p
18571857
if( m_accumulatedSizeBonus )
18581858
m_accumulatedSizeBonus = min( m_accumulatedSizeBonus, (float)MAX_SIZE_BONUS );
18591859

1860-
int i=0;
1861-
for( ; i<MAX_KEYFRAMES; i++ )
1860+
for( int i=0; i<MAX_KEYFRAMES; i++ )
18621861
{
18631862
info.m_alphaKey[i].value = m_alphaKey[i].var.getValue();
18641863
info.m_alphaKey[i].frame = m_alphaKey[i].frame;
1864+
info.m_colorKey[i] = m_colorKey[i];
18651865
}
18661866

18671867
/*
@@ -1870,11 +1870,6 @@ const ParticleInfo *ParticleSystem::generateParticleInfo( Int particleNum, Int p
18701870
info.m_color.blue = m_color.blue.getValue();
18711871
*/
18721872

1873-
for( i=0; i<MAX_KEYFRAMES; i++ )
1874-
{
1875-
info.m_colorKey[i] = m_colorKey[i];
1876-
}
1877-
18781873
info.m_colorScale = m_colorScale.getValue();
18791874
#ifdef ALLOW_TEMPORARIES
18801875
Vector3 pos = m_transform * Vector3(0, 0, 0);

GeneralsMD/Code/GameEngine/Include/GameClient/ParticleSys.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ class Particle : public MemoryPoolObject,
178178

179179
Particle( ParticleSystem *system, const ParticleInfo *data );
180180

181-
inline Bool update( void ); ///< update this particle's behavior - return false if dead
181+
Bool update( void ); ///< update this particle's behavior - return false if dead
182182
void doWindMotion( void ); ///< do wind motion (if present) from particle system
183183

184184
void applyForce( const Coord3D *force ); ///< add the given acceleration
@@ -190,7 +190,7 @@ class Particle : public MemoryPoolObject,
190190
const RGBColor *getColor( void ) { return &m_color; }
191191
void setColor( RGBColor *color ) { m_color = *color; }
192192

193-
inline Bool isInvisible( void ); ///< return true if this particle is invisible
193+
Bool isInvisible( void ); ///< return true if this particle is invisible
194194
Bool isCulled (void) {return m_isCulled;} ///< return true if the particle falls off the edge of the screen
195195
void setIsCulled (Bool enable) { m_isCulled = enable;} ///< set particle to not visible because it's outside view frustum
196196

GeneralsMD/Code/GameEngine/Source/GameClient/System/ParticleSys.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,9 @@ Bool Particle::update( void )
492492

493493

494494
// reset the acceleration for accumulation next frame
495-
m_accel.z=m_accel.y=m_accel.x= 0.0f;
495+
m_accel.x = 0.0f;
496+
m_accel.y = 0.0f;
497+
m_accel.z = 0.0f;
496498

497499
// monitor lifetime
498500
if (m_lifetimeLeft && --m_lifetimeLeft == 0)

0 commit comments

Comments
 (0)