summaryrefslogtreecommitdiffstats
path: root/src/render
diff options
context:
space:
mode:
Diffstat (limited to 'src/render')
-rw-r--r--src/render/Clouds.cpp8
-rw-r--r--src/render/Coronas.cpp20
-rw-r--r--src/render/Glass.cpp14
-rw-r--r--src/render/Hud.cpp8
-rw-r--r--src/render/ParticleMgr.cpp2
-rw-r--r--src/render/ParticleMgr.h78
-rw-r--r--src/render/ParticleType.h77
-rw-r--r--src/render/PointLights.cpp2
-rw-r--r--src/render/Rubbish.cpp4
-rw-r--r--src/render/Shadows.cpp26
-rw-r--r--src/render/Timecycle.cpp6
-rw-r--r--src/render/WaterCannon.cpp12
-rw-r--r--src/render/WaterLevel.cpp10
-rw-r--r--src/render/Weather.cpp6
14 files changed, 138 insertions, 135 deletions
diff --git a/src/render/Clouds.cpp b/src/render/Clouds.cpp
index 58dc3f93..cb08a997 100644
--- a/src/render/Clouds.cpp
+++ b/src/render/Clouds.cpp
@@ -388,7 +388,7 @@ CClouds::RenderBackground(int16 topred, int16 topgreen, int16 topblue,
ms_colourBottom.b = topblue;
ms_colourBottom.a = alpha;
- botpos = min(SCREEN_HEIGHT, topedge);
+ botpos = Min(SCREEN_HEIGHT, topedge);
CSprite2d::DrawRect(CRect(0, 0, SCREEN_WIDTH, botpos),
ms_colourBottom, ms_colourBottom, ms_colourTop, ms_colourTop);
}
@@ -415,18 +415,18 @@ CClouds::RenderHorizon(void)
if(ms_horizonZ > SCREEN_HEIGHT)
return;
- float z1 = min(ms_horizonZ + SMALLSTRIPHEIGHT, SCREEN_HEIGHT);
+ float z1 = Min(ms_horizonZ + SMALLSTRIPHEIGHT, SCREEN_HEIGHT);
CSprite2d::DrawRectXLU(CRect(0, ms_horizonZ, SCREEN_WIDTH, z1),
ms_colourBottom, ms_colourBottom, ms_colourTop, ms_colourTop);
// This is just weird
float a = SCREEN_HEIGHT/400.0f * HORIZSTRIPHEIGHT +
- SCREEN_HEIGHT/300.0f * max(TheCamera.GetPosition().z, 0.0f);
+ SCREEN_HEIGHT/300.0f * Max(TheCamera.GetPosition().z, 0.0f);
float b = TheCamera.GetUp().z < 0.0f ?
SCREEN_HEIGHT :
SCREEN_HEIGHT * Abs(TheCamera.GetRight().z);
float z2 = z1 + (a + b)*TheCamera.LODDistMultiplier;
- z2 = min(z2, SCREEN_HEIGHT);
+ z2 = Min(z2, SCREEN_HEIGHT);
CSprite2d::DrawRect(CRect(0, z1, SCREEN_WIDTH, z2),
ms_colourBottom, ms_colourBottom, ms_colourTop, ms_colourTop);
}
diff --git a/src/render/Coronas.cpp b/src/render/Coronas.cpp
index b21e087b..de3b5c78 100644
--- a/src/render/Coronas.cpp
+++ b/src/render/Coronas.cpp
@@ -106,7 +106,7 @@ CCoronas::Update(void)
int i;
static int LastCamLook = 0;
- LightsMult = min(LightsMult + 0.03f * CTimer::GetTimeStep(), 1.0f);
+ LightsMult = Min(LightsMult + 0.03f * CTimer::GetTimeStep(), 1.0f);
int CamLook = 0;
if(TheCamera.Cams[TheCamera.ActiveCam].LookingLeft) CamLook |= 1;
@@ -118,7 +118,7 @@ CCoronas::Update(void)
if(LastCamLook != CamLook)
bChangeBrightnessImmediately = 3;
else
- bChangeBrightnessImmediately = max(bChangeBrightnessImmediately-1, 0);
+ bChangeBrightnessImmediately = Max(bChangeBrightnessImmediately-1, 0);
LastCamLook = CamLook;
for(i = 0; i < NUMCORONAS; i++)
@@ -305,7 +305,7 @@ CCoronas::Render(void)
// render corona itself
if(aCoronas[i].texture){
- float fogscale = CWeather::Foggyness*min(spriteCoors.z, 40.0f)/40.0f + 1.0f;
+ float fogscale = CWeather::Foggyness*Min(spriteCoors.z, 40.0f)/40.0f + 1.0f;
if(CCoronas::aCoronas[i].id == SUN_CORE)
spriteCoors.z = 0.95f * RwCameraGetFarClipPlane(Scene.camera);
RwRenderStateSet(rwRENDERSTATETEXTURERASTER, RwTextureGetRaster(aCoronas[i].texture));
@@ -316,7 +316,7 @@ CCoronas::Render(void)
float f = 1.0f - aCoronas[i].someAngle*2.0f/PI;
float wscale = 6.0f*sq(sq(sq(f))) + 0.5f;
float hscale = 0.35f - (wscale - 0.5f) * 0.06f;
- hscale = max(hscale, 0.15f);
+ hscale = Max(hscale, 0.15f);
CSprite::RenderOneXLUSprite(spriteCoors.x, spriteCoors.y, spriteCoors.z,
spritew * aCoronas[i].size * wscale,
@@ -466,7 +466,7 @@ CCoronas::RenderReflections(void)
float spritew, spriteh;
if(CSprite::CalcScreenCoors(coors, spriteCoors, &spritew, &spriteh, true)){
float drawDist = 0.75f * aCoronas[i].drawDist;
- drawDist = min(drawDist, 50.0f);
+ drawDist = Min(drawDist, 50.0f);
if(spriteCoors.z < drawDist){
float fadeDistance = drawDist / 2.0f;
float distanceFade = spriteCoors.z < fadeDistance ? 1.0f : 1.0f - (spriteCoors.z - fadeDistance)/fadeDistance;
@@ -545,25 +545,25 @@ CRegisteredCorona::Update(void)
(CCoronas::SunBlockedByClouds && id == CCoronas::SUN_CORONA ||
!CWorld::GetIsLineOfSightClear(coors, TheCamera.GetPosition(), true, false, false, false, false, false))){
// Corona is blocked, fade out
- fadeAlpha = max(fadeAlpha - 15.0f*CTimer::GetTimeStep(), 0.0f);
+ fadeAlpha = Max(fadeAlpha - 15.0f*CTimer::GetTimeStep(), 0.0f);
}else if(offScreen){
// Same when off screen
- fadeAlpha = max(fadeAlpha - 15.0f*CTimer::GetTimeStep(), 0.0f);
+ fadeAlpha = Max(fadeAlpha - 15.0f*CTimer::GetTimeStep(), 0.0f);
}else{
// Visible
if(alpha > fadeAlpha){
// fade in
- fadeAlpha = min(fadeAlpha + 15.0f*CTimer::GetTimeStep(), alpha);
+ fadeAlpha = Min(fadeAlpha + 15.0f*CTimer::GetTimeStep(), alpha);
if(CCoronas::bChangeBrightnessImmediately)
fadeAlpha = alpha;
}else if(alpha < fadeAlpha){
// too visible, decrease alpha but not below alpha
- fadeAlpha = max(fadeAlpha - 15.0f*CTimer::GetTimeStep(), alpha);
+ fadeAlpha = Max(fadeAlpha - 15.0f*CTimer::GetTimeStep(), alpha);
}
// darken scene when the sun is visible
if(id == CCoronas::SUN_CORONA)
- CCoronas::LightsMult = max(CCoronas::LightsMult - CTimer::GetTimeStep()*0.06f, 0.6f);
+ CCoronas::LightsMult = Max(CCoronas::LightsMult - CTimer::GetTimeStep()*0.06f, 0.6f);
}
// remove if invisible
diff --git a/src/render/Glass.cpp b/src/render/Glass.cpp
index 33e22c87..9a4dbcfe 100644
--- a/src/render/Glass.cpp
+++ b/src/render/Glass.cpp
@@ -6,7 +6,7 @@
#include "General.h"
#include "AudioScriptObject.h"
#include "World.h"
-#include "TimeCycle.h"
+#include "Timecycle.h"
#include "Particle.h"
#include "Camera.h"
#include "RenderBuffer.h"
@@ -617,12 +617,12 @@ CGlass::WindowRespondsToCollision(CEntity *entity, float amount, CVector speed,
CVector c = object->GetMatrix() * col->vertices[2];
CVector d = object->GetMatrix() * col->vertices[3];
- float minx = min(min(a.x, b.x), min(c.x, d.x));
- float maxx = max(max(a.x, b.x), max(c.x, d.x));
- float miny = min(min(a.y, b.y), min(c.y, d.y));
- float maxy = max(max(a.y, b.y), max(c.y, d.y));
- float minz = min(min(a.z, b.z), min(c.z, d.z));
- float maxz = max(max(a.z, b.z), max(c.z, d.z));
+ float minx = Min(Min(a.x, b.x), Min(c.x, d.x));
+ float maxx = Max(Max(a.x, b.x), Max(c.x, d.x));
+ float miny = Min(Min(a.y, b.y), Min(c.y, d.y));
+ float maxy = Max(Max(a.y, b.y), Max(c.y, d.y));
+ float minz = Min(Min(a.z, b.z), Min(c.z, d.z));
+ float maxz = Max(Max(a.z, b.z), Max(c.z, d.z));
if ( amount > 300.0f )
diff --git a/src/render/Hud.cpp b/src/render/Hud.cpp
index 137b1afa..f88d6b9c 100644
--- a/src/render/Hud.cpp
+++ b/src/render/Hud.cpp
@@ -136,7 +136,7 @@ void CHud::Draw()
if (DrawCrossHair || DrawCrossHairPC) {
RwRenderStateSet(rwRENDERSTATETEXTUREFILTER, (void *)rwFILTERLINEAR);
- SpriteBrightness = min(SpriteBrightness+1, 30);
+ SpriteBrightness = Min(SpriteBrightness+1, 30);
RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)FALSE);
@@ -715,7 +715,7 @@ void CHud::Draw()
} else {
int counter = atoi(CUserDisplay::OnscnTimer.m_sEntries[0].m_bCounterBuffer);
#ifdef FIX_BUGS
- counter = min(counter, 100);
+ counter = Min(counter, 100);
#endif
CSprite2d::DrawRect(CRect(SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET) - SCREEN_SCALE_X(100.0f) / 2 + SCREEN_SCALE_X(4.0f), SCREEN_SCALE_Y(132.0f) + SCREEN_SCALE_Y(8.0f), SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET) + SCREEN_SCALE_X(4.0f), SCREEN_SCALE_Y(132.0f) + SCREEN_SCALE_Y(11.0f) + SCREEN_SCALE_Y(8.0f)), CRGBA(0, 106, 164, 80));
CSprite2d::DrawRect(CRect(SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET) - SCREEN_SCALE_X(100.0f) / 2 + SCREEN_SCALE_X(4.0f), SCREEN_SCALE_Y(132.0f) + SCREEN_SCALE_Y(8.0f), SCREEN_SCALE_X(counter) / 2.0f + SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET + 50.0f) + SCREEN_SCALE_X(4.0f), SCREEN_SCALE_Y(132.0f) + SCREEN_SCALE_Y(11.0f) + SCREEN_SCALE_Y(8.0f)), CRGBA(0, 106, 164, 255));
@@ -1206,7 +1206,7 @@ void CHud::DrawAfterFade()
OddJob2On = 2;
}
else {
- fStep = min(40.0f, OddJob2XOffset / 6.0f);
+ fStep = Min(40.0f, OddJob2XOffset / 6.0f);
OddJob2XOffset = OddJob2XOffset - fStep;
}
break;
@@ -1217,7 +1217,7 @@ void CHud::DrawAfterFade()
}
break;
case 3:
- fStep = max(30.0f, OddJob2XOffset / 5.0f);
+ fStep = Max(30.0f, OddJob2XOffset / 5.0f);
OddJob2XOffset = OddJob2XOffset - fStep;
diff --git a/src/render/ParticleMgr.cpp b/src/render/ParticleMgr.cpp
index 4bfb6380..00391ac5 100644
--- a/src/render/ParticleMgr.cpp
+++ b/src/render/ParticleMgr.cpp
@@ -91,7 +91,7 @@ void cParticleSystemMgr::LoadParticleData()
break;
case CFG_PARAM_INITIAL_COLOR_VARIATION:
- entry->m_InitialColorVariation = min(atoi(value), 100);
+ entry->m_InitialColorVariation = Min(atoi(value), 100);
break;
case CFG_PARAM_FADE_DESTINATION_COLOR_R:
diff --git a/src/render/ParticleMgr.h b/src/render/ParticleMgr.h
index 605e69fe..0b4091de 100644
--- a/src/render/ParticleMgr.h
+++ b/src/render/ParticleMgr.h
@@ -1,82 +1,8 @@
#pragma once
-class CParticle;
+#include "ParticleType.h"
-enum tParticleType
-{
- PARTICLE_SPARK = 0,
- PARTICLE_SPARK_SMALL,
- PARTICLE_WHEEL_DIRT,
- PARTICLE_WHEEL_WATER,
- PARTICLE_BLOOD,
- PARTICLE_BLOOD_SMALL,
- PARTICLE_BLOOD_SPURT,
- PARTICLE_DEBRIS,
- PARTICLE_DEBRIS2,
- PARTICLE_WATER,
- PARTICLE_FLAME,
- PARTICLE_FIREBALL,
- PARTICLE_GUNFLASH,
- PARTICLE_GUNFLASH_NOANIM,
- PARTICLE_GUNSMOKE,
- PARTICLE_GUNSMOKE2,
- PARTICLE_SMOKE,
- PARTICLE_SMOKE_SLOWMOTION,
- PARTICLE_GARAGEPAINT_SPRAY,
- PARTICLE_SHARD,
- PARTICLE_SPLASH,
- PARTICLE_CARFLAME,
- PARTICLE_STEAM,
- PARTICLE_STEAM2,
- PARTICLE_STEAM_NY,
- PARTICLE_STEAM_NY_SLOWMOTION,
- PARTICLE_ENGINE_STEAM,
- PARTICLE_RAINDROP,
- PARTICLE_RAINDROP_SMALL,
- PARTICLE_RAIN_SPLASH,
- PARTICLE_RAIN_SPLASH_BIGGROW,
- PARTICLE_RAIN_SPLASHUP,
- PARTICLE_WATERSPRAY,
- PARTICLE_EXPLOSION_MEDIUM,
- PARTICLE_EXPLOSION_LARGE,
- PARTICLE_EXPLOSION_MFAST,
- PARTICLE_EXPLOSION_LFAST,
- PARTICLE_CAR_SPLASH,
- PARTICLE_BOAT_SPLASH,
- PARTICLE_BOAT_THRUSTJET,
- PARTICLE_BOAT_WAKE,
- PARTICLE_WATER_HYDRANT,
- PARTICLE_WATER_CANNON,
- PARTICLE_EXTINGUISH_STEAM,
- PARTICLE_PED_SPLASH,
- PARTICLE_PEDFOOT_DUST,
- PARTICLE_HELI_DUST,
- PARTICLE_HELI_ATTACK,
- PARTICLE_ENGINE_SMOKE,
- PARTICLE_ENGINE_SMOKE2,
- PARTICLE_CARFLAME_SMOKE,
- PARTICLE_FIREBALL_SMOKE,
- PARTICLE_PAINT_SMOKE,
- PARTICLE_TREE_LEAVES,
- PARTICLE_CARCOLLISION_DUST,
- PARTICLE_CAR_DEBRIS,
- PARTICLE_HELI_DEBRIS,
- PARTICLE_EXHAUST_FUMES,
- PARTICLE_RUBBER_SMOKE,
- PARTICLE_BURNINGRUBBER_SMOKE,
- PARTICLE_BULLETHIT_SMOKE,
- PARTICLE_GUNSHELL_FIRST,
- PARTICLE_GUNSHELL,
- PARTICLE_GUNSHELL_BUMP1,
- PARTICLE_GUNSHELL_BUMP2,
- PARTICLE_TEST,
- PARTICLE_BIRD_FRONT,
- PARTICLE_RAINDROP_2D,
-
- MAX_PARTICLES,
- PARTICLE_FIRST = PARTICLE_SPARK,
- PARTICLE_LAST = PARTICLE_RAINDROP_2D
-};
+class CParticle;
enum
{
diff --git a/src/render/ParticleType.h b/src/render/ParticleType.h
new file mode 100644
index 00000000..8d352c44
--- /dev/null
+++ b/src/render/ParticleType.h
@@ -0,0 +1,77 @@
+#pragma once
+
+enum tParticleType
+{
+ PARTICLE_SPARK = 0,
+ PARTICLE_SPARK_SMALL,
+ PARTICLE_WHEEL_DIRT,
+ PARTICLE_WHEEL_WATER,
+ PARTICLE_BLOOD,
+ PARTICLE_BLOOD_SMALL,
+ PARTICLE_BLOOD_SPURT,
+ PARTICLE_DEBRIS,
+ PARTICLE_DEBRIS2,
+ PARTICLE_WATER,
+ PARTICLE_FLAME,
+ PARTICLE_FIREBALL,
+ PARTICLE_GUNFLASH,
+ PARTICLE_GUNFLASH_NOANIM,
+ PARTICLE_GUNSMOKE,
+ PARTICLE_GUNSMOKE2,
+ PARTICLE_SMOKE,
+ PARTICLE_SMOKE_SLOWMOTION,
+ PARTICLE_GARAGEPAINT_SPRAY,
+ PARTICLE_SHARD,
+ PARTICLE_SPLASH,
+ PARTICLE_CARFLAME,
+ PARTICLE_STEAM,
+ PARTICLE_STEAM2,
+ PARTICLE_STEAM_NY,
+ PARTICLE_STEAM_NY_SLOWMOTION,
+ PARTICLE_ENGINE_STEAM,
+ PARTICLE_RAINDROP,
+ PARTICLE_RAINDROP_SMALL,
+ PARTICLE_RAIN_SPLASH,
+ PARTICLE_RAIN_SPLASH_BIGGROW,
+ PARTICLE_RAIN_SPLASHUP,
+ PARTICLE_WATERSPRAY,
+ PARTICLE_EXPLOSION_MEDIUM,
+ PARTICLE_EXPLOSION_LARGE,
+ PARTICLE_EXPLOSION_MFAST,
+ PARTICLE_EXPLOSION_LFAST,
+ PARTICLE_CAR_SPLASH,
+ PARTICLE_BOAT_SPLASH,
+ PARTICLE_BOAT_THRUSTJET,
+ PARTICLE_BOAT_WAKE,
+ PARTICLE_WATER_HYDRANT,
+ PARTICLE_WATER_CANNON,
+ PARTICLE_EXTINGUISH_STEAM,
+ PARTICLE_PED_SPLASH,
+ PARTICLE_PEDFOOT_DUST,
+ PARTICLE_HELI_DUST,
+ PARTICLE_HELI_ATTACK,
+ PARTICLE_ENGINE_SMOKE,
+ PARTICLE_ENGINE_SMOKE2,
+ PARTICLE_CARFLAME_SMOKE,
+ PARTICLE_FIREBALL_SMOKE,
+ PARTICLE_PAINT_SMOKE,
+ PARTICLE_TREE_LEAVES,
+ PARTICLE_CARCOLLISION_DUST,
+ PARTICLE_CAR_DEBRIS,
+ PARTICLE_HELI_DEBRIS,
+ PARTICLE_EXHAUST_FUMES,
+ PARTICLE_RUBBER_SMOKE,
+ PARTICLE_BURNINGRUBBER_SMOKE,
+ PARTICLE_BULLETHIT_SMOKE,
+ PARTICLE_GUNSHELL_FIRST,
+ PARTICLE_GUNSHELL,
+ PARTICLE_GUNSHELL_BUMP1,
+ PARTICLE_GUNSHELL_BUMP2,
+ PARTICLE_TEST,
+ PARTICLE_BIRD_FRONT,
+ PARTICLE_RAINDROP_2D,
+
+ MAX_PARTICLES,
+ PARTICLE_FIRST = PARTICLE_SPARK,
+ PARTICLE_LAST = PARTICLE_RAINDROP_2D
+}; \ No newline at end of file
diff --git a/src/render/PointLights.cpp b/src/render/PointLights.cpp
index 55be40b2..b92e7e83 100644
--- a/src/render/PointLights.cpp
+++ b/src/render/PointLights.cpp
@@ -98,7 +98,7 @@ CPointLights::GenerateLightsAffectingObject(CVector *objCoors)
if(aLights[i].type == LIGHT_DIRECTIONAL){
float dot = -DotProduct(dir, aLights[i].dir);
- intensity *= max((dot-0.5f)*2.0f, 0.0f);
+ intensity *= Max((dot-0.5f)*2.0f, 0.0f);
}
if(intensity > 0.0f)
diff --git a/src/render/Rubbish.cpp b/src/render/Rubbish.cpp
index 31110046..d21dd558 100644
--- a/src/render/Rubbish.cpp
+++ b/src/render/Rubbish.cpp
@@ -217,9 +217,9 @@ CRubbish::Update(void)
// FRAMETIME
if(bRubbishInvisible)
- RubbishVisibility = max(RubbishVisibility-5, 0);
+ RubbishVisibility = Max(RubbishVisibility-5, 0);
else
- RubbishVisibility = min(RubbishVisibility+5, 255);
+ RubbishVisibility = Min(RubbishVisibility+5, 255);
// Spawn a new sheet
COneSheet *sheet = StartEmptyList.m_next;
diff --git a/src/render/Shadows.cpp b/src/render/Shadows.cpp
index 330f1b06..319cdd3c 100644
--- a/src/render/Shadows.cpp
+++ b/src/render/Shadows.cpp
@@ -719,10 +719,10 @@ CShadows::RenderStoredShadows(void)
float fStartY = shadowPos.y - fHeight;
float fEndY = shadowPos.y + fHeight;
- int32 nStartX = max(CWorld::GetSectorIndexX(fStartX), 0);
- int32 nStartY = max(CWorld::GetSectorIndexY(fStartY), 0);
- int32 nEndX = min(CWorld::GetSectorIndexX(fEndX), NUMSECTORS_X-1);
- int32 nEndY = min(CWorld::GetSectorIndexY(fEndY), NUMSECTORS_Y-1);
+ int32 nStartX = Max(CWorld::GetSectorIndexX(fStartX), 0);
+ int32 nStartY = Max(CWorld::GetSectorIndexY(fStartY), 0);
+ int32 nEndX = Min(CWorld::GetSectorIndexX(fEndX), NUMSECTORS_X-1);
+ int32 nEndY = Min(CWorld::GetSectorIndexY(fEndY), NUMSECTORS_Y-1);
CWorld::AdvanceCurrentScanCode();
@@ -865,10 +865,10 @@ CShadows::GeneratePolysForStaticShadow(int16 nStaticShadowID)
float fStartY = shadowPos.y - fHeight;
float fEndY = shadowPos.y + fHeight;
- int32 nStartX = max(CWorld::GetSectorIndexX(fStartX), 0);
- int32 nStartY = max(CWorld::GetSectorIndexY(fStartY), 0);
- int32 nEndX = min(CWorld::GetSectorIndexX(fEndX), NUMSECTORS_X-1);
- int32 nEndY = min(CWorld::GetSectorIndexY(fEndY), NUMSECTORS_Y-1);
+ int32 nStartX = Max(CWorld::GetSectorIndexX(fStartX), 0);
+ int32 nStartY = Max(CWorld::GetSectorIndexY(fStartY), 0);
+ int32 nEndX = Min(CWorld::GetSectorIndexX(fEndX), NUMSECTORS_X-1);
+ int32 nEndY = Min(CWorld::GetSectorIndexY(fEndY), NUMSECTORS_Y-1);
CWorld::AdvanceCurrentScanCode();
@@ -1008,11 +1008,11 @@ CShadows::CastShadowEntity(CEntity *pEntity, float fStartX, float fStartY, floa
Points[3].x = (fLengthRight - fFrontRight) - fSideRight;
Points[3].y = (fLengthForward - fFrontForward) - fSideForward;
- float MinX = min(min(Points[0].x, Points[1].x), min(Points[2].x, Points[3].x));
- float MaxX = max(max(Points[0].x, Points[1].x), max(Points[2].x, Points[3].x));
+ float MinX = Min(Min(Points[0].x, Points[1].x), Min(Points[2].x, Points[3].x));
+ float MaxX = Max(Max(Points[0].x, Points[1].x), Max(Points[2].x, Points[3].x));
- float MinY = min(min(Points[0].y, Points[1].y), min(Points[2].y, Points[3].y));
- float MaxY = max(max(Points[0].y, Points[1].y), max(Points[2].y, Points[3].y));
+ float MinY = Min(Min(Points[0].y, Points[1].y), Min(Points[2].y, Points[3].y));
+ float MaxY = Max(Max(Points[0].y, Points[1].y), Max(Points[2].y, Points[3].y));
float MaxZ = pPosn->z - pEntity->GetPosition().z;
float MinZ = MaxZ - fZDistance;
@@ -1763,7 +1763,7 @@ CShadows::RenderIndicatorShadow(uint32 nID, uint8 ShadowType, RwTexture *pTextur
{
ASSERT(pPosn != NULL);
- C3dMarkers::PlaceMarkerSet(nID, _TODOCONST(4), *pPosn, max(fFrontX, -fSideY),
+ C3dMarkers::PlaceMarkerSet(nID, _TODOCONST(4), *pPosn, Max(fFrontX, -fSideY),
0, 128, 255, 128,
2048, 0.2f, 0);
}
diff --git a/src/render/Timecycle.cpp b/src/render/Timecycle.cpp
index e47015a0..cf3426d7 100644
--- a/src/render/Timecycle.cpp
+++ b/src/render/Timecycle.cpp
@@ -290,7 +290,7 @@ CTimeCycle::Update(void)
TheCamera.SetMotionBlur(m_fCurrentBlurRed, m_fCurrentBlurGreen, m_fCurrentBlurBlue, m_fCurrentBlurAlpha, MBLUR_NORMAL);
if(m_FogReduction != 0)
- m_fCurrentFarClip = max(m_fCurrentFarClip, m_FogReduction/64.0f * 650.0f);
+ m_fCurrentFarClip = Max(m_fCurrentFarClip, m_FogReduction/64.0f * 650.0f);
m_nCurrentFogColourRed = (m_nCurrentSkyTopRed + 2*m_nCurrentSkyBottomRed) / 3;
m_nCurrentFogColourGreen = (m_nCurrentSkyTopGreen + 2*m_nCurrentSkyBottomGreen) / 3;
m_nCurrentFogColourBlue = (m_nCurrentSkyTopBlue + 2*m_nCurrentSkyBottomBlue) / 3;
@@ -311,7 +311,7 @@ CTimeCycle::Update(void)
if(TheCamera.GetForward().z < -0.9f ||
!CWeather::bScriptsForceRain && (CCullZones::PlayerNoRain() || CCullZones::CamNoRain() || CCutsceneMgr::IsRunning()))
- m_FogReduction = min(m_FogReduction+1, 64);
+ m_FogReduction = Min(m_FogReduction+1, 64);
else
- m_FogReduction = max(m_FogReduction-1, 0);
+ m_FogReduction = Max(m_FogReduction-1, 0);
}
diff --git a/src/render/WaterCannon.cpp b/src/render/WaterCannon.cpp
index 1a9b983f..2ef10d77 100644
--- a/src/render/WaterCannon.cpp
+++ b/src/render/WaterCannon.cpp
@@ -195,14 +195,14 @@ void CWaterCannon::PushPeds(void)
{
if ( m_abUsed[i] )
{
- minx = min(minx, m_avecPos[i].x);
- maxx = max(maxx, m_avecPos[i].x);
+ minx = Min(minx, m_avecPos[i].x);
+ maxx = Max(maxx, m_avecPos[i].x);
- miny = min(miny, m_avecPos[i].y);
- maxy = max(maxy, m_avecPos[i].y);
+ miny = Min(miny, m_avecPos[i].y);
+ maxy = Max(maxy, m_avecPos[i].y);
- minz = min(minz, m_avecPos[i].z);
- maxz = max(maxz, m_avecPos[i].z);
+ minz = Min(minz, m_avecPos[i].z);
+ maxz = Max(maxz, m_avecPos[i].z);
}
}
diff --git a/src/render/WaterLevel.cpp b/src/render/WaterLevel.cpp
index ad0b3ec4..d7035ab1 100644
--- a/src/render/WaterLevel.cpp
+++ b/src/render/WaterLevel.cpp
@@ -979,7 +979,7 @@ CWaterLevel::RenderOneWavySector(float fX, float fY, float fZ, RwRGBA const &col
SMALL_SECTOR_SIZE / 2,
apBoatList) )
{
- float fWakeColor = fAdd1 - max(255.0f - float(color.blue + color.red + color.green) / 3, fAdd2);
+ float fWakeColor = fAdd1 - Max(255.0f - float(color.blue + color.red + color.green) / 3, fAdd2);
RpGeometry *wavyGeometry = RpAtomicGetGeometry(ms_pWavyAtomic);
RpGeometry *geom = apGeomArray[nGeomUsed++];
@@ -1035,9 +1035,9 @@ CWaterLevel::RenderOneWavySector(float fX, float fY, float fZ, RwRGBA const &col
RwRGBAAssign(&wakeColor, &color);
- wakeColor.red = min(color.red + int32(fWakeColor * fRedMult * fDistMult), 255);
- wakeColor.green = min(color.green + int32(fWakeColor * fGreenMult * fDistMult), 255);
- wakeColor.blue = min(color.blue + int32(fWakeColor * fBlueMult * fDistMult), 255);
+ wakeColor.red = Min(color.red + int32(fWakeColor * fRedMult * fDistMult), 255);
+ wakeColor.green = Min(color.green + int32(fWakeColor * fGreenMult * fDistMult), 255);
+ wakeColor.blue = Min(color.blue + int32(fWakeColor * fBlueMult * fDistMult), 255);
RwRGBAAssign(&geomPreLights[9*i+j], &wakeColor);
@@ -1114,7 +1114,7 @@ CWaterLevel::CalcDistanceToWater(float fX, float fY)
fSectorY + SMALL_SECTOR_SIZE - fY
);
- fDistSqr = min(vecDist.MagnitudeSqr(), fDistSqr);
+ fDistSqr = Min(vecDist.MagnitudeSqr(), fDistSqr);
}
}
}
diff --git a/src/render/Weather.cpp b/src/render/Weather.cpp
index 8bc544c6..b4031705 100644
--- a/src/render/Weather.cpp
+++ b/src/render/Weather.cpp
@@ -163,7 +163,7 @@ void CWeather::Update(void)
else {
// 0.125 probability
LightningBurst = false;
- LightningDuration = min(CTimer::GetFrameCounter() - LightningStart, 20);
+ LightningDuration = Min(CTimer::GetFrameCounter() - LightningStart, 20);
LightningFlash = false;
WhenToPlayLightningSound = CTimer::GetTimeInMilliseconds() + 150 * (20 - LightningDuration);
}
@@ -219,9 +219,9 @@ void CWeather::Update(void)
fNewRain = 0.0f;
if (Rain != fNewRain) { // ok to use comparasion
if (Rain < fNewRain)
- Rain = min(fNewRain, Rain + RAIN_CHANGE_SPEED * CTimer::GetTimeStep());
+ Rain = Min(fNewRain, Rain + RAIN_CHANGE_SPEED * CTimer::GetTimeStep());
else
- Rain = max(fNewRain, Rain - RAIN_CHANGE_SPEED * CTimer::GetTimeStep());
+ Rain = Max(fNewRain, Rain - RAIN_CHANGE_SPEED * CTimer::GetTimeStep());
}
// Clouds