summaryrefslogtreecommitdiffstats
path: root/src/render
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/render/Coronas.cpp2
-rw-r--r--src/render/Fluff.cpp2
-rw-r--r--src/render/Glass.cpp4
-rw-r--r--src/render/Hud.cpp2
-rw-r--r--src/render/MBlur.cpp18
-rw-r--r--src/render/Particle.cpp16
-rw-r--r--src/render/Sprite.cpp8
-rw-r--r--src/render/WaterLevel.cpp40
-rw-r--r--src/render/Weather.cpp2
9 files changed, 47 insertions, 47 deletions
diff --git a/src/render/Coronas.cpp b/src/render/Coronas.cpp
index 8b137aad..d9bf88d1 100644
--- a/src/render/Coronas.cpp
+++ b/src/render/Coronas.cpp
@@ -493,7 +493,7 @@ CCoronas::RenderReflections(void)
if(spriteCoors.z < drawDist){
float fadeDistance = drawDist / 2.0f;
float distanceFade = spriteCoors.z < fadeDistance ? 1.0f : 1.0f - (spriteCoors.z - fadeDistance)/fadeDistance;
- distanceFade = clamp(distanceFade, 0.0f, 1.0f);
+ distanceFade = Clamp(distanceFade, 0.0f, 1.0f);
float recipz = 1.0f/RwCameraGetNearClipPlane(Scene.camera);
float heightFade = (20.0f - aCoronas[i].heightAboveRoad)/20.0f;
int intensity = distanceFade*heightFade * 230.0 * CWeather::WetRoads;
diff --git a/src/render/Fluff.cpp b/src/render/Fluff.cpp
index f2d6d0b3..13dba1a6 100644
--- a/src/render/Fluff.cpp
+++ b/src/render/Fluff.cpp
@@ -1155,7 +1155,7 @@ void CScriptPath::Update(void) {
return;
m_fPosition += m_fSpeed * CTimer::GetTimeStepInSeconds();
- m_fPosition = clamp(m_fPosition, 0.0f, m_fTotalLength);
+ m_fPosition = Clamp(m_fPosition, 0.0f, m_fTotalLength);
if (m_pObjects[0] || m_pObjects[1] || m_pObjects[2] || m_pObjects[3]
|| m_pObjects[4] || m_pObjects[5]) {
diff --git a/src/render/Glass.cpp b/src/render/Glass.cpp
index 3409a058..b4ec8c7e 100644
--- a/src/render/Glass.cpp
+++ b/src/render/Glass.cpp
@@ -151,9 +151,9 @@ CFallingGlassPane::Render(void)
uint8 alpha = CGlass::CalcAlphaWithNormal(&fwdNorm);
#ifdef FIX_BUGS
- uint16 time = clamp(CTimer::GetTimeInMilliseconds() > m_nTimer ? CTimer::GetTimeInMilliseconds() - m_nTimer : 0u, 0u, 500u);
+ uint16 time = Clamp(CTimer::GetTimeInMilliseconds() > m_nTimer ? CTimer::GetTimeInMilliseconds() - m_nTimer : 0u, 0u, 500u);
#else
- uint16 time = clamp(CTimer::GetTimeInMilliseconds() - m_nTimer, 0, 500);
+ uint16 time = Clamp(CTimer::GetTimeInMilliseconds() - m_nTimer, 0, 500);
#endif
uint8 color = int32( float(alpha) * (float(time) / 500) );
diff --git a/src/render/Hud.cpp b/src/render/Hud.cpp
index 91503917..33f33358 100644
--- a/src/render/Hud.cpp
+++ b/src/render/Hud.cpp
@@ -2070,7 +2070,7 @@ float CHud::DrawFadeState(DRAW_FADE_STATE fadingElement, int forceFadingIn)
break;
}
- return clamp(alpha, 0.0f, 255.0f);
+ return Clamp(alpha, 0.0f, 255.0f);
}
void
diff --git a/src/render/MBlur.cpp b/src/render/MBlur.cpp
index 9f5122dc..cc8270ce 100644
--- a/src/render/MBlur.cpp
+++ b/src/render/MBlur.cpp
@@ -283,10 +283,10 @@ CMBlur::CreateImmediateModeData(RwCamera *cam, RwRect *rect, RwIm2DVertex *verts
v1 = y1/height + v1Off;
u2 = x2/width + u2Off;
v2 = y2/height + v2Off;
- u1 = clamp(u1, 0.0f, 1.0f);
- v1 = clamp(v1, 0.0f, 1.0f);
- u2 = clamp(u2, 0.0f, 1.0f);
- v2 = clamp(v2, 0.0f, 1.0f);
+ u1 = Clamp(u1, 0.0f, 1.0f);
+ v1 = Clamp(v1, 0.0f, 1.0f);
+ u2 = Clamp(u2, 0.0f, 1.0f);
+ v2 = Clamp(v2, 0.0f, 1.0f);
}
float recipz = 1.0f/z;
@@ -517,7 +517,7 @@ CMBlur::OverlayRender(RwCamera *cam, RwRaster *raster, RwRGBA color, int32 type,
void
CMBlur::SetDrunkBlur(float drunkness)
{
- Drunkness = clamp(drunkness, 0.0f, 1.0f);
+ Drunkness = Clamp(drunkness, 0.0f, 1.0f);
}
void
@@ -598,9 +598,9 @@ CMBlur::OverlayRenderFx(RwCamera *cam, RwRaster *frontBuf)
int red = (0.75f*CTimeCycle::GetDirectionalRed() + CTimeCycle::GetAmbientRed())*0.55f * 255;
int green = (0.75f*CTimeCycle::GetDirectionalGreen() + CTimeCycle::GetAmbientGreen())*0.55f * 255;
int blue = (0.75f*CTimeCycle::GetDirectionalBlue() + CTimeCycle::GetAmbientBlue())*0.55f * 255;
- red = clamp(red, 0, 255);
- green = clamp(green, 0, 255);
- blue = clamp(blue, 0, 255);
+ red = Clamp(red, 0, 255);
+ green = Clamp(green, 0, 255);
+ blue = Clamp(blue, 0, 255);
RwRenderStateSet(rwRENDERSTATEZTESTENABLE, (void*)TRUE);
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)TRUE);
@@ -695,7 +695,7 @@ CMBlur::OverlayRenderFx(RwCamera *cam, RwRaster *frontBuf)
int alpha = FrontEndMenuManager.m_PrefsBrightness > 255 ?
FrontEndMenuManager.m_PrefsBrightness - 90 :
FrontEndMenuManager.m_PrefsBrightness - 130;
- alpha = clamp(alpha, 16, 200)/2;
+ alpha = Clamp(alpha, 16, 200)/2;
CreateImmediateModeData(cam, &fxRect[i], verts, CRGBA(0, 0, 0, alpha), 0.0f, 0.0f, 0.0f, 0.0f, fxZ[i], true);
RwRenderStateSet(rwRENDERSTATETEXTURERASTER, gpHeatHazeRaster);
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 )
{
diff --git a/src/render/Sprite.cpp b/src/render/Sprite.cpp
index ba6ab291..58b29ea9 100644
--- a/src/render/Sprite.cpp
+++ b/src/render/Sprite.cpp
@@ -401,13 +401,13 @@ CSprite::RenderBufferedOneXLUSprite_Rotate_2Colours(float x, float y, float z, f
// Colour factors, cx/y is the direction in which colours change from rgb1 to rgb2
cf[0] = (cx*(-c-s) + cy*(-c+s))*0.5f + 0.5f;
- cf[0] = clamp(cf[0], 0.0f, 1.0f);
+ cf[0] = Clamp(cf[0], 0.0f, 1.0f);
cf[1] = (cx*(-c+s) + cy*( c+s))*0.5f + 0.5f;
- cf[1] = clamp(cf[1], 0.0f, 1.0f);
+ cf[1] = Clamp(cf[1], 0.0f, 1.0f);
cf[2] = (cx*( c+s) + cy*( c-s))*0.5f + 0.5f;
- cf[2] = clamp(cf[2], 0.0f, 1.0f);
+ cf[2] = Clamp(cf[2], 0.0f, 1.0f);
cf[3] = (cx*( c-s) + cy*(-c-s))*0.5f + 0.5f;
- cf[3] = clamp(cf[3], 0.0f, 1.0f);
+ cf[3] = Clamp(cf[3], 0.0f, 1.0f);
float screenz = m_f2DNearScreenZ +
(z-CDraw::GetNearClipZ())*(m_f2DFarScreenZ-m_f2DNearScreenZ)*CDraw::GetFarClipZ() /
diff --git a/src/render/WaterLevel.cpp b/src/render/WaterLevel.cpp
index 16182137..dee60d66 100644
--- a/src/render/WaterLevel.cpp
+++ b/src/render/WaterLevel.cpp
@@ -179,10 +179,10 @@ CWaterLevel::Initialise(Const char *pWaterDat)
int32 t = WATER_HUGE_Y(ms_aWaterRects[i].top);
int32 b = WATER_HUGE_Y(ms_aWaterRects[i].bottom) + 1.0f;
- l = clamp(l, 0, MAX_SMALL_SECTORS - 1);
- r = clamp(r, 0, MAX_SMALL_SECTORS - 1);
- t = clamp(t, 0, MAX_SMALL_SECTORS - 1);
- b = clamp(b, 0, MAX_SMALL_SECTORS - 1);
+ l = Clamp(l, 0, MAX_SMALL_SECTORS - 1);
+ r = Clamp(r, 0, MAX_SMALL_SECTORS - 1);
+ t = Clamp(t, 0, MAX_SMALL_SECTORS - 1);
+ b = Clamp(b, 0, MAX_SMALL_SECTORS - 1);
for (int32 x = l; x <= r; x++)
{
@@ -991,10 +991,10 @@ CWaterLevel::RenderWater()
if ( bUseCamEndY )
nEndY = WATER_TO_HUGE_SECTOR_Y(camPos.y);
- nStartX = clamp(nStartX, 0, MAX_HUGE_SECTORS - 1);
- nEndX = clamp(nEndX, 0, MAX_HUGE_SECTORS - 1);
- nStartY = clamp(nStartY, 0, MAX_HUGE_SECTORS - 1);
- nEndY = clamp(nEndY, 0, MAX_HUGE_SECTORS - 1);
+ nStartX = Clamp(nStartX, 0, MAX_HUGE_SECTORS - 1);
+ nEndX = Clamp(nEndX, 0, MAX_HUGE_SECTORS - 1);
+ nStartY = Clamp(nStartY, 0, MAX_HUGE_SECTORS - 1);
+ nEndY = Clamp(nEndY, 0, MAX_HUGE_SECTORS - 1);
for ( int32 x = nStartX; x <= nEndX; x++ )
{
@@ -1259,10 +1259,10 @@ CWaterLevel::RenderTransparentWater(void)
if ( bUseCamEndY )
nEndY = WATER_TO_HUGE_SECTOR_Y(camPos.y );
- nStartX = clamp(nStartX, 0, MAX_HUGE_SECTORS - 1);
- nEndX = clamp(nEndX, 0, MAX_HUGE_SECTORS - 1);
- nStartY = clamp(nStartY, 0, MAX_HUGE_SECTORS - 1);
- nEndY = clamp(nEndY, 0, MAX_HUGE_SECTORS - 1);
+ nStartX = Clamp(nStartX, 0, MAX_HUGE_SECTORS - 1);
+ nEndX = Clamp(nEndX, 0, MAX_HUGE_SECTORS - 1);
+ nStartY = Clamp(nStartY, 0, MAX_HUGE_SECTORS - 1);
+ nEndY = Clamp(nEndY, 0, MAX_HUGE_SECTORS - 1);
for ( int32 x = nStartX; x <= nEndX; x++ )
@@ -2161,10 +2161,10 @@ CWaterLevel::PreCalcWaterGeometry(void)
float signX = CamFwdDir.x * 1.4144272f;
float signY = CamFwdDir.y * 1.4144272f;
- signX = clamp(signX, -1.0f, 1.0f);
+ signX = Clamp(signX, -1.0f, 1.0f);
fCamX += 0.4f * signX * float(SMALL_SECTOR_SIZE * 2.0f);
- signY = clamp(signY, -1.0f, 1.0f);
+ signY = Clamp(signY, -1.0f, 1.0f);
fCamY += 0.4f * signY * float(SMALL_SECTOR_SIZE * 2.0f);
int32 nBlock;
@@ -2578,7 +2578,7 @@ CWaterLevel::RenderBoatWakes(void)
float val = 500.0f - (CBoat::WAKE_LIFETIME - pBoat->m_afWakePointLifeTime[wake])
* 600.0f / CBoat::WAKE_LIFETIME;
- fAplhaB = clamp(val, 0.0f, 255.0f);
+ fAplhaB = Clamp(val, 0.0f, 255.0f);
}
CVector2D vecDistB = pBoat->m_avec2dWakePoints[wake - 1] - pBoat->m_avec2dWakePoints[wake];
@@ -2888,10 +2888,10 @@ CWaterLevel::CalcDistanceToWater(float fX, float fY)
int32 nStartY = WATER_TO_SMALL_SECTOR_Y(fY - fSectorMaxRenderDist) - 1;
int32 nEndY = WATER_TO_SMALL_SECTOR_Y(fY + fSectorMaxRenderDist) + 1;
- nStartX = clamp(nStartX, 0, MAX_SMALL_SECTORS - 1);
- nEndX = clamp(nEndX, 0, MAX_SMALL_SECTORS - 1);
- nStartY = clamp(nStartY, 0, MAX_SMALL_SECTORS - 1);
- nEndY = clamp(nEndY, 0, MAX_SMALL_SECTORS - 1);
+ nStartX = Clamp(nStartX, 0, MAX_SMALL_SECTORS - 1);
+ nEndX = Clamp(nEndX, 0, MAX_SMALL_SECTORS - 1);
+ nStartY = Clamp(nStartY, 0, MAX_SMALL_SECTORS - 1);
+ nEndY = Clamp(nEndY, 0, MAX_SMALL_SECTORS - 1);
float fDistSqr = 1.0e10f;
@@ -2915,7 +2915,7 @@ CWaterLevel::CalcDistanceToWater(float fX, float fY)
}
}
- return clamp(Sqrt(fDistSqr) - 23.0f, 0.0f, fSectorMaxRenderDist);
+ return Clamp(Sqrt(fDistSqr) - 23.0f, 0.0f, fSectorMaxRenderDist);
}
void
diff --git a/src/render/Weather.cpp b/src/render/Weather.cpp
index 4b4c0138..9f925a8c 100644
--- a/src/render/Weather.cpp
+++ b/src/render/Weather.cpp
@@ -281,7 +281,7 @@ void CWeather::Update(void)
if (SunGlare > 0.0f) {
SunGlare *= Min(1.0f, 7.0 * CTimeCycle::GetSunDirection().z);
- SunGlare = clamp(SunGlare, 0.0f, 1.0f);
+ SunGlare = Clamp(SunGlare, 0.0f, 1.0f);
if (!CSpecialFX::bSnapShotActive)
SunGlare *= (1.0f - (CGeneral::GetRandomNumber()&0x1F)*0.007f);
}