diff options
Diffstat (limited to '')
-rw-r--r-- | src/render/Particle.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/render/Particle.cpp b/src/render/Particle.cpp index f6d48aef..461a10a6 100644 --- a/src/render/Particle.cpp +++ b/src/render/Particle.cpp @@ -971,15 +971,15 @@ CParticle *CParticle::AddParticle(tParticleType type, CVector const &vecPos, CVe int32 ColorVariation = CGeneral::GetRandomNumberInRange(-psystem->m_InitialColorVariation, psystem->m_InitialColorVariation); //float ColorVariation = CGeneral::GetRandomNumberInRange((float)-psystem->m_InitialColorVariation, (float)psystem->m_InitialColorVariation); - pParticle->m_Color.red = clamp(pParticle->m_Color.red + + pParticle->m_Color.red = Clamp(pParticle->m_Color.red + PERCENT(pParticle->m_Color.red, ColorVariation), 0, 255); - pParticle->m_Color.green = clamp(pParticle->m_Color.green + + pParticle->m_Color.green = Clamp(pParticle->m_Color.green + PERCENT(pParticle->m_Color.green, ColorVariation), 0, 255); - pParticle->m_Color.blue = clamp(pParticle->m_Color.blue + + pParticle->m_Color.blue = Clamp(pParticle->m_Color.blue + PERCENT(pParticle->m_Color.blue, ColorVariation), 0, 255); } @@ -1385,15 +1385,15 @@ void CParticle::Update() { float colorMul = 1.0f - float(particle->m_nTimeWhenColorWillBeChanged - CTimer::GetTimeInMilliseconds()) / float(psystem->m_ColorFadeTime); - particle->m_Color.red = clamp( + particle->m_Color.red = Clamp( psystem->m_RenderColouring.red + int32(float(psystem->m_FadeDestinationColor.red - psystem->m_RenderColouring.red) * colorMul), 0, 255); - particle->m_Color.green = clamp( + particle->m_Color.green = Clamp( psystem->m_RenderColouring.green + int32(float(psystem->m_FadeDestinationColor.green - psystem->m_RenderColouring.green) * colorMul), 0, 255); - particle->m_Color.blue = clamp( + particle->m_Color.blue = Clamp( psystem->m_RenderColouring.blue + int32(float(psystem->m_FadeDestinationColor.blue - psystem->m_RenderColouring.blue) * colorMul), 0, 255); } @@ -1703,13 +1703,13 @@ void CParticle::Update() if ( particle->m_nFadeToBlackTimer != 0 ) { - particle->m_nColorIntensity = clamp(particle->m_nColorIntensity - particle->m_nFadeToBlackTimer, + particle->m_nColorIntensity = Clamp(particle->m_nColorIntensity - particle->m_nFadeToBlackTimer, 0, 255); } if ( particle->m_nFadeAlphaTimer != 0 ) { - particle->m_nAlpha = clamp(particle->m_nAlpha - particle->m_nFadeAlphaTimer, + particle->m_nAlpha = Clamp(particle->m_nAlpha - particle->m_nFadeAlphaTimer, 0, 255); if ( particle->m_nAlpha == 0 ) { |