summaryrefslogtreecommitdiffstats
path: root/src/render/Particle.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/render/Particle.cpp')
-rw-r--r--src/render/Particle.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/render/Particle.cpp b/src/render/Particle.cpp
index 07e80abe..76ddde50 100644
--- a/src/render/Particle.cpp
+++ b/src/render/Particle.cpp
@@ -14,6 +14,7 @@
#include "ParticleObject.h"
#include "Particle.h"
#include "soundlist.h"
+#include "debugmenu.h"
#define MAX_PARTICLES_ON_SCREEN (1000)
@@ -879,15 +880,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);
}
@@ -1082,15 +1083,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);
}
@@ -1379,7 +1380,7 @@ void CParticle::Update()
{
particle->m_nFadeToBlackTimer = 0;
- particle->m_nColorIntensity = clamp(particle->m_nColorIntensity - psystem->m_nFadeToBlackAmount,
+ particle->m_nColorIntensity = Clamp(particle->m_nColorIntensity - psystem->m_nFadeToBlackAmount,
0, 255);
}
else
@@ -1392,7 +1393,7 @@ void CParticle::Update()
{
particle->m_nFadeAlphaTimer = 0;
- particle->m_nAlpha = clamp(particle->m_nAlpha - psystem->m_nFadeAlphaAmount,
+ particle->m_nAlpha = Clamp(particle->m_nAlpha - psystem->m_nFadeAlphaAmount,
0, 255);
#ifdef PC_PARTICLE
if ( particle->m_nAlpha == 0 )