mirror of
https://github.com/alliedmodders/hl2sdk.git
synced 2024-12-23 01:59:43 +08:00
Fixed conflict between min/max macros and std::min/max when using GCC >= 4.2.
This commit is contained in:
parent
88dd2ac536
commit
7f4855ae1f
@ -748,7 +748,7 @@ float CFlexAnimationTrack::GetFracIntensity( float time, int type )
|
|||||||
CExpressionSample *esEnd = NULL;
|
CExpressionSample *esEnd = NULL;
|
||||||
|
|
||||||
// do binary search for sample in time period
|
// do binary search for sample in time period
|
||||||
int j = max( rampCount / 2, 1 );
|
int j = MAX( rampCount / 2, 1 );
|
||||||
int i = j;
|
int i = j;
|
||||||
while ( i > -2 && i < rampCount + 1 )
|
while ( i > -2 && i < rampCount + 1 )
|
||||||
{
|
{
|
||||||
@ -756,7 +756,7 @@ float CFlexAnimationTrack::GetFracIntensity( float time, int type )
|
|||||||
esStart = GetBoundedSample( i, dummy, type );
|
esStart = GetBoundedSample( i, dummy, type );
|
||||||
esEnd = GetBoundedSample( i + 1, dummy, type );
|
esEnd = GetBoundedSample( i + 1, dummy, type );
|
||||||
|
|
||||||
j = max( j / 2, 1 );
|
j = MAX( j / 2, 1 );
|
||||||
if ( time < esStart->time)
|
if ( time < esStart->time)
|
||||||
{
|
{
|
||||||
i -= j;
|
i -= j;
|
||||||
@ -785,8 +785,8 @@ float CFlexAnimationTrack::GetFracIntensity( float time, int type )
|
|||||||
int prev = i - 1;
|
int prev = i - 1;
|
||||||
int next = i + 2;
|
int next = i + 2;
|
||||||
|
|
||||||
prev = max( -1, prev );
|
prev = MAX( -1, prev );
|
||||||
next = min( next, rampCount );
|
next = MIN( next, rampCount );
|
||||||
|
|
||||||
bool clamp[ 2 ];
|
bool clamp[ 2 ];
|
||||||
CExpressionSample *esPre = GetBoundedSample( prev, clamp[ 0 ], type );
|
CExpressionSample *esPre = GetBoundedSample( prev, clamp[ 0 ], type );
|
||||||
@ -1590,7 +1590,7 @@ float CChoreoEvent::GetRampIntensity( ICurveDataAccessor *data, float time )
|
|||||||
CExpressionSample *esEnd = NULL;
|
CExpressionSample *esEnd = NULL;
|
||||||
|
|
||||||
// do binary search for sample in time period
|
// do binary search for sample in time period
|
||||||
int j = max( rampCount / 2, 1 );
|
int j = MAX( rampCount / 2, 1 );
|
||||||
int i = j;
|
int i = j;
|
||||||
while ( i > -2 && i < rampCount + 1 )
|
while ( i > -2 && i < rampCount + 1 )
|
||||||
{
|
{
|
||||||
@ -1598,7 +1598,7 @@ float CChoreoEvent::GetRampIntensity( ICurveDataAccessor *data, float time )
|
|||||||
esStart = data->CurveGetBoundedSample( i, dummy );
|
esStart = data->CurveGetBoundedSample( i, dummy );
|
||||||
esEnd = data->CurveGetBoundedSample( i + 1, dummy );
|
esEnd = data->CurveGetBoundedSample( i + 1, dummy );
|
||||||
|
|
||||||
j = max( j / 2, 1 );
|
j = MAX( j / 2, 1 );
|
||||||
if ( time < esStart->time)
|
if ( time < esStart->time)
|
||||||
{
|
{
|
||||||
i -= j;
|
i -= j;
|
||||||
@ -1621,8 +1621,8 @@ float CChoreoEvent::GetRampIntensity( ICurveDataAccessor *data, float time )
|
|||||||
int prev = i - 1;
|
int prev = i - 1;
|
||||||
int next = i + 2;
|
int next = i + 2;
|
||||||
|
|
||||||
prev = max( -1, prev );
|
prev = MAX( -1, prev );
|
||||||
next = min( next, rampCount );
|
next = MIN( next, rampCount );
|
||||||
|
|
||||||
bool clamp[ 2 ];
|
bool clamp[ 2 ];
|
||||||
CExpressionSample *esPre = data->CurveGetBoundedSample( prev, clamp[ 0 ] );
|
CExpressionSample *esPre = data->CurveGetBoundedSample( prev, clamp[ 0 ] );
|
||||||
@ -2938,10 +2938,10 @@ float CChoreoEvent::GetOriginalPercentageFromPlaybackPercentage( float t )
|
|||||||
int end = i + 1;
|
int end = i + 1;
|
||||||
int next = i + 2;
|
int next = i + 2;
|
||||||
|
|
||||||
prev = max( -2, prev );
|
prev = MAX( -2, prev );
|
||||||
start = max( -1, start );
|
start = MAX( -1, start );
|
||||||
end = min( end, count );
|
end = MIN( end, count );
|
||||||
next = min( next, count + 1 );
|
next = MIN( next, count + 1 );
|
||||||
|
|
||||||
CEventAbsoluteTag *pStartTag = NULL;
|
CEventAbsoluteTag *pStartTag = NULL;
|
||||||
CEventAbsoluteTag *pEndTag = NULL;
|
CEventAbsoluteTag *pEndTag = NULL;
|
||||||
@ -3064,10 +3064,10 @@ float CChoreoEvent::GetPlaybackPercentageFromOriginalPercentage( float t )
|
|||||||
int end = i + 1;
|
int end = i + 1;
|
||||||
int next = i + 2;
|
int next = i + 2;
|
||||||
|
|
||||||
prev = max( -2, prev );
|
prev = MAX( -2, prev );
|
||||||
start = max( -1, start );
|
start = MAX( -1, start );
|
||||||
end = min( end, count );
|
end = MIN( end, count );
|
||||||
next = min( next, count + 1 );
|
next = MIN( next, count + 1 );
|
||||||
|
|
||||||
CEventAbsoluteTag *pStartTag = NULL;
|
CEventAbsoluteTag *pStartTag = NULL;
|
||||||
CEventAbsoluteTag *pEndTag = NULL;
|
CEventAbsoluteTag *pEndTag = NULL;
|
||||||
@ -3218,7 +3218,7 @@ void CChoreoEvent::SetLoopCount( int numloops )
|
|||||||
{
|
{
|
||||||
Assert( GetType() == LOOP );
|
Assert( GetType() == LOOP );
|
||||||
// Never below -1
|
// Never below -1
|
||||||
m_nNumLoops = max( numloops, -1 );
|
m_nNumLoops = MAX( numloops, -1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@ -3433,14 +3433,14 @@ bool CChoreoEvent::PreventTagOverlap( void )
|
|||||||
{
|
{
|
||||||
tag->SetPercentage( minP );
|
tag->SetPercentage( minP );
|
||||||
|
|
||||||
minDp = min( 0.01, minP / (i + 1) );
|
minDp = MIN( 0.01, minP / (i + 1) );
|
||||||
bHadOverlap = true;
|
bHadOverlap = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
minP = tag->GetPercentage();
|
minP = tag->GetPercentage();
|
||||||
}
|
}
|
||||||
minP = max( minP - minDp, 0 );
|
minP = MAX( minP - minDp, 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
return bHadOverlap;
|
return bHadOverlap;
|
||||||
|
@ -460,7 +460,7 @@ void DrawSegs( int noise_divisions, float *prgNoise, const model_t* spritemodel,
|
|||||||
}
|
}
|
||||||
|
|
||||||
length = VectorLength( delta );
|
length = VectorLength( delta );
|
||||||
float flMaxWidth = max(startWidth, endWidth) * 0.5f;
|
float flMaxWidth = MAX(startWidth, endWidth) * 0.5f;
|
||||||
div = 1.0 / (segments-1);
|
div = 1.0 / (segments-1);
|
||||||
|
|
||||||
if ( length*div < flMaxWidth * 1.414 )
|
if ( length*div < flMaxWidth * 1.414 )
|
||||||
|
@ -510,7 +510,7 @@ void C_ClientRagdoll::FadeOut( void )
|
|||||||
int iAlpha = GetRenderColor().a;
|
int iAlpha = GetRenderColor().a;
|
||||||
int iFadeSpeed = ( g_RagdollLVManager.IsLowViolence() ) ? g_ragdoll_lvfadespeed.GetInt() : g_ragdoll_fadespeed.GetInt();
|
int iFadeSpeed = ( g_RagdollLVManager.IsLowViolence() ) ? g_ragdoll_lvfadespeed.GetInt() : g_ragdoll_fadespeed.GetInt();
|
||||||
|
|
||||||
iAlpha = max( iAlpha - ( iFadeSpeed * gpGlobals->frametime ), 0 );
|
iAlpha = MAX( iAlpha - ( iFadeSpeed * gpGlobals->frametime ), 0 );
|
||||||
|
|
||||||
SetRenderMode( kRenderTransAlpha );
|
SetRenderMode( kRenderTransAlpha );
|
||||||
SetRenderColorA( iAlpha );
|
SetRenderColorA( iAlpha );
|
||||||
@ -890,7 +890,7 @@ CStudioHdr *C_BaseAnimating::OnNewModel()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int boneControllerCount = min( hdr->numbonecontrollers(), ARRAYSIZE( m_flEncodedController ) );
|
int boneControllerCount = MIN( hdr->numbonecontrollers(), ARRAYSIZE( m_flEncodedController ) );
|
||||||
|
|
||||||
m_iv_flEncodedController.SetMaxCount( boneControllerCount );
|
m_iv_flEncodedController.SetMaxCount( boneControllerCount );
|
||||||
|
|
||||||
@ -1886,7 +1886,7 @@ void C_BaseAnimating::CalculateIKLocks( float currentTime )
|
|||||||
VectorMA( estGround, pTarget->est.height, up, p1 );
|
VectorMA( estGround, pTarget->est.height, up, p1 );
|
||||||
VectorMA( estGround, -pTarget->est.height, up, p2 );
|
VectorMA( estGround, -pTarget->est.height, up, p2 );
|
||||||
|
|
||||||
float r = max( pTarget->est.radius, 1);
|
float r = MAX( pTarget->est.radius, 1);
|
||||||
|
|
||||||
// don't IK to other characters
|
// don't IK to other characters
|
||||||
ray.Init( p1, p2, Vector(-r,-r,0), Vector(r,r,r*2) );
|
ray.Init( p1, p2, Vector(-r,-r,0), Vector(r,r,r*2) );
|
||||||
@ -3977,7 +3977,7 @@ float C_BaseAnimating::GetAnimTimeInterval( void ) const
|
|||||||
{
|
{
|
||||||
#define MAX_ANIMTIME_INTERVAL 0.2f
|
#define MAX_ANIMTIME_INTERVAL 0.2f
|
||||||
|
|
||||||
float flInterval = min( gpGlobals->curtime - m_flAnimTime, MAX_ANIMTIME_INTERVAL );
|
float flInterval = MIN( gpGlobals->curtime - m_flAnimTime, MAX_ANIMTIME_INTERVAL );
|
||||||
return flInterval;
|
return flInterval;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4209,7 +4209,7 @@ float C_BaseAnimating::FrameAdvance( float flInterval )
|
|||||||
addcycle = (serverAdvance + addcycle) / 2;
|
addcycle = (serverAdvance + addcycle) / 2;
|
||||||
|
|
||||||
const float MAX_CYCLE_ADJUSTMENT = 0.1f;
|
const float MAX_CYCLE_ADJUSTMENT = 0.1f;
|
||||||
addcycle = min( MAX_CYCLE_ADJUSTMENT, addcycle );// Don't do too big of a jump; it's too jarring as well.
|
addcycle = MIN( MAX_CYCLE_ADJUSTMENT, addcycle );// Don't do too big of a jump; it's too jarring as well.
|
||||||
|
|
||||||
DevMsg( 2, "(%d): Cycle latch used to correct %.2f in to %.2f instead of %.2f.\n",
|
DevMsg( 2, "(%d): Cycle latch used to correct %.2f in to %.2f instead of %.2f.\n",
|
||||||
entindex(), GetCycle(), GetCycle() + addcycle, GetCycle() + originalAdvance );
|
entindex(), GetCycle(), GetCycle() + addcycle, GetCycle() + originalAdvance );
|
||||||
|
@ -603,8 +603,8 @@ void GetInterpolatedVarTimeRange( CInterpolatedVar<T> *pVar, float &flMin, float
|
|||||||
if ( !pVar->GetHistoryValue( i, changetime ) )
|
if ( !pVar->GetHistoryValue( i, changetime ) )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
flMin = min( flMin, changetime );
|
flMin = MIN( flMin, changetime );
|
||||||
flMax = max( flMax, changetime );
|
flMax = MAX( flMax, changetime );
|
||||||
i = pVar->GetNext( i );
|
i = pVar->GetNext( i );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -4765,7 +4765,7 @@ int C_BaseEntity::GetIntermediateDataSize( void )
|
|||||||
Assert( size > 0 );
|
Assert( size > 0 );
|
||||||
|
|
||||||
// At least 4 bytes to avoid some really bad stuff
|
// At least 4 bytes to avoid some really bad stuff
|
||||||
return max( size, 4 );
|
return MAX( size, 4 );
|
||||||
#else
|
#else
|
||||||
return 0;
|
return 0;
|
||||||
#endif
|
#endif
|
||||||
|
@ -472,7 +472,7 @@ void C_BaseFlex::ComputeBlendedSetting( Emphasized_Phoneme *classes, float empha
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
emphasis_intensity = min( emphasis_intensity, STRONG_CROSSFADE_START );
|
emphasis_intensity = MIN( emphasis_intensity, STRONG_CROSSFADE_START );
|
||||||
classes[ PHONEME_CLASS_NORMAL ].amount = 2.0f * emphasis_intensity;
|
classes[ PHONEME_CLASS_NORMAL ].amount = 2.0f * emphasis_intensity;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -489,7 +489,7 @@ void C_BaseFlex::ComputeBlendedSetting( Emphasized_Phoneme *classes, float empha
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
emphasis_intensity = max( emphasis_intensity, WEAK_CROSSFADE_START );
|
emphasis_intensity = MAX( emphasis_intensity, WEAK_CROSSFADE_START );
|
||||||
classes[ PHONEME_CLASS_NORMAL ].amount = 2.0f * emphasis_intensity;
|
classes[ PHONEME_CLASS_NORMAL ].amount = 2.0f * emphasis_intensity;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -703,7 +703,7 @@ void C_BaseFlex::AddVisemesForSentence( Emphasized_Phoneme *classes, float empha
|
|||||||
const CBasePhonemeTag *next = sentence->GetRuntimePhoneme( k + 1 );
|
const CBasePhonemeTag *next = sentence->GetRuntimePhoneme( k + 1 );
|
||||||
if ( next )
|
if ( next )
|
||||||
{
|
{
|
||||||
dt = max( dt, min( next->GetEndTime() - t, phoneme->GetEndTime() - phoneme->GetStartTime() ) );
|
dt = MAX( dt, MIN( next->GetEndTime() - t, phoneme->GetEndTime() - phoneme->GetStartTime() ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1725,6 +1725,6 @@ void CSceneEventInfo::InitWeight( C_BaseFlex *pActor )
|
|||||||
|
|
||||||
float CSceneEventInfo::UpdateWeight( C_BaseFlex *pActor )
|
float CSceneEventInfo::UpdateWeight( C_BaseFlex *pActor )
|
||||||
{
|
{
|
||||||
m_flWeight = min( m_flWeight + 0.1, 1.0 );
|
m_flWeight = MIN( m_flWeight + 0.1, 1.0 );
|
||||||
return m_flWeight;
|
return m_flWeight;
|
||||||
}
|
}
|
||||||
|
@ -603,7 +603,7 @@ void C_BasePlayer::PostDataUpdate( DataUpdateType_t updateType )
|
|||||||
int min_fov = GetMinFOV();
|
int min_fov = GetMinFOV();
|
||||||
|
|
||||||
// Don't let it go too low
|
// Don't let it go too low
|
||||||
localFOV = max( min_fov, localFOV );
|
localFOV = MAX( min_fov, localFOV );
|
||||||
|
|
||||||
gHUD.m_flFOVSensitivityAdjust = 1.0f;
|
gHUD.m_flFOVSensitivityAdjust = 1.0f;
|
||||||
#ifndef _XBOX
|
#ifndef _XBOX
|
||||||
|
@ -761,7 +761,7 @@ bool CClient_Precipitation::ComputeEmissionArea( Vector& origin, Vector2D& size
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
// Determine how much time it'll take a falling particle to hit the player
|
// Determine how much time it'll take a falling particle to hit the player
|
||||||
float emissionHeight = min( vMaxs[2], pPlayer->GetAbsOrigin()[2] + 512 );
|
float emissionHeight = MIN( vMaxs[2], pPlayer->GetAbsOrigin()[2] + 512 );
|
||||||
float distToFall = emissionHeight - pPlayer->GetAbsOrigin()[2];
|
float distToFall = emissionHeight - pPlayer->GetAbsOrigin()[2];
|
||||||
float fallTime = distToFall / GetSpeed();
|
float fallTime = distToFall / GetSpeed();
|
||||||
|
|
||||||
@ -781,12 +781,12 @@ bool CClient_Precipitation::ComputeEmissionArea( Vector& origin, Vector2D& size
|
|||||||
( vMins[0] > hibound[0] ) || ( vMins[1] > hibound[1] ) )
|
( vMins[0] > hibound[0] ) || ( vMins[1] > hibound[1] ) )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
origin[0] = max( vMins[0], lobound[0] );
|
origin[0] = MAX( vMins[0], lobound[0] );
|
||||||
origin[1] = max( vMins[1], lobound[1] );
|
origin[1] = MAX( vMins[1], lobound[1] );
|
||||||
origin[2] = emissionHeight;
|
origin[2] = emissionHeight;
|
||||||
|
|
||||||
hibound[0] = min( vMaxs[0], hibound[0] );
|
hibound[0] = MIN( vMaxs[0], hibound[0] );
|
||||||
hibound[1] = min( vMaxs[1], hibound[1] );
|
hibound[1] = MIN( vMaxs[1], hibound[1] );
|
||||||
|
|
||||||
size[0] = hibound[0] - origin[0];
|
size[0] = hibound[0] - origin[0];
|
||||||
size[1] = hibound[1] - origin[1];
|
size[1] = hibound[1] - origin[1];
|
||||||
|
@ -245,9 +245,9 @@ void C_EntityDissolve::BuildTeslaEffect( mstudiobbox_t *pHitBox, const matrix3x4
|
|||||||
pParticle->m_vecVelocity = vec3_origin;
|
pParticle->m_vecVelocity = vec3_origin;
|
||||||
Vector color( 1,1,1 );
|
Vector color( 1,1,1 );
|
||||||
float colorRamp = RandomFloat( 0.75f, 1.25f );
|
float colorRamp = RandomFloat( 0.75f, 1.25f );
|
||||||
pParticle->m_uchColor[0] = min( 1.0f, color[0] * colorRamp ) * 255.0f;
|
pParticle->m_uchColor[0] = MIN( 1.0f, color[0] * colorRamp ) * 255.0f;
|
||||||
pParticle->m_uchColor[1] = min( 1.0f, color[1] * colorRamp ) * 255.0f;
|
pParticle->m_uchColor[1] = MIN( 1.0f, color[1] * colorRamp ) * 255.0f;
|
||||||
pParticle->m_uchColor[2] = min( 1.0f, color[2] * colorRamp ) * 255.0f;
|
pParticle->m_uchColor[2] = MIN( 1.0f, color[2] * colorRamp ) * 255.0f;
|
||||||
pParticle->m_uchStartSize = RandomFloat( 6,13 );
|
pParticle->m_uchStartSize = RandomFloat( 6,13 );
|
||||||
pParticle->m_uchEndSize = pParticle->m_uchStartSize - 2;
|
pParticle->m_uchEndSize = pParticle->m_uchStartSize - 2;
|
||||||
pParticle->m_uchStartAlpha = 255;
|
pParticle->m_uchStartAlpha = 255;
|
||||||
|
@ -550,7 +550,7 @@ void C_FireSmoke::UpdateFlames( void )
|
|||||||
//NOTENOTE: Sprite renderer assumes a scale of 0.0 means 1.0
|
//NOTENOTE: Sprite renderer assumes a scale of 0.0 means 1.0
|
||||||
if ( m_bFadingOut == false )
|
if ( m_bFadingOut == false )
|
||||||
{
|
{
|
||||||
m_entFlames[i].SetScale( max(0.000001,newScale) );
|
m_entFlames[i].SetScale( MAX(0.000001,newScale) );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -585,7 +585,7 @@ void C_FireSmoke::UpdateFlames( void )
|
|||||||
//NOTENOTE: Sprite renderer assumes a scale of 0.0 means 1.0
|
//NOTENOTE: Sprite renderer assumes a scale of 0.0 means 1.0
|
||||||
if ( m_bFadingOut == false )
|
if ( m_bFadingOut == false )
|
||||||
{
|
{
|
||||||
m_entFlamesFromAbove[i].SetScale( max(0.000001,newScale) );
|
m_entFlamesFromAbove[i].SetScale( MAX(0.000001,newScale) );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -733,9 +733,9 @@ void C_FireSmoke::SpawnSmoke( void )
|
|||||||
|
|
||||||
scalar = Helper_RandomFloat( 0.5f, 2.0f );
|
scalar = Helper_RandomFloat( 0.5f, 2.0f );
|
||||||
|
|
||||||
sParticle->m_uchColor[0] = min( 255, Helper_RandomFloat( 185.0f, 190.0f ) * scalar );
|
sParticle->m_uchColor[0] = MIN( 255, Helper_RandomFloat( 185.0f, 190.0f ) * scalar );
|
||||||
sParticle->m_uchColor[1] = min( 255, Helper_RandomFloat( 140.0f, 165.0f ) * scalar );
|
sParticle->m_uchColor[1] = MIN( 255, Helper_RandomFloat( 140.0f, 165.0f ) * scalar );
|
||||||
sParticle->m_uchColor[2] = min( 255, 65.0f * scalar );
|
sParticle->m_uchColor[2] = MIN( 255, 65.0f * scalar );
|
||||||
sParticle->m_uchStartAlpha = 255;
|
sParticle->m_uchStartAlpha = 255;
|
||||||
sParticle->m_uchEndAlpha = 0;
|
sParticle->m_uchEndAlpha = 0;
|
||||||
sParticle->m_uchStartSize = 2;
|
sParticle->m_uchStartSize = 2;
|
||||||
@ -1453,9 +1453,9 @@ void C_EntityFlame::UpdateHitBoxFlames( void )
|
|||||||
//
|
//
|
||||||
// colorRamp = random->RandomFloat( 0.75f, 1.25f );
|
// colorRamp = random->RandomFloat( 0.75f, 1.25f );
|
||||||
//
|
//
|
||||||
// pParticle->m_uchColor[0] = min( 1.0f, color[0] * colorRamp ) * 255.0f;
|
// pParticle->m_uchColor[0] = MIN( 1.0f, color[0] * colorRamp ) * 255.0f;
|
||||||
// pParticle->m_uchColor[1] = min( 1.0f, color[1] * colorRamp ) * 255.0f;
|
// pParticle->m_uchColor[1] = MIN( 1.0f, color[1] * colorRamp ) * 255.0f;
|
||||||
// pParticle->m_uchColor[2] = min( 1.0f, color[2] * colorRamp ) * 255.0f;
|
// pParticle->m_uchColor[2] = MIN( 1.0f, color[2] * colorRamp ) * 255.0f;
|
||||||
//
|
//
|
||||||
// pParticle->m_uchStartSize = random->RandomFloat( scale * 0.5, scale * 2 );
|
// pParticle->m_uchStartSize = random->RandomFloat( scale * 0.5, scale * 2 );
|
||||||
// pParticle->m_uchEndSize = pParticle->m_uchStartSize * 2;
|
// pParticle->m_uchEndSize = pParticle->m_uchStartSize * 2;
|
||||||
|
@ -192,7 +192,7 @@ void C_Func_Dust::ClientThink()
|
|||||||
// Spawn particles?
|
// Spawn particles?
|
||||||
if( m_DustFlags & DUSTFLAGS_ON )
|
if( m_DustFlags & DUSTFLAGS_ON )
|
||||||
{
|
{
|
||||||
float flDelta = min( gpGlobals->frametime, 0.1f );
|
float flDelta = MIN( gpGlobals->frametime, 0.1f );
|
||||||
while( m_Spawner.NextEvent( flDelta ) )
|
while( m_Spawner.NextEvent( flDelta ) )
|
||||||
{
|
{
|
||||||
AttemptSpawnNewParticle();
|
AttemptSpawnNewParticle();
|
||||||
|
@ -124,7 +124,7 @@ static void CreateFleckParticles( const Vector& origin, const Vector &color, tra
|
|||||||
|
|
||||||
// Handle increased scale
|
// Handle increased scale
|
||||||
float flMaxSpeed = FLECK_MAX_SPEED * iScale;
|
float flMaxSpeed = FLECK_MAX_SPEED * iScale;
|
||||||
float flAngularSpray = max( 0.2, FLECK_ANGULAR_SPRAY - ( (float)iScale * 0.2f) ); // More power makes the spray more controlled
|
float flAngularSpray = MAX( 0.2, FLECK_ANGULAR_SPRAY - ( (float)iScale * 0.2f) ); // More power makes the spray more controlled
|
||||||
|
|
||||||
// Setup our collision information
|
// Setup our collision information
|
||||||
fleckEmitter->m_ParticleCollision.Setup( spawnOffset, &trace->plane.normal, flAngularSpray, FLECK_MIN_SPEED, flMaxSpeed, FLECK_GRAVITY, FLECK_DAMPEN );
|
fleckEmitter->m_ParticleCollision.Setup( spawnOffset, &trace->plane.normal, flAngularSpray, FLECK_MIN_SPEED, flMaxSpeed, FLECK_GRAVITY, FLECK_DAMPEN );
|
||||||
@ -179,9 +179,9 @@ static void CreateFleckParticles( const Vector& origin, const Vector &color, tra
|
|||||||
|
|
||||||
colorRamp = random->RandomFloat( 0.75f, 1.25f );
|
colorRamp = random->RandomFloat( 0.75f, 1.25f );
|
||||||
|
|
||||||
pFleckParticle->m_uchColor[0] = min( 1.0f, color[0]*colorRamp )*255.0f;
|
pFleckParticle->m_uchColor[0] = MIN( 1.0f, color[0]*colorRamp )*255.0f;
|
||||||
pFleckParticle->m_uchColor[1] = min( 1.0f, color[1]*colorRamp )*255.0f;
|
pFleckParticle->m_uchColor[1] = MIN( 1.0f, color[1]*colorRamp )*255.0f;
|
||||||
pFleckParticle->m_uchColor[2] = min( 1.0f, color[2]*colorRamp )*255.0f;
|
pFleckParticle->m_uchColor[2] = MIN( 1.0f, color[2]*colorRamp )*255.0f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -258,9 +258,9 @@ void FX_DebrisFlecks( const Vector& origin, trace_t *tr, char materialType, int
|
|||||||
|
|
||||||
// Ramp the color
|
// Ramp the color
|
||||||
colorRamp = random->RandomFloat( 0.5f, 1.25f );
|
colorRamp = random->RandomFloat( 0.5f, 1.25f );
|
||||||
pParticle->m_uchColor[0] = min( 1.0f, color[0] * colorRamp ) * 255.0f;
|
pParticle->m_uchColor[0] = MIN( 1.0f, color[0] * colorRamp ) * 255.0f;
|
||||||
pParticle->m_uchColor[1] = min( 1.0f, color[1] * colorRamp ) * 255.0f;
|
pParticle->m_uchColor[1] = MIN( 1.0f, color[1] * colorRamp ) * 255.0f;
|
||||||
pParticle->m_uchColor[2] = min( 1.0f, color[2] * colorRamp ) * 255.0f;
|
pParticle->m_uchColor[2] = MIN( 1.0f, color[2] * colorRamp ) * 255.0f;
|
||||||
|
|
||||||
// scaled
|
// scaled
|
||||||
pParticle->m_uchStartSize = (iScale*0.5f) * random->RandomInt( 3, 4 ) * (i+1);
|
pParticle->m_uchStartSize = (iScale*0.5f) * random->RandomInt( 3, 4 ) * (i+1);
|
||||||
@ -294,9 +294,9 @@ void FX_DebrisFlecks( const Vector& origin, trace_t *tr, char materialType, int
|
|||||||
|
|
||||||
colorRamp = random->RandomFloat( 0.5f, 1.25f );
|
colorRamp = random->RandomFloat( 0.5f, 1.25f );
|
||||||
|
|
||||||
pParticle->m_uchColor[0] = min( 1.0f, color[0] * colorRamp ) * 255.0f;
|
pParticle->m_uchColor[0] = MIN( 1.0f, color[0] * colorRamp ) * 255.0f;
|
||||||
pParticle->m_uchColor[1] = min( 1.0f, color[1] * colorRamp ) * 255.0f;
|
pParticle->m_uchColor[1] = MIN( 1.0f, color[1] * colorRamp ) * 255.0f;
|
||||||
pParticle->m_uchColor[2] = min( 1.0f, color[2] * colorRamp ) * 255.0f;
|
pParticle->m_uchColor[2] = MIN( 1.0f, color[2] * colorRamp ) * 255.0f;
|
||||||
|
|
||||||
pParticle->m_uchStartSize = random->RandomInt( 4, 8 );
|
pParticle->m_uchStartSize = random->RandomInt( 4, 8 );
|
||||||
pParticle->m_uchEndSize = pParticle->m_uchStartSize * 4;
|
pParticle->m_uchEndSize = pParticle->m_uchStartSize * 4;
|
||||||
@ -357,9 +357,9 @@ void FX_DebrisFlecks( const Vector& origin, trace_t *tr, char materialType, int
|
|||||||
|
|
||||||
float colorRamp = random->RandomFloat( 0.5f, 1.25f );
|
float colorRamp = random->RandomFloat( 0.5f, 1.25f );
|
||||||
|
|
||||||
newParticle.m_uchColor[0] = min( 1.0f, color[0]*colorRamp )*255.0f;
|
newParticle.m_uchColor[0] = MIN( 1.0f, color[0]*colorRamp )*255.0f;
|
||||||
newParticle.m_uchColor[1] = min( 1.0f, color[1]*colorRamp )*255.0f;
|
newParticle.m_uchColor[1] = MIN( 1.0f, color[1]*colorRamp )*255.0f;
|
||||||
newParticle.m_uchColor[2] = min( 1.0f, color[2]*colorRamp )*255.0f;
|
newParticle.m_uchColor[2] = MIN( 1.0f, color[2]*colorRamp )*255.0f;
|
||||||
|
|
||||||
AddSimpleParticle( &newParticle, smokeMaterial );
|
AddSimpleParticle( &newParticle, smokeMaterial );
|
||||||
}
|
}
|
||||||
@ -392,9 +392,9 @@ void FX_DebrisFlecks( const Vector& origin, trace_t *tr, char materialType, int
|
|||||||
|
|
||||||
float colorRamp = random->RandomFloat( 0.5f, 1.25f );
|
float colorRamp = random->RandomFloat( 0.5f, 1.25f );
|
||||||
|
|
||||||
newParticle.m_uchColor[0] = min( 1.0f, color[0]*colorRamp )*255.0f;
|
newParticle.m_uchColor[0] = MIN( 1.0f, color[0]*colorRamp )*255.0f;
|
||||||
newParticle.m_uchColor[1] = min( 1.0f, color[1]*colorRamp )*255.0f;
|
newParticle.m_uchColor[1] = MIN( 1.0f, color[1]*colorRamp )*255.0f;
|
||||||
newParticle.m_uchColor[2] = min( 1.0f, color[2]*colorRamp )*255.0f;
|
newParticle.m_uchColor[2] = MIN( 1.0f, color[2]*colorRamp )*255.0f;
|
||||||
|
|
||||||
AddSimpleParticle( &newParticle, bloodMaterial );
|
AddSimpleParticle( &newParticle, bloodMaterial );
|
||||||
}
|
}
|
||||||
@ -426,9 +426,9 @@ void FX_DebrisFlecks( const Vector& origin, trace_t *tr, char materialType, int
|
|||||||
|
|
||||||
float colorRamp = random->RandomFloat( 0.5f, 1.25f );
|
float colorRamp = random->RandomFloat( 0.5f, 1.25f );
|
||||||
|
|
||||||
newParticle.m_uchColor[0] = min( 1.0f, color[0]*colorRamp )*255.0f;
|
newParticle.m_uchColor[0] = MIN( 1.0f, color[0]*colorRamp )*255.0f;
|
||||||
newParticle.m_uchColor[1] = min( 1.0f, color[1]*colorRamp )*255.0f;
|
newParticle.m_uchColor[1] = MIN( 1.0f, color[1]*colorRamp )*255.0f;
|
||||||
newParticle.m_uchColor[2] = min( 1.0f, color[2]*colorRamp )*255.0f;
|
newParticle.m_uchColor[2] = MIN( 1.0f, color[2]*colorRamp )*255.0f;
|
||||||
|
|
||||||
AddSimpleParticle( &newParticle, smokeMaterial );
|
AddSimpleParticle( &newParticle, smokeMaterial );
|
||||||
|
|
||||||
@ -547,9 +547,9 @@ void FX_GlassImpact( const Vector &pos, const Vector &normal )
|
|||||||
|
|
||||||
colorRamp = random->RandomFloat( 0.5f, 1.25f );
|
colorRamp = random->RandomFloat( 0.5f, 1.25f );
|
||||||
|
|
||||||
newParticle.m_uchColor[0] = min( 1.0f, color[0]*colorRamp )*255.0f;
|
newParticle.m_uchColor[0] = MIN( 1.0f, color[0]*colorRamp )*255.0f;
|
||||||
newParticle.m_uchColor[1] = min( 1.0f, color[1]*colorRamp )*255.0f;
|
newParticle.m_uchColor[1] = MIN( 1.0f, color[1]*colorRamp )*255.0f;
|
||||||
newParticle.m_uchColor[2] = min( 1.0f, color[2]*colorRamp )*255.0f;
|
newParticle.m_uchColor[2] = MIN( 1.0f, color[2]*colorRamp )*255.0f;
|
||||||
|
|
||||||
AddSimpleParticle( &newParticle, bloodMaterial );
|
AddSimpleParticle( &newParticle, bloodMaterial );
|
||||||
}
|
}
|
||||||
@ -580,9 +580,9 @@ void FX_GlassImpact( const Vector &pos, const Vector &normal )
|
|||||||
|
|
||||||
colorRamp = random->RandomFloat( 0.5f, 1.25f );
|
colorRamp = random->RandomFloat( 0.5f, 1.25f );
|
||||||
|
|
||||||
newParticle.m_uchColor[0] = min( 1.0f, color[0]*colorRamp )*255.0f;
|
newParticle.m_uchColor[0] = MIN( 1.0f, color[0]*colorRamp )*255.0f;
|
||||||
newParticle.m_uchColor[1] = min( 1.0f, color[1]*colorRamp )*255.0f;
|
newParticle.m_uchColor[1] = MIN( 1.0f, color[1]*colorRamp )*255.0f;
|
||||||
newParticle.m_uchColor[2] = min( 1.0f, color[2]*colorRamp )*255.0f;
|
newParticle.m_uchColor[2] = MIN( 1.0f, color[2]*colorRamp )*255.0f;
|
||||||
|
|
||||||
AddSimpleParticle( &newParticle, ParticleMgr()->GetPMaterial( "particle/particle_smokegrenade" ) );
|
AddSimpleParticle( &newParticle, ParticleMgr()->GetPMaterial( "particle/particle_smokegrenade" ) );
|
||||||
}
|
}
|
||||||
@ -723,9 +723,9 @@ void FX_AntlionImpact( const Vector &pos, trace_t *trace )
|
|||||||
|
|
||||||
colorRamp = random->RandomFloat( 0.5f, 1.0f );
|
colorRamp = random->RandomFloat( 0.5f, 1.0f );
|
||||||
|
|
||||||
pParticle->m_uchColor[0] = min( 1.0f, color[0]*colorRamp )*255.0f;
|
pParticle->m_uchColor[0] = MIN( 1.0f, color[0]*colorRamp )*255.0f;
|
||||||
pParticle->m_uchColor[1] = min( 1.0f, color[1]*colorRamp )*255.0f;
|
pParticle->m_uchColor[1] = MIN( 1.0f, color[1]*colorRamp )*255.0f;
|
||||||
pParticle->m_uchColor[2] = min( 1.0f, color[2]*colorRamp )*255.0f;
|
pParticle->m_uchColor[2] = MIN( 1.0f, color[2]*colorRamp )*255.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Blood spurt
|
// Blood spurt
|
||||||
@ -1010,9 +1010,9 @@ void FX_DustImpact( const Vector &origin, trace_t *tr, int iScale )
|
|||||||
|
|
||||||
colorRamp = random->RandomFloat( 0.75f, 1.25f );
|
colorRamp = random->RandomFloat( 0.75f, 1.25f );
|
||||||
|
|
||||||
pParticle->m_uchColor[0] = min( 1.0f, color[0] * colorRamp ) * 255.0f;
|
pParticle->m_uchColor[0] = MIN( 1.0f, color[0] * colorRamp ) * 255.0f;
|
||||||
pParticle->m_uchColor[1] = min( 1.0f, color[1] * colorRamp ) * 255.0f;
|
pParticle->m_uchColor[1] = MIN( 1.0f, color[1] * colorRamp ) * 255.0f;
|
||||||
pParticle->m_uchColor[2] = min( 1.0f, color[2] * colorRamp ) * 255.0f;
|
pParticle->m_uchColor[2] = MIN( 1.0f, color[2] * colorRamp ) * 255.0f;
|
||||||
|
|
||||||
// scaled
|
// scaled
|
||||||
pParticle->m_uchStartSize = iScale * random->RandomInt( 3, 4 ) * (i+1);
|
pParticle->m_uchStartSize = iScale * random->RandomInt( 3, 4 ) * (i+1);
|
||||||
@ -1053,9 +1053,9 @@ void FX_DustImpact( const Vector &origin, trace_t *tr, int iScale )
|
|||||||
pParticle->m_vecVelocity.Init();
|
pParticle->m_vecVelocity.Init();
|
||||||
|
|
||||||
colorRamp = random->RandomFloat( 0.75f, 1.25f );
|
colorRamp = random->RandomFloat( 0.75f, 1.25f );
|
||||||
pParticle->m_uchColor[0] = min( 1.0f, color[0] * colorRamp ) * 255.0f;
|
pParticle->m_uchColor[0] = MIN( 1.0f, color[0] * colorRamp ) * 255.0f;
|
||||||
pParticle->m_uchColor[1] = min( 1.0f, color[1] * colorRamp ) * 255.0f;
|
pParticle->m_uchColor[1] = MIN( 1.0f, color[1] * colorRamp ) * 255.0f;
|
||||||
pParticle->m_uchColor[2] = min( 1.0f, color[2] * colorRamp ) * 255.0f;
|
pParticle->m_uchColor[2] = MIN( 1.0f, color[2] * colorRamp ) * 255.0f;
|
||||||
|
|
||||||
pParticle->m_uchStartSize = random->RandomInt( 4, 8 );
|
pParticle->m_uchStartSize = random->RandomInt( 4, 8 );
|
||||||
pParticle->m_uchEndSize = pParticle->m_uchStartSize * 4;
|
pParticle->m_uchEndSize = pParticle->m_uchStartSize * 4;
|
||||||
@ -1111,9 +1111,9 @@ void FX_DustImpact( const Vector &origin, trace_t *tr, int iScale )
|
|||||||
|
|
||||||
colorRamp = random->RandomFloat( 0.75f, 1.25f );
|
colorRamp = random->RandomFloat( 0.75f, 1.25f );
|
||||||
|
|
||||||
pParticle->m_uchColor[0] = min( 1.0f, color[0] * colorRamp ) * 255.0f;
|
pParticle->m_uchColor[0] = MIN( 1.0f, color[0] * colorRamp ) * 255.0f;
|
||||||
pParticle->m_uchColor[1] = min( 1.0f, color[1] * colorRamp ) * 255.0f;
|
pParticle->m_uchColor[1] = MIN( 1.0f, color[1] * colorRamp ) * 255.0f;
|
||||||
pParticle->m_uchColor[2] = min( 1.0f, color[2] * colorRamp ) * 255.0f;
|
pParticle->m_uchColor[2] = MIN( 1.0f, color[2] * colorRamp ) * 255.0f;
|
||||||
|
|
||||||
// scaled
|
// scaled
|
||||||
pParticle->m_uchStartSize = iScale * random->RandomInt( 3, 4 ) * (i+1);
|
pParticle->m_uchStartSize = iScale * random->RandomInt( 3, 4 ) * (i+1);
|
||||||
@ -1152,9 +1152,9 @@ void FX_DustImpact( const Vector &origin, trace_t *tr, int iScale )
|
|||||||
|
|
||||||
colorRamp = random->RandomFloat( 0.75f, 1.25f );
|
colorRamp = random->RandomFloat( 0.75f, 1.25f );
|
||||||
|
|
||||||
pParticle->m_uchColor[0] = min( 1.0f, color[0] * colorRamp ) * 255.0f;
|
pParticle->m_uchColor[0] = MIN( 1.0f, color[0] * colorRamp ) * 255.0f;
|
||||||
pParticle->m_uchColor[1] = min( 1.0f, color[1] * colorRamp ) * 255.0f;
|
pParticle->m_uchColor[1] = MIN( 1.0f, color[1] * colorRamp ) * 255.0f;
|
||||||
pParticle->m_uchColor[2] = min( 1.0f, color[2] * colorRamp ) * 255.0f;
|
pParticle->m_uchColor[2] = MIN( 1.0f, color[2] * colorRamp ) * 255.0f;
|
||||||
|
|
||||||
pParticle->m_uchStartSize = random->RandomInt( 2, 4 ) * (i+1);
|
pParticle->m_uchStartSize = random->RandomInt( 2, 4 ) * (i+1);
|
||||||
pParticle->m_uchEndSize = pParticle->m_uchStartSize * 2;
|
pParticle->m_uchEndSize = pParticle->m_uchStartSize * 2;
|
||||||
@ -1194,9 +1194,9 @@ void FX_DustImpact( const Vector &origin, trace_t *tr, int iScale )
|
|||||||
|
|
||||||
colorRamp = random->RandomFloat( 0.75f, 1.25f );
|
colorRamp = random->RandomFloat( 0.75f, 1.25f );
|
||||||
|
|
||||||
pParticle->m_uchColor[0] = min( 1.0f, color[0] * colorRamp ) * 255.0f;
|
pParticle->m_uchColor[0] = MIN( 1.0f, color[0] * colorRamp ) * 255.0f;
|
||||||
pParticle->m_uchColor[1] = min( 1.0f, color[1] * colorRamp ) * 255.0f;
|
pParticle->m_uchColor[1] = MIN( 1.0f, color[1] * colorRamp ) * 255.0f;
|
||||||
pParticle->m_uchColor[2] = min( 1.0f, color[2] * colorRamp ) * 255.0f;
|
pParticle->m_uchColor[2] = MIN( 1.0f, color[2] * colorRamp ) * 255.0f;
|
||||||
|
|
||||||
pParticle->m_uchStartSize = random->RandomInt( 1, 4 );
|
pParticle->m_uchStartSize = random->RandomInt( 1, 4 );
|
||||||
pParticle->m_uchEndSize = pParticle->m_uchStartSize * 4;
|
pParticle->m_uchEndSize = pParticle->m_uchStartSize * 4;
|
||||||
|
@ -662,7 +662,7 @@ inline void C_ParticleSmokeGrenade::ApplyDynamicLight( const Vector &vParticlePo
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Rescale the color..
|
// Rescale the color..
|
||||||
float flMax = max( color.x, max( color.y, color.z ) );
|
float flMax = MAX( color.x, MAX( color.y, color.z ) );
|
||||||
if ( flMax > 1 )
|
if ( flMax > 1 )
|
||||||
{
|
{
|
||||||
color /= flMax;
|
color /= flMax;
|
||||||
|
@ -33,7 +33,7 @@ float PixelVisibility_DrawProxy( OcclusionQueryObjectHandle_t queryHandle, Vecto
|
|||||||
float forwardScale = scale;
|
float forwardScale = scale;
|
||||||
// draw a pyramid of points touching a sphere of radius "scale" at origin
|
// draw a pyramid of points touching a sphere of radius "scale" at origin
|
||||||
float pixelsPerUnit = materials->ComputePixelWidthOfSphere( origin, 1.0f );
|
float pixelsPerUnit = materials->ComputePixelWidthOfSphere( origin, 1.0f );
|
||||||
pixelsPerUnit = max( pixelsPerUnit, 1e-4f );
|
pixelsPerUnit = MAX( pixelsPerUnit, 1e-4f );
|
||||||
if ( screenspace )
|
if ( screenspace )
|
||||||
{
|
{
|
||||||
// Force this to be the size of a sphere of diameter "scale" at some reference distance (1.0 unit)
|
// Force this to be the size of a sphere of diameter "scale" at some reference distance (1.0 unit)
|
||||||
@ -82,8 +82,8 @@ float PixelVisibility_DrawProxy( OcclusionQueryObjectHandle_t queryHandle, Vecto
|
|||||||
// compute area and screen-clipped area
|
// compute area and screen-clipped area
|
||||||
float w = screen[1].x - screen[0].x;
|
float w = screen[1].x - screen[0].x;
|
||||||
float h = screen[0].y - screen[3].y;
|
float h = screen[0].y - screen[3].y;
|
||||||
float ws = min(1.0f, screen[1].x) - max(-1.0f, screen[0].x);
|
float ws = MIN(1.0f, screen[1].x) - MAX(-1.0f, screen[0].x);
|
||||||
float hs = min(1.0f, screen[0].y) - max(-1.0f, screen[3].y);
|
float hs = MIN(1.0f, screen[0].y) - MAX(-1.0f, screen[3].y);
|
||||||
float area = w*h; // area can be zero when we ALT-TAB
|
float area = w*h; // area can be zero when we ALT-TAB
|
||||||
float areaClipped = ws*hs;
|
float areaClipped = ws*hs;
|
||||||
float ratio = 0.0f;
|
float ratio = 0.0f;
|
||||||
|
@ -235,7 +235,7 @@ void C_Plasma::AddEntity( void )
|
|||||||
m_flGlowScale = m_flScaleRegister;
|
m_flGlowScale = m_flScaleRegister;
|
||||||
|
|
||||||
// Note: Sprite renderer assumes scale of 0.0 is 1.0
|
// Note: Sprite renderer assumes scale of 0.0 is 1.0
|
||||||
m_entGlow.SetScale( max( 0.0000001f, (m_flScaleRegister*1.5f) + GetFlickerScale() ) );
|
m_entGlow.SetScale( MAX( 0.0000001f, (m_flScaleRegister*1.5f) + GetFlickerScale() ) );
|
||||||
m_entGlow.SetLocalOriginDim( Z_INDEX, m_entGlow.GetLocalOriginDim( Z_INDEX ) + ( dScale * 32.0f ) );
|
m_entGlow.SetLocalOriginDim( Z_INDEX, m_entGlow.GetLocalOriginDim( Z_INDEX ) + ( dScale * 32.0f ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -407,7 +407,7 @@ void C_Plasma::UpdateFlames( void )
|
|||||||
offset[2] = m_entFlames[i].GetAbsOrigin()[2];
|
offset[2] = m_entFlames[i].GetAbsOrigin()[2];
|
||||||
|
|
||||||
// Note: Sprite render assumes 0 scale means 1.0
|
// Note: Sprite render assumes 0 scale means 1.0
|
||||||
m_entFlames[i].SetScale ( max(0.000001,newScale) );
|
m_entFlames[i].SetScale ( MAX(0.000001,newScale) );
|
||||||
|
|
||||||
if ( i != 0 )
|
if ( i != 0 )
|
||||||
{
|
{
|
||||||
|
@ -622,7 +622,7 @@ void C_RopeKeyframe::CPhysicsDelegate::ApplyConstraints( CSimplePhysics::CNode *
|
|||||||
AngleVectors( angles, &forward );
|
AngleVectors( angles, &forward );
|
||||||
|
|
||||||
int parity = 1;
|
int parity = 1;
|
||||||
int nFalloffNodes = min( 2, nNodes - 2 );
|
int nFalloffNodes = MIN( 2, nNodes - 2 );
|
||||||
LockNodeDirection( pNodes, parity, nFalloffNodes, g_flLockAmount, g_flLockFalloff, forward );
|
LockNodeDirection( pNodes, parity, nFalloffNodes, g_flLockAmount, g_flLockFalloff, forward );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -636,7 +636,7 @@ void C_RopeKeyframe::CPhysicsDelegate::ApplyConstraints( CSimplePhysics::CNode *
|
|||||||
AngleVectors( angles, &forward );
|
AngleVectors( angles, &forward );
|
||||||
|
|
||||||
int parity = -1;
|
int parity = -1;
|
||||||
int nFalloffNodes = min( 2, nNodes - 2 );
|
int nFalloffNodes = MIN( 2, nNodes - 2 );
|
||||||
LockNodeDirection( &pNodes[nNodes-1], parity, nFalloffNodes, g_flLockAmount, g_flLockFalloff, forward );
|
LockNodeDirection( &pNodes[nNodes-1], parity, nFalloffNodes, g_flLockAmount, g_flLockFalloff, forward );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1242,7 +1242,7 @@ void C_RopeKeyframe::BuildRope( RopeSegData_t *pSegmentData )
|
|||||||
|
|
||||||
// Right here, we need to specify a width that will be 1 pixel larger in screen space.
|
// Right here, we need to specify a width that will be 1 pixel larger in screen space.
|
||||||
float zCoord = CurrentViewForward().Dot( pSegmentData->m_Segments[iSegment].m_vPos - CurrentViewOrigin() );
|
float zCoord = CurrentViewForward().Dot( pSegmentData->m_Segments[iSegment].m_vPos - CurrentViewOrigin() );
|
||||||
zCoord = max( zCoord, 0.1f );
|
zCoord = MAX( zCoord, 0.1f );
|
||||||
|
|
||||||
float flScreenSpaceWidth = m_Width * flHalfScreenWidth / zCoord;
|
float flScreenSpaceWidth = m_Width * flHalfScreenWidth / zCoord;
|
||||||
if ( flScreenSpaceWidth < flMinScreenSpaceWidth )
|
if ( flScreenSpaceWidth < flMinScreenSpaceWidth )
|
||||||
@ -1270,7 +1270,7 @@ void C_RopeKeyframe::BuildRope( RopeSegData_t *pSegmentData )
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
pSegmentData->m_flMaxBackWidth = max( pSegmentData->m_flMaxBackWidth, pSegmentData->m_BackWidths[iSegment] );
|
pSegmentData->m_flMaxBackWidth = MAX( pSegmentData->m_flMaxBackWidth, pSegmentData->m_BackWidths[iSegment] );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1472,12 +1472,12 @@ void C_RopeKeyframe::CalcLightValues()
|
|||||||
for ( int iSide=0; iSide < 6; iSide++ )
|
for ( int iSide=0; iSide < 6; iSide++ )
|
||||||
{
|
{
|
||||||
float flLen = boxColors[iSide].Length();
|
float flLen = boxColors[iSide].Length();
|
||||||
flMaxIntensity = max( flMaxIntensity, flLen );
|
flMaxIntensity = MAX( flMaxIntensity, flLen );
|
||||||
}
|
}
|
||||||
|
|
||||||
VectorNormalize( m_LightValues[i] );
|
VectorNormalize( m_LightValues[i] );
|
||||||
m_LightValues[i] *= flMaxIntensity;
|
m_LightValues[i] *= flMaxIntensity;
|
||||||
float flMax = max( m_LightValues[i].x, max( m_LightValues[i].y, m_LightValues[i].z ) );
|
float flMax = MAX( m_LightValues[i].x, MAX( m_LightValues[i].y, m_LightValues[i].z ) );
|
||||||
if ( flMax > 1 )
|
if ( flMax > 1 )
|
||||||
m_LightValues[i] /= flMax;
|
m_LightValues[i] /= flMax;
|
||||||
}
|
}
|
||||||
|
@ -320,7 +320,7 @@ void C_SmokeTrail::Update( float fTimeDelta )
|
|||||||
VectorMA( pParticle->m_vecVelocity, flDirectedVel, vecForward, pParticle->m_vecVelocity );
|
VectorMA( pParticle->m_vecVelocity, flDirectedVel, vecForward, pParticle->m_vecVelocity );
|
||||||
|
|
||||||
offsetColor = m_StartColor;
|
offsetColor = m_StartColor;
|
||||||
float flMaxVal = max( m_StartColor[0], m_StartColor[1] );
|
float flMaxVal = MAX( m_StartColor[0], m_StartColor[1] );
|
||||||
if ( flMaxVal < m_StartColor[2] )
|
if ( flMaxVal < m_StartColor[2] )
|
||||||
{
|
{
|
||||||
flMaxVal = m_StartColor[2];
|
flMaxVal = m_StartColor[2];
|
||||||
|
@ -482,7 +482,7 @@ void CSprite::GetToolRecordingState( KeyValues *msg )
|
|||||||
if ( m_bWorldSpaceScale )
|
if ( m_bWorldSpaceScale )
|
||||||
{
|
{
|
||||||
CEngineSprite *psprite = ( CEngineSprite * )modelinfo->GetModelExtraData( GetModel() );
|
CEngineSprite *psprite = ( CEngineSprite * )modelinfo->GetModelExtraData( GetModel() );
|
||||||
float flMinSize = min( psprite->GetWidth(), psprite->GetHeight() );
|
float flMinSize = MIN( psprite->GetWidth(), psprite->GetHeight() );
|
||||||
renderscale /= flMinSize;
|
renderscale /= flMinSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -181,7 +181,7 @@ void C_SteamJet::OnDataChanged(DataUpdateType_t updateType)
|
|||||||
|
|
||||||
// Recalulate lifetime in case length or speed changed.
|
// Recalulate lifetime in case length or speed changed.
|
||||||
m_Lifetime = m_JetLength / m_Speed;
|
m_Lifetime = m_JetLength / m_Speed;
|
||||||
m_ParticleEffect.SetParticleCullRadius( max(m_StartSize, m_EndSize) );
|
m_ParticleEffect.SetParticleCullRadius( MAX(m_StartSize, m_EndSize) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -243,7 +243,7 @@ void CalcFastApproximateRenderBoundsAABB( C_BaseEntity *pEnt, float flBloatSize,
|
|||||||
Vector vAddMins, vAddMaxs;
|
Vector vAddMins, vAddMaxs;
|
||||||
pEnt->GetRenderBounds( vAddMins, vAddMaxs );
|
pEnt->GetRenderBounds( vAddMins, vAddMaxs );
|
||||||
|
|
||||||
flBloatSize += max( vAddMins.Length(), vAddMaxs.Length() );
|
flBloatSize += MAX( vAddMins.Length(), vAddMaxs.Length() );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -407,9 +407,9 @@ void C_SteamJet::RenderParticles( CParticleRenderIterator *pIterator )
|
|||||||
|
|
||||||
Vector vRampColor = m_Ramps[iRamp] + (m_Ramps[iRamp+1] - m_Ramps[iRamp]) * fraction;
|
Vector vRampColor = m_Ramps[iRamp] + (m_Ramps[iRamp+1] - m_Ramps[iRamp]) * fraction;
|
||||||
|
|
||||||
vRampColor[0] = min( 1.0f, vRampColor[0] );
|
vRampColor[0] = MIN( 1.0f, vRampColor[0] );
|
||||||
vRampColor[1] = min( 1.0f, vRampColor[1] );
|
vRampColor[1] = MIN( 1.0f, vRampColor[1] );
|
||||||
vRampColor[2] = min( 1.0f, vRampColor[2] );
|
vRampColor[2] = MIN( 1.0f, vRampColor[2] );
|
||||||
|
|
||||||
float sinLifetime = sin(pParticle->m_Lifetime * 3.14159f / pParticle->m_DieTime);
|
float sinLifetime = sin(pParticle->m_Lifetime * 3.14159f / pParticle->m_DieTime);
|
||||||
|
|
||||||
@ -518,7 +518,7 @@ void C_SteamJet::UpdateLightingRamp()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Renormalize?
|
// Renormalize?
|
||||||
float maxVal = max(pRamp->x, max(pRamp->y, pRamp->z));
|
float maxVal = MAX(pRamp->x, MAX(pRamp->y, pRamp->z));
|
||||||
if(maxVal > 1)
|
if(maxVal > 1)
|
||||||
{
|
{
|
||||||
*pRamp = *pRamp / maxVal;
|
*pRamp = *pRamp / maxVal;
|
||||||
|
@ -57,7 +57,7 @@ void C_Sun::OnDataChanged( DataUpdateType_t updateType )
|
|||||||
// for the sun, which should always be completely opaque at its core. Here, we renormalize the
|
// for the sun, which should always be completely opaque at its core. Here, we renormalize the
|
||||||
// components to make sure only hue is altered.
|
// components to make sure only hue is altered.
|
||||||
|
|
||||||
float maxComponent = max ( m_clrRender->r, max ( m_clrRender->g, m_clrRender->b ) );
|
float maxComponent = MAX ( m_clrRender->r, MAX ( m_clrRender->g, m_clrRender->b ) );
|
||||||
|
|
||||||
Vector vOverlayColor;
|
Vector vOverlayColor;
|
||||||
Vector vMainColor;
|
Vector vMainColor;
|
||||||
|
@ -188,8 +188,8 @@ int C_LocalTempEntity::DrawModel( int flags )
|
|||||||
float flDot = DotProduct( m_vecNormal, vecDelta );
|
float flDot = DotProduct( m_vecNormal, vecDelta );
|
||||||
if ( flDot > 0 )
|
if ( flDot > 0 )
|
||||||
{
|
{
|
||||||
float flAlpha = RemapVal( min(flDot,0.3), 0, 0.3, 0, 1 );
|
float flAlpha = RemapVal( MIN(flDot,0.3), 0, 0.3, 0, 1 );
|
||||||
flAlpha = max( 1.0, tempent_renderamt - (tempent_renderamt * flAlpha) );
|
flAlpha = MAX( 1.0, tempent_renderamt - (tempent_renderamt * flAlpha) );
|
||||||
SetRenderColorA( flAlpha );
|
SetRenderColorA( flAlpha );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2022,11 +2022,11 @@ void CTempEnts::PlaySound ( C_LocalTempEntity *pTemp, float damp )
|
|||||||
|
|
||||||
if ( isshellcasing )
|
if ( isshellcasing )
|
||||||
{
|
{
|
||||||
fvol *= min (1.0, ((float)zvel) / 350.0);
|
fvol *= MIN (1.0, ((float)zvel) / 350.0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
fvol *= min (1.0, ((float)zvel) / 450.0);
|
fvol *= MIN (1.0, ((float)zvel) / 450.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !random->RandomInt(0,3) && !isshellcasing )
|
if ( !random->RandomInt(0,3) && !isshellcasing )
|
||||||
|
@ -300,8 +300,8 @@ void DefaultRenderBoundsWorldspace( IClientRenderable *pRenderable, Vector &absM
|
|||||||
// if our origin is actually farther away than that, expand again
|
// if our origin is actually farther away than that, expand again
|
||||||
float radius = pEnt->GetLocalOrigin().Length();
|
float radius = pEnt->GetLocalOrigin().Length();
|
||||||
|
|
||||||
float flBloatSize = max( vAddMins.Length(), vAddMaxs.Length() );
|
float flBloatSize = MAX( vAddMins.Length(), vAddMaxs.Length() );
|
||||||
flBloatSize = max(flBloatSize, radius);
|
flBloatSize = MAX(flBloatSize, radius);
|
||||||
absMins -= Vector( flBloatSize, flBloatSize, flBloatSize );
|
absMins -= Vector( flBloatSize, flBloatSize, flBloatSize );
|
||||||
absMaxs += Vector( flBloatSize, flBloatSize, flBloatSize );
|
absMaxs += Vector( flBloatSize, flBloatSize, flBloatSize );
|
||||||
return;
|
return;
|
||||||
@ -360,8 +360,8 @@ void CalcRenderableWorldSpaceAABB_Fast( IClientRenderable *pRenderable, Vector &
|
|||||||
// if our origin is actually farther away than that, expand again
|
// if our origin is actually farther away than that, expand again
|
||||||
float radius = pEnt->GetLocalOrigin().Length();
|
float radius = pEnt->GetLocalOrigin().Length();
|
||||||
|
|
||||||
float flBloatSize = max( vAddMins.Length(), vAddMaxs.Length() );
|
float flBloatSize = MAX( vAddMins.Length(), vAddMaxs.Length() );
|
||||||
flBloatSize = max(flBloatSize, radius);
|
flBloatSize = MAX(flBloatSize, radius);
|
||||||
absMin -= Vector( flBloatSize, flBloatSize, flBloatSize );
|
absMin -= Vector( flBloatSize, flBloatSize, flBloatSize );
|
||||||
absMax += Vector( flBloatSize, flBloatSize, flBloatSize );
|
absMax += Vector( flBloatSize, flBloatSize, flBloatSize );
|
||||||
}
|
}
|
||||||
@ -895,7 +895,7 @@ void CClientLeafSystem::ProjectShadow( ClientLeafShadowHandle_t handle, const Ve
|
|||||||
VectorMultiply( dir, maxDist, ray.m_Delta );
|
VectorMultiply( dir, maxDist, ray.m_Delta );
|
||||||
ray.m_StartOffset.Init( 0, 0, 0 );
|
ray.m_StartOffset.Init( 0, 0, 0 );
|
||||||
|
|
||||||
float maxsize = max( size.x, size.y ) * 0.5f;
|
float maxsize = MAX( size.x, size.y ) * 0.5f;
|
||||||
ray.m_Extents.Init( maxsize, maxsize, maxsize );
|
ray.m_Extents.Init( maxsize, maxsize, maxsize );
|
||||||
ray.m_IsRay = false;
|
ray.m_IsRay = false;
|
||||||
ray.m_IsSwept = true;
|
ray.m_IsSwept = true;
|
||||||
|
@ -1333,8 +1333,8 @@ void CClientShadowMgr::SetupRenderToTextureShadow( ClientShadowHandle_t h )
|
|||||||
// Compute the maximum dimension
|
// Compute the maximum dimension
|
||||||
Vector size;
|
Vector size;
|
||||||
VectorSubtract( maxs, mins, size );
|
VectorSubtract( maxs, mins, size );
|
||||||
float maxSize = max( size.x, size.y );
|
float maxSize = MAX( size.x, size.y );
|
||||||
maxSize = max( maxSize, size.z );
|
maxSize = MAX( maxSize, size.z );
|
||||||
|
|
||||||
// Figure out the texture size
|
// Figure out the texture size
|
||||||
// For now, we're going to assume a fixed number of shadow texels
|
// For now, we're going to assume a fixed number of shadow texels
|
||||||
|
@ -144,7 +144,7 @@ void CHudDeathNotice::Paint()
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
rgDeathNoticeList[i].flDisplayTime = min( rgDeathNoticeList[i].flDisplayTime, gpGlobals->curtime + DEATHNOTICE_DISPLAY_TIME );
|
rgDeathNoticeList[i].flDisplayTime = MIN( rgDeathNoticeList[i].flDisplayTime, gpGlobals->curtime + DEATHNOTICE_DISPLAY_TIME );
|
||||||
|
|
||||||
// Draw the death notice
|
// Draw the death notice
|
||||||
y = DEATHNOTICE_TOP + (20 * i) + 100; //!!!
|
y = DEATHNOTICE_TOP + (20 * i) + 100; //!!!
|
||||||
|
@ -1346,8 +1346,8 @@ void CDetailObjectSystem::LevelInitPostEntity()
|
|||||||
|
|
||||||
if ( GetDetailController() )
|
if ( GetDetailController() )
|
||||||
{
|
{
|
||||||
cl_detailfade.SetValue( min( m_flDefaultFadeStart, GetDetailController()->m_flFadeStartDist ) );
|
cl_detailfade.SetValue( MIN( m_flDefaultFadeStart, GetDetailController()->m_flFadeStartDist ) );
|
||||||
cl_detaildist.SetValue( min( m_flDefaultFadeEnd, GetDetailController()->m_flFadeEndDist ) );
|
cl_detaildist.SetValue( MIN( m_flDefaultFadeEnd, GetDetailController()->m_flFadeEndDist ) );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -656,8 +656,8 @@ public:
|
|||||||
int color[3][2];
|
int color[3][2];
|
||||||
for( int i = 0; i < 3; ++i )
|
for( int i = 0; i < 3; ++i )
|
||||||
{
|
{
|
||||||
color[i][0] = max( 0, m_SpurtColor[i] - 64 );
|
color[i][0] = MAX( 0, m_SpurtColor[i] - 64 );
|
||||||
color[i][1] = min( 255, m_SpurtColor[i] + 64 );
|
color[i][1] = MIN( 255, m_SpurtColor[i] + 64 );
|
||||||
}
|
}
|
||||||
pParticle->m_uchColor[0] = random->RandomInt( color[0][0], color[0][1] );
|
pParticle->m_uchColor[0] = random->RandomInt( color[0][0], color[0][1] );
|
||||||
pParticle->m_uchColor[1] = random->RandomInt( color[1][0], color[1][1] );
|
pParticle->m_uchColor[1] = random->RandomInt( color[1][0], color[1][1] );
|
||||||
@ -1052,9 +1052,9 @@ void FX_Tesla( const CTeslaInfo &teslaInfo )
|
|||||||
pParticle->m_vecVelocity = vec3_origin;
|
pParticle->m_vecVelocity = vec3_origin;
|
||||||
Vector color( 1,1,1 );
|
Vector color( 1,1,1 );
|
||||||
float colorRamp = RandomFloat( 0.75f, 1.25f );
|
float colorRamp = RandomFloat( 0.75f, 1.25f );
|
||||||
pParticle->m_uchColor[0] = min( 1.0f, color[0] * colorRamp ) * 255.0f;
|
pParticle->m_uchColor[0] = MIN( 1.0f, color[0] * colorRamp ) * 255.0f;
|
||||||
pParticle->m_uchColor[1] = min( 1.0f, color[1] * colorRamp ) * 255.0f;
|
pParticle->m_uchColor[1] = MIN( 1.0f, color[1] * colorRamp ) * 255.0f;
|
||||||
pParticle->m_uchColor[2] = min( 1.0f, color[2] * colorRamp ) * 255.0f;
|
pParticle->m_uchColor[2] = MIN( 1.0f, color[2] * colorRamp ) * 255.0f;
|
||||||
pParticle->m_uchStartSize = RandomFloat( 6,13 );
|
pParticle->m_uchStartSize = RandomFloat( 6,13 );
|
||||||
pParticle->m_uchEndSize = pParticle->m_uchStartSize - 2;
|
pParticle->m_uchEndSize = pParticle->m_uchStartSize - 2;
|
||||||
pParticle->m_uchStartAlpha = 255;
|
pParticle->m_uchStartAlpha = 255;
|
||||||
|
@ -226,9 +226,9 @@ void FX_BloodSpray( const Vector &origin, const Vector &normal, float scale, uns
|
|||||||
|
|
||||||
colorRamp = random->RandomFloat( 0.75f, 1.25f );
|
colorRamp = random->RandomFloat( 0.75f, 1.25f );
|
||||||
|
|
||||||
pParticle->m_uchColor[0] = min( 1.0f, color[0] * colorRamp ) * 255.0f;
|
pParticle->m_uchColor[0] = MIN( 1.0f, color[0] * colorRamp ) * 255.0f;
|
||||||
pParticle->m_uchColor[1] = min( 1.0f, color[1] * colorRamp ) * 255.0f;
|
pParticle->m_uchColor[1] = MIN( 1.0f, color[1] * colorRamp ) * 255.0f;
|
||||||
pParticle->m_uchColor[2] = min( 1.0f, color[2] * colorRamp ) * 255.0f;
|
pParticle->m_uchColor[2] = MIN( 1.0f, color[2] * colorRamp ) * 255.0f;
|
||||||
|
|
||||||
pParticle->m_uchStartSize = random->RandomFloat( scale * 0.25, scale );
|
pParticle->m_uchStartSize = random->RandomFloat( scale * 0.25, scale );
|
||||||
pParticle->m_uchEndSize = pParticle->m_uchStartSize * 2;
|
pParticle->m_uchEndSize = pParticle->m_uchStartSize * 2;
|
||||||
@ -271,9 +271,9 @@ void FX_BloodSpray( const Vector &origin, const Vector &normal, float scale, uns
|
|||||||
|
|
||||||
colorRamp = random->RandomFloat( 0.75f, 1.25f );
|
colorRamp = random->RandomFloat( 0.75f, 1.25f );
|
||||||
|
|
||||||
pParticle->m_uchColor[0] = min( 1.0f, color[0] * colorRamp ) * 255.0f;
|
pParticle->m_uchColor[0] = MIN( 1.0f, color[0] * colorRamp ) * 255.0f;
|
||||||
pParticle->m_uchColor[1] = min( 1.0f, color[1] * colorRamp ) * 255.0f;
|
pParticle->m_uchColor[1] = MIN( 1.0f, color[1] * colorRamp ) * 255.0f;
|
||||||
pParticle->m_uchColor[2] = min( 1.0f, color[2] * colorRamp ) * 255.0f;
|
pParticle->m_uchColor[2] = MIN( 1.0f, color[2] * colorRamp ) * 255.0f;
|
||||||
|
|
||||||
pParticle->m_uchStartSize = random->RandomFloat( scale * 1.5f, scale * 2.0f );
|
pParticle->m_uchStartSize = random->RandomFloat( scale * 1.5f, scale * 2.0f );
|
||||||
pParticle->m_uchEndSize = pParticle->m_uchStartSize * 4;
|
pParticle->m_uchEndSize = pParticle->m_uchStartSize * 4;
|
||||||
@ -356,9 +356,9 @@ void FX_BloodBulletImpact( const Vector &origin, const Vector &normal, float sca
|
|||||||
|
|
||||||
colorRamp = random->RandomFloat( 0.75f, 2.0f );
|
colorRamp = random->RandomFloat( 0.75f, 2.0f );
|
||||||
|
|
||||||
pParticle->m_uchColor[0] = min( 1.0f, color[0] * colorRamp ) * 255.0f;
|
pParticle->m_uchColor[0] = MIN( 1.0f, color[0] * colorRamp ) * 255.0f;
|
||||||
pParticle->m_uchColor[1] = min( 1.0f, color[1] * colorRamp ) * 255.0f;
|
pParticle->m_uchColor[1] = MIN( 1.0f, color[1] * colorRamp ) * 255.0f;
|
||||||
pParticle->m_uchColor[2] = min( 1.0f, color[2] * colorRamp ) * 255.0f;
|
pParticle->m_uchColor[2] = MIN( 1.0f, color[2] * colorRamp ) * 255.0f;
|
||||||
|
|
||||||
pParticle->m_uchStartSize = random->RandomInt( 2, 4 );
|
pParticle->m_uchStartSize = random->RandomInt( 2, 4 );
|
||||||
pParticle->m_uchEndSize = pParticle->m_uchStartSize * 8;
|
pParticle->m_uchEndSize = pParticle->m_uchStartSize * 8;
|
||||||
@ -392,9 +392,9 @@ void FX_BloodBulletImpact( const Vector &origin, const Vector &normal, float sca
|
|||||||
|
|
||||||
colorRamp = random->RandomFloat( 0.75f, 2.0f );
|
colorRamp = random->RandomFloat( 0.75f, 2.0f );
|
||||||
|
|
||||||
pParticle->m_uchColor[0] = min( 1.0f, color[0] * colorRamp ) * 255.0f;
|
pParticle->m_uchColor[0] = MIN( 1.0f, color[0] * colorRamp ) * 255.0f;
|
||||||
pParticle->m_uchColor[1] = min( 1.0f, color[1] * colorRamp ) * 255.0f;
|
pParticle->m_uchColor[1] = MIN( 1.0f, color[1] * colorRamp ) * 255.0f;
|
||||||
pParticle->m_uchColor[2] = min( 1.0f, color[2] * colorRamp ) * 255.0f;
|
pParticle->m_uchColor[2] = MIN( 1.0f, color[2] * colorRamp ) * 255.0f;
|
||||||
|
|
||||||
pParticle->m_uchStartSize = random->RandomInt( 2, 4 );
|
pParticle->m_uchStartSize = random->RandomInt( 2, 4 );
|
||||||
pParticle->m_uchEndSize = pParticle->m_uchStartSize * 4;
|
pParticle->m_uchEndSize = pParticle->m_uchStartSize * 4;
|
||||||
|
@ -76,8 +76,8 @@ void CFXDiscreetLine::Draw( double frametime )
|
|||||||
float eDistance = sDistance - m_fLength;
|
float eDistance = sDistance - m_fLength;
|
||||||
|
|
||||||
//Clip to start
|
//Clip to start
|
||||||
sDistance = max( 0.0f, sDistance );
|
sDistance = MAX( 0.0f, sDistance );
|
||||||
eDistance = max( 0.0f, eDistance );
|
eDistance = MAX( 0.0f, eDistance );
|
||||||
|
|
||||||
if ( ( sDistance == 0.0f ) && ( eDistance == 0.0f ) )
|
if ( ( sDistance == 0.0f ) && ( eDistance == 0.0f ) )
|
||||||
return;
|
return;
|
||||||
@ -85,8 +85,8 @@ void CFXDiscreetLine::Draw( double frametime )
|
|||||||
// Clip it
|
// Clip it
|
||||||
if ( m_fClipLength != 0.0f )
|
if ( m_fClipLength != 0.0f )
|
||||||
{
|
{
|
||||||
sDistance = min( sDistance, m_fClipLength );
|
sDistance = MIN( sDistance, m_fClipLength );
|
||||||
eDistance = min( eDistance, m_fClipLength );
|
eDistance = MIN( eDistance, m_fClipLength );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get our delta to calculate the tc offset
|
// Get our delta to calculate the tc offset
|
||||||
|
@ -680,9 +680,9 @@ void C_BaseExplosionEffect::CreateDebris( void )
|
|||||||
pParticle->m_flRollDelta = random->RandomFloat( 0, 360 );
|
pParticle->m_flRollDelta = random->RandomFloat( 0, 360 );
|
||||||
|
|
||||||
float colorRamp = random->RandomFloat( 0.5f, 1.5f );
|
float colorRamp = random->RandomFloat( 0.5f, 1.5f );
|
||||||
pParticle->m_uchColor[0] = min( 1.0f, 0.25f*colorRamp )*255.0f;
|
pParticle->m_uchColor[0] = MIN( 1.0f, 0.25f*colorRamp )*255.0f;
|
||||||
pParticle->m_uchColor[1] = min( 1.0f, 0.25f*colorRamp )*255.0f;
|
pParticle->m_uchColor[1] = MIN( 1.0f, 0.25f*colorRamp )*255.0f;
|
||||||
pParticle->m_uchColor[2] = min( 1.0f, 0.25f*colorRamp )*255.0f;
|
pParticle->m_uchColor[2] = MIN( 1.0f, 0.25f*colorRamp )*255.0f;
|
||||||
}
|
}
|
||||||
#endif // !_XBOX
|
#endif // !_XBOX
|
||||||
}
|
}
|
||||||
@ -1205,7 +1205,7 @@ void C_WaterExplosionEffect::CreateMisc( void )
|
|||||||
|
|
||||||
colorRamp = random->RandomFloat( 1.5f, 2.0f );
|
colorRamp = random->RandomFloat( 1.5f, 2.0f );
|
||||||
|
|
||||||
FloatToColor32( tParticle->m_color, min( 1.0f, m_vecColor[0] * colorRamp ), min( 1.0f, m_vecColor[1] * colorRamp ), min( 1.0f, m_vecColor[2] * colorRamp ), m_flLuminosity );
|
FloatToColor32( tParticle->m_color, MIN( 1.0f, m_vecColor[0] * colorRamp ), MIN( 1.0f, m_vecColor[1] * colorRamp ), MIN( 1.0f, m_vecColor[2] * colorRamp ), m_flLuminosity );
|
||||||
}
|
}
|
||||||
|
|
||||||
//Dump out drops
|
//Dump out drops
|
||||||
@ -1233,7 +1233,7 @@ void C_WaterExplosionEffect::CreateMisc( void )
|
|||||||
|
|
||||||
colorRamp = random->RandomFloat( 1.5f, 2.0f );
|
colorRamp = random->RandomFloat( 1.5f, 2.0f );
|
||||||
|
|
||||||
FloatToColor32( tParticle->m_color, min( 1.0f, m_vecColor[0] * colorRamp ), min( 1.0f, m_vecColor[1] * colorRamp ), min( 1.0f, m_vecColor[2] * colorRamp ), m_flLuminosity );
|
FloatToColor32( tParticle->m_color, MIN( 1.0f, m_vecColor[0] * colorRamp ), MIN( 1.0f, m_vecColor[1] * colorRamp ), MIN( 1.0f, m_vecColor[2] * colorRamp ), m_flLuminosity );
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@ -1264,12 +1264,12 @@ void C_WaterExplosionEffect::CreateMisc( void )
|
|||||||
|
|
||||||
colorRamp = random->RandomFloat( 0.75f, 1.25f );
|
colorRamp = random->RandomFloat( 0.75f, 1.25f );
|
||||||
|
|
||||||
pParticle->m_uchColor[0] = min( 1.0f, m_vecColor[0] * colorRamp ) * 255.0f;
|
pParticle->m_uchColor[0] = MIN( 1.0f, m_vecColor[0] * colorRamp ) * 255.0f;
|
||||||
pParticle->m_uchColor[1] = min( 1.0f, m_vecColor[1] * colorRamp ) * 255.0f;
|
pParticle->m_uchColor[1] = MIN( 1.0f, m_vecColor[1] * colorRamp ) * 255.0f;
|
||||||
pParticle->m_uchColor[2] = min( 1.0f, m_vecColor[2] * colorRamp ) * 255.0f;
|
pParticle->m_uchColor[2] = MIN( 1.0f, m_vecColor[2] * colorRamp ) * 255.0f;
|
||||||
|
|
||||||
pParticle->m_uchStartSize = 24 * flScale * RemapValClamped( i, 7, 0, 1, 0.5f );
|
pParticle->m_uchStartSize = 24 * flScale * RemapValClamped( i, 7, 0, 1, 0.5f );
|
||||||
pParticle->m_uchEndSize = min( 255, pParticle->m_uchStartSize * 2 );
|
pParticle->m_uchEndSize = MIN( 255, pParticle->m_uchStartSize * 2 );
|
||||||
|
|
||||||
pParticle->m_uchStartAlpha = RemapValClamped( i, 7, 0, 255, 32 ) * m_flLuminosity;
|
pParticle->m_uchStartAlpha = RemapValClamped( i, 7, 0, 255, 32 ) * m_flLuminosity;
|
||||||
pParticle->m_uchEndAlpha = 0;
|
pParticle->m_uchEndAlpha = 0;
|
||||||
|
@ -1148,9 +1148,9 @@ void FX_Explosion( Vector& origin, Vector& normal, char materialType )
|
|||||||
pParticle->m_flRollDelta = random->RandomFloat( 0, 360 );
|
pParticle->m_flRollDelta = random->RandomFloat( 0, 360 );
|
||||||
|
|
||||||
float colorRamp = random->RandomFloat( 0.75f, 1.5f );
|
float colorRamp = random->RandomFloat( 0.75f, 1.5f );
|
||||||
pParticle->m_uchColor[0] = min( 1.0f, r*colorRamp )*255.0f;
|
pParticle->m_uchColor[0] = MIN( 1.0f, r*colorRamp )*255.0f;
|
||||||
pParticle->m_uchColor[1] = min( 1.0f, g*colorRamp )*255.0f;
|
pParticle->m_uchColor[1] = MIN( 1.0f, g*colorRamp )*255.0f;
|
||||||
pParticle->m_uchColor[2] = min( 1.0f, b*colorRamp )*255.0f;
|
pParticle->m_uchColor[2] = MIN( 1.0f, b*colorRamp )*255.0f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1171,9 +1171,9 @@ void FX_Explosion( Vector& origin, Vector& normal, char materialType )
|
|||||||
pSphereParticle->m_vecVelocity = Vector(0,0,0);
|
pSphereParticle->m_vecVelocity = Vector(0,0,0);
|
||||||
|
|
||||||
float colorRamp = random->RandomFloat( 0.75f, 1.5f );
|
float colorRamp = random->RandomFloat( 0.75f, 1.5f );
|
||||||
pSphereParticle->m_uchColor[0] = min( 1.0f, r*colorRamp )*255.0f;
|
pSphereParticle->m_uchColor[0] = MIN( 1.0f, r*colorRamp )*255.0f;
|
||||||
pSphereParticle->m_uchColor[1] = min( 1.0f, g*colorRamp )*255.0f;
|
pSphereParticle->m_uchColor[1] = MIN( 1.0f, g*colorRamp )*255.0f;
|
||||||
pSphereParticle->m_uchColor[2] = min( 1.0f, b*colorRamp )*255.0f;
|
pSphereParticle->m_uchColor[2] = MIN( 1.0f, b*colorRamp )*255.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Throw some smoke balls out around the normal
|
// Throw some smoke balls out around the normal
|
||||||
@ -1200,9 +1200,9 @@ void FX_Explosion( Vector& origin, Vector& normal, char materialType )
|
|||||||
pParticle->m_vecVelocity = (vecRight*x + vecUp*y) * 1024.0;
|
pParticle->m_vecVelocity = (vecRight*x + vecUp*y) * 1024.0;
|
||||||
|
|
||||||
float colorRamp = random->RandomFloat( 0.75f, 1.5f );
|
float colorRamp = random->RandomFloat( 0.75f, 1.5f );
|
||||||
pParticle->m_uchColor[0] = min( 1.0f, r*colorRamp )*255.0f;
|
pParticle->m_uchColor[0] = MIN( 1.0f, r*colorRamp )*255.0f;
|
||||||
pParticle->m_uchColor[1] = min( 1.0f, g*colorRamp )*255.0f;
|
pParticle->m_uchColor[1] = MIN( 1.0f, g*colorRamp )*255.0f;
|
||||||
pParticle->m_uchColor[2] = min( 1.0f, b*colorRamp )*255.0f;
|
pParticle->m_uchColor[2] = MIN( 1.0f, b*colorRamp )*255.0f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1230,9 +1230,9 @@ void FX_Explosion( Vector& origin, Vector& normal, char materialType )
|
|||||||
pParticle->m_flRollDelta = random->RandomFloat( -1, 1 );
|
pParticle->m_flRollDelta = random->RandomFloat( -1, 1 );
|
||||||
|
|
||||||
float colorRamp = random->RandomFloat( 0.5f, 1.25f );
|
float colorRamp = random->RandomFloat( 0.5f, 1.25f );
|
||||||
pParticle->m_uchColor[0] = min( 1.0f, r*colorRamp )*255.0f;
|
pParticle->m_uchColor[0] = MIN( 1.0f, r*colorRamp )*255.0f;
|
||||||
pParticle->m_uchColor[1] = min( 1.0f, g*colorRamp )*255.0f;
|
pParticle->m_uchColor[1] = MIN( 1.0f, g*colorRamp )*255.0f;
|
||||||
pParticle->m_uchColor[2] = min( 1.0f, b*colorRamp )*255.0f;
|
pParticle->m_uchColor[2] = MIN( 1.0f, b*colorRamp )*255.0f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -67,7 +67,7 @@ void UTIL_GetNormalizedColorTintAndLuminosity( const Vector &color, Vector *tint
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
float maxComponent = max( color.x, max( color.y, color.z ) );
|
float maxComponent = MAX( color.x, MAX( color.y, color.z ) );
|
||||||
*tint = color / maxComponent;
|
*tint = color / maxComponent;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -91,7 +91,7 @@ inline void FX_GetSplashLighting( Vector position, Vector *color, float *luminos
|
|||||||
// Fake a specular highlight (too dim otherwise)
|
// Fake a specular highlight (too dim otherwise)
|
||||||
if ( luminosity != NULL )
|
if ( luminosity != NULL )
|
||||||
{
|
{
|
||||||
*luminosity = min( 1.0f, (*luminosity) * 4.0f );
|
*luminosity = MIN( 1.0f, (*luminosity) * 4.0f );
|
||||||
|
|
||||||
// Clamp so that we never go completely translucent
|
// Clamp so that we never go completely translucent
|
||||||
if ( *luminosity < 0.25f )
|
if ( *luminosity < 0.25f )
|
||||||
@ -215,9 +215,9 @@ void FX_GunshotSplash( const Vector &origin, const Vector &normal, float scale )
|
|||||||
|
|
||||||
colorRamp = random->RandomFloat( 0.75f, 1.25f );
|
colorRamp = random->RandomFloat( 0.75f, 1.25f );
|
||||||
|
|
||||||
tParticle->m_color.r = min( 1.0f, color[0] * colorRamp ) * 255;
|
tParticle->m_color.r = MIN( 1.0f, color[0] * colorRamp ) * 255;
|
||||||
tParticle->m_color.g = min( 1.0f, color[1] * colorRamp ) * 255;
|
tParticle->m_color.g = MIN( 1.0f, color[1] * colorRamp ) * 255;
|
||||||
tParticle->m_color.b = min( 1.0f, color[2] * colorRamp ) * 255;
|
tParticle->m_color.b = MIN( 1.0f, color[2] * colorRamp ) * 255;
|
||||||
tParticle->m_color.a = luminosity * 255;
|
tParticle->m_color.a = luminosity * 255;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -250,12 +250,12 @@ void FX_GunshotSplash( const Vector &origin, const Vector &normal, float scale )
|
|||||||
|
|
||||||
colorRamp = random->RandomFloat( 0.75f, 1.25f );
|
colorRamp = random->RandomFloat( 0.75f, 1.25f );
|
||||||
|
|
||||||
pParticle->m_uchColor[0] = min( 1.0f, color[0] * colorRamp ) * 255.0f;
|
pParticle->m_uchColor[0] = MIN( 1.0f, color[0] * colorRamp ) * 255.0f;
|
||||||
pParticle->m_uchColor[1] = min( 1.0f, color[1] * colorRamp ) * 255.0f;
|
pParticle->m_uchColor[1] = MIN( 1.0f, color[1] * colorRamp ) * 255.0f;
|
||||||
pParticle->m_uchColor[2] = min( 1.0f, color[2] * colorRamp ) * 255.0f;
|
pParticle->m_uchColor[2] = MIN( 1.0f, color[2] * colorRamp ) * 255.0f;
|
||||||
|
|
||||||
pParticle->m_uchStartSize = 24 * flScale * RemapValClamped( i, 7, 0, 1, 0.5f );
|
pParticle->m_uchStartSize = 24 * flScale * RemapValClamped( i, 7, 0, 1, 0.5f );
|
||||||
pParticle->m_uchEndSize = min( 255, pParticle->m_uchStartSize * 2 );
|
pParticle->m_uchEndSize = MIN( 255, pParticle->m_uchStartSize * 2 );
|
||||||
|
|
||||||
pParticle->m_uchStartAlpha = RemapValClamped( i, 7, 0, 255, 32 ) * luminosity;
|
pParticle->m_uchStartAlpha = RemapValClamped( i, 7, 0, 255, 32 ) * luminosity;
|
||||||
pParticle->m_uchEndAlpha = 0;
|
pParticle->m_uchEndAlpha = 0;
|
||||||
@ -296,7 +296,7 @@ void FX_GunshotSlimeSplash( const Vector &origin, const Vector &normal, float sc
|
|||||||
VPROF_BUDGET( "FX_GunshotSlimeSplash", VPROF_BUDGETGROUP_PARTICLE_RENDERING );
|
VPROF_BUDGET( "FX_GunshotSlimeSplash", VPROF_BUDGETGROUP_PARTICLE_RENDERING );
|
||||||
|
|
||||||
float colorRamp;
|
float colorRamp;
|
||||||
float flScale = min( 1.0f, scale / 8.0f );
|
float flScale = MIN( 1.0f, scale / 8.0f );
|
||||||
|
|
||||||
PMaterialHandle hMaterial = ParticleMgr()->GetPMaterial( "effects/slime1" );
|
PMaterialHandle hMaterial = ParticleMgr()->GetPMaterial( "effects/slime1" );
|
||||||
PMaterialHandle hMaterial2 = ParticleMgr()->GetPMaterial( "effects/splash4" );
|
PMaterialHandle hMaterial2 = ParticleMgr()->GetPMaterial( "effects/splash4" );
|
||||||
@ -351,9 +351,9 @@ void FX_GunshotSlimeSplash( const Vector &origin, const Vector &normal, float sc
|
|||||||
|
|
||||||
colorRamp = random->RandomFloat( 0.75f, 1.25f );
|
colorRamp = random->RandomFloat( 0.75f, 1.25f );
|
||||||
|
|
||||||
tParticle->m_color.r = min( 1.0f, color.x * colorRamp ) * 255;
|
tParticle->m_color.r = MIN( 1.0f, color.x * colorRamp ) * 255;
|
||||||
tParticle->m_color.g = min( 1.0f, color.y * colorRamp ) * 255;
|
tParticle->m_color.g = MIN( 1.0f, color.y * colorRamp ) * 255;
|
||||||
tParticle->m_color.b = min( 1.0f, color.z * colorRamp ) * 255;
|
tParticle->m_color.b = MIN( 1.0f, color.z * colorRamp ) * 255;
|
||||||
tParticle->m_color.a = 255 * luminosity;
|
tParticle->m_color.a = 255 * luminosity;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -394,12 +394,12 @@ void FX_GunshotSlimeSplash( const Vector &origin, const Vector &normal, float sc
|
|||||||
|
|
||||||
colorRamp = random->RandomFloat( 0.75f, 1.25f );
|
colorRamp = random->RandomFloat( 0.75f, 1.25f );
|
||||||
|
|
||||||
pParticle->m_uchColor[0] = min( 1.0f, color[0] * colorRamp ) * 255.0f;
|
pParticle->m_uchColor[0] = MIN( 1.0f, color[0] * colorRamp ) * 255.0f;
|
||||||
pParticle->m_uchColor[1] = min( 1.0f, color[1] * colorRamp ) * 255.0f;
|
pParticle->m_uchColor[1] = MIN( 1.0f, color[1] * colorRamp ) * 255.0f;
|
||||||
pParticle->m_uchColor[2] = min( 1.0f, color[2] * colorRamp ) * 255.0f;
|
pParticle->m_uchColor[2] = MIN( 1.0f, color[2] * colorRamp ) * 255.0f;
|
||||||
|
|
||||||
pParticle->m_uchStartSize = 24 * flScale * RemapValClamped( i, 7, 0, 1, 0.5f );
|
pParticle->m_uchStartSize = 24 * flScale * RemapValClamped( i, 7, 0, 1, 0.5f );
|
||||||
pParticle->m_uchEndSize = min( 255, pParticle->m_uchStartSize * 2 );
|
pParticle->m_uchEndSize = MIN( 255, pParticle->m_uchStartSize * 2 );
|
||||||
|
|
||||||
pParticle->m_uchStartAlpha = RemapValClamped( i, 7, 0, 255, 32 ) * luminosity;
|
pParticle->m_uchStartAlpha = RemapValClamped( i, 7, 0, 255, 32 ) * luminosity;
|
||||||
pParticle->m_uchEndAlpha = 0;
|
pParticle->m_uchEndAlpha = 0;
|
||||||
|
@ -1094,7 +1094,7 @@ void CMapOverview::UpdateSizeAndPosition()
|
|||||||
if ( y < iTopBarHeight )
|
if ( y < iTopBarHeight )
|
||||||
y = iTopBarHeight;
|
y = iTopBarHeight;
|
||||||
|
|
||||||
SetBounds( x,y,w,min(h,iScreenTall) );
|
SetBounds( x,y,w,MIN(h,iScreenTall) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -90,8 +90,8 @@ void CNavProgress::Init( const char *title, int numTicks, int startTick )
|
|||||||
{
|
{
|
||||||
m_pText->SetText( title );
|
m_pText->SetText( title );
|
||||||
|
|
||||||
m_numTicks = max( 1, numTicks ); // non-zero, since we'll divide by this
|
m_numTicks = MAX( 1, numTicks ); // non-zero, since we'll divide by this
|
||||||
m_currentTick = max( 0, min( m_numTicks, startTick ) );
|
m_currentTick = MAX( 0, MIN( m_numTicks, startTick ) );
|
||||||
|
|
||||||
InvalidateLayout();
|
InvalidateLayout();
|
||||||
}
|
}
|
||||||
|
@ -192,7 +192,7 @@ void CTextWindow::ShowFile( const char *filename )
|
|||||||
|
|
||||||
char buffer[2048];
|
char buffer[2048];
|
||||||
|
|
||||||
int size = min( vgui::filesystem()->Size( f ), sizeof(buffer)-1 ); // just allow 2KB
|
int size = MIN( vgui::filesystem()->Size( f ), sizeof(buffer)-1 ); // just allow 2KB
|
||||||
|
|
||||||
vgui::filesystem()->Read( buffer, size, f );
|
vgui::filesystem()->Read( buffer, size, f );
|
||||||
vgui::filesystem()->Close( f );
|
vgui::filesystem()->Close( f );
|
||||||
|
@ -256,7 +256,7 @@ void CGlowOverlay::UpdateGlowObstruction( const Vector &vToGlow, bool bCacheFull
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_flGlowObstructionScale -= gpGlobals->frametime / cl_sun_decay_rate.GetFloat();
|
m_flGlowObstructionScale -= gpGlobals->frametime / cl_sun_decay_rate.GetFloat();
|
||||||
m_flGlowObstructionScale = max( m_flGlowObstructionScale, 0.0f );
|
m_flGlowObstructionScale = MAX( m_flGlowObstructionScale, 0.0f );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -268,7 +268,7 @@ void CGlowOverlay::UpdateGlowObstruction( const Vector &vToGlow, bool bCacheFull
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_flGlowObstructionScale += gpGlobals->frametime / cl_sun_decay_rate.GetFloat();
|
m_flGlowObstructionScale += gpGlobals->frametime / cl_sun_decay_rate.GetFloat();
|
||||||
m_flGlowObstructionScale = min( m_flGlowObstructionScale, 1.0f );
|
m_flGlowObstructionScale = MIN( m_flGlowObstructionScale, 1.0f );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -294,7 +294,7 @@ void CHudHistoryResource::Paint( void )
|
|||||||
{
|
{
|
||||||
if ( m_PickupHistory[i].type )
|
if ( m_PickupHistory[i].type )
|
||||||
{
|
{
|
||||||
m_PickupHistory[i].DisplayTime = min( m_PickupHistory[i].DisplayTime, gpGlobals->curtime + hud_drawhistory_time.GetFloat() );
|
m_PickupHistory[i].DisplayTime = MIN( m_PickupHistory[i].DisplayTime, gpGlobals->curtime + hud_drawhistory_time.GetFloat() );
|
||||||
if ( m_PickupHistory[i].DisplayTime <= gpGlobals->curtime )
|
if ( m_PickupHistory[i].DisplayTime <= gpGlobals->curtime )
|
||||||
{
|
{
|
||||||
// pic drawing time has expired
|
// pic drawing time has expired
|
||||||
@ -306,7 +306,7 @@ void CHudHistoryResource::Paint( void )
|
|||||||
float elapsed = m_PickupHistory[i].DisplayTime - gpGlobals->curtime;
|
float elapsed = m_PickupHistory[i].DisplayTime - gpGlobals->curtime;
|
||||||
float scale = elapsed * 80;
|
float scale = elapsed * 80;
|
||||||
Color clr = gHUD.m_clrNormal;
|
Color clr = gHUD.m_clrNormal;
|
||||||
clr[3] = min( scale, 255 );
|
clr[3] = MIN( scale, 255 );
|
||||||
|
|
||||||
bool bUseAmmoFullMsg = false;
|
bool bUseAmmoFullMsg = false;
|
||||||
|
|
||||||
@ -329,7 +329,7 @@ void CHudHistoryResource::Paint( void )
|
|||||||
bUseAmmoFullMsg = true;
|
bUseAmmoFullMsg = true;
|
||||||
// display as red
|
// display as red
|
||||||
clr = gHUD.m_clrCaution;
|
clr = gHUD.m_clrCaution;
|
||||||
clr[3] = min( scale, 255 );
|
clr[3] = MIN( scale, 255 );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -343,7 +343,7 @@ void CHudHistoryResource::Paint( void )
|
|||||||
{
|
{
|
||||||
// if the weapon doesn't have ammo, display it as red
|
// if the weapon doesn't have ammo, display it as red
|
||||||
clr = gHUD.m_clrCaution;
|
clr = gHUD.m_clrCaution;
|
||||||
clr[3] = min( scale, 255 );
|
clr[3] = MIN( scale, 255 );
|
||||||
}
|
}
|
||||||
|
|
||||||
itemIcon = pWeapon->GetSpriteInactive();
|
itemIcon = pWeapon->GetSpriteInactive();
|
||||||
|
@ -98,7 +98,7 @@ float C_BaseHLPlayer::GetFOV()
|
|||||||
int min_fov = ( gpGlobals->maxClients == 1 ) ? 5 : default_fov.GetInt();
|
int min_fov = ( gpGlobals->maxClients == 1 ) ? 5 : default_fov.GetInt();
|
||||||
|
|
||||||
// Don't let it go too low
|
// Don't let it go too low
|
||||||
flFOVOffset = max( min_fov, flFOVOffset );
|
flFOVOffset = MAX( min_fov, flFOVOffset );
|
||||||
|
|
||||||
return flFOVOffset;
|
return flFOVOffset;
|
||||||
}
|
}
|
||||||
@ -266,7 +266,7 @@ void C_BaseHLPlayer::PerformClientSideObstacleAvoidance( float flFrameTime, CUse
|
|||||||
|
|
||||||
if ( curspeed > 150.0f )
|
if ( curspeed > 150.0f )
|
||||||
{
|
{
|
||||||
curspeed = min( 2048.0f, curspeed );
|
curspeed = MIN( 2048.0f, curspeed );
|
||||||
|
|
||||||
factor = ( 1.0f + ( curspeed - 150.0f ) / 150.0f );
|
factor = ( 1.0f + ( curspeed - 150.0f ) / 150.0f );
|
||||||
|
|
||||||
|
@ -117,7 +117,7 @@ void C_PropCombineBall::DrawMotionBlur( void )
|
|||||||
|
|
||||||
speed = clamp( speed, 0, 32 );
|
speed = clamp( speed, 0, 32 );
|
||||||
|
|
||||||
float stepSize = min( ( speed * 0.5f ), 4.0f );
|
float stepSize = MIN( ( speed * 0.5f ), 4.0f );
|
||||||
|
|
||||||
Vector spawnPos = GetAbsOrigin();
|
Vector spawnPos = GetAbsOrigin();
|
||||||
Vector spawnStep = -vecDir * stepSize;
|
Vector spawnStep = -vecDir * stepSize;
|
||||||
|
@ -1060,9 +1060,9 @@ void StriderBlood( const Vector &origin, const Vector &normal, float scale )
|
|||||||
|
|
||||||
int randomColor = random->RandomInt( 0, 2 );
|
int randomColor = random->RandomInt( 0, 2 );
|
||||||
|
|
||||||
tParticle->m_color.r = min( 1.0f, color[randomColor].x * colorRamp ) * 255;
|
tParticle->m_color.r = MIN( 1.0f, color[randomColor].x * colorRamp ) * 255;
|
||||||
tParticle->m_color.g = min( 1.0f, color[randomColor].y * colorRamp ) * 255;
|
tParticle->m_color.g = MIN( 1.0f, color[randomColor].y * colorRamp ) * 255;
|
||||||
tParticle->m_color.b = min( 1.0f, color[randomColor].z * colorRamp ) * 255;
|
tParticle->m_color.b = MIN( 1.0f, color[randomColor].z * colorRamp ) * 255;
|
||||||
tParticle->m_color.a = 255;
|
tParticle->m_color.a = 255;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -117,7 +117,7 @@ void FX_ThumperDust( const CEffectData &data )
|
|||||||
Vector vecColor;
|
Vector vecColor;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
||||||
float flScale = min( data.m_flScale, 255 );
|
float flScale = MIN( data.m_flScale, 255 );
|
||||||
|
|
||||||
// Setup the color for these particles
|
// Setup the color for these particles
|
||||||
engine->ComputeLighting( data.m_vOrigin, NULL, true, vecColor );
|
engine->ComputeLighting( data.m_vOrigin, NULL, true, vecColor );
|
||||||
|
@ -660,9 +660,9 @@ void C_PropAirboat::DrawPontoonSplash( Vector origin, Vector direction, float sp
|
|||||||
|
|
||||||
colorRamp = random->RandomFloat( 0.75f, 1.25f );
|
colorRamp = random->RandomFloat( 0.75f, 1.25f );
|
||||||
|
|
||||||
pParticle->m_uchColor[0] = min( 1.0f, color[0] * colorRamp ) * 255.0f;
|
pParticle->m_uchColor[0] = MIN( 1.0f, color[0] * colorRamp ) * 255.0f;
|
||||||
pParticle->m_uchColor[1] = min( 1.0f, color[1] * colorRamp ) * 255.0f;
|
pParticle->m_uchColor[1] = MIN( 1.0f, color[1] * colorRamp ) * 255.0f;
|
||||||
pParticle->m_uchColor[2] = min( 1.0f, color[2] * colorRamp ) * 255.0f;
|
pParticle->m_uchColor[2] = MIN( 1.0f, color[2] * colorRamp ) * 255.0f;
|
||||||
|
|
||||||
pParticle->m_uchStartSize = random->RandomFloat( 8, 16 ) * flScale;
|
pParticle->m_uchStartSize = random->RandomFloat( 8, 16 ) * flScale;
|
||||||
pParticle->m_uchEndSize = pParticle->m_uchStartSize * 2;
|
pParticle->m_uchEndSize = pParticle->m_uchStartSize * 2;
|
||||||
|
@ -92,7 +92,7 @@ int C_CrossbowBolt::DrawModel( int flags )
|
|||||||
|
|
||||||
if ( speed > 0 )
|
if ( speed > 0 )
|
||||||
{
|
{
|
||||||
float stepSize = min( ( speed * 0.5f ), 4.0f );
|
float stepSize = MIN( ( speed * 0.5f ), 4.0f );
|
||||||
|
|
||||||
Vector spawnPos = GetAbsOrigin() + ( vecDir * 24.0f );
|
Vector spawnPos = GetAbsOrigin() + ( vecDir * 24.0f );
|
||||||
Vector spawnStep = -vecDir * stepSize;
|
Vector spawnStep = -vecDir * stepSize;
|
||||||
|
@ -197,7 +197,7 @@ void FX_PlayerAR2Tracer( const Vector &start, const Vector &end )
|
|||||||
|
|
||||||
//Randomly place the tracer along this line, with a random length
|
//Randomly place the tracer along this line, with a random length
|
||||||
VectorMA( start, random->RandomFloat( 0.0f, 8.0f ), shotDir, dStart );
|
VectorMA( start, random->RandomFloat( 0.0f, 8.0f ), shotDir, dStart );
|
||||||
VectorMA( dStart, min( length, random->RandomFloat( 256.0f, 1024.0f ) ), shotDir, dEnd );
|
VectorMA( dStart, MIN( length, random->RandomFloat( 256.0f, 1024.0f ) ), shotDir, dEnd );
|
||||||
|
|
||||||
//Create the line
|
//Create the line
|
||||||
CFXStaticLine *tracerLine = new CFXStaticLine( "Tracer", dStart, dEnd, random->RandomFloat( 6.0f, 12.0f ), 0.01f, "effects/gunshiptracer", 0 );
|
CFXStaticLine *tracerLine = new CFXStaticLine( "Tracer", dStart, dEnd, random->RandomFloat( 6.0f, 12.0f ), 0.01f, "effects/gunshiptracer", 0 );
|
||||||
|
@ -286,11 +286,11 @@ void CHUDAutoAim::OnThink()
|
|||||||
Vector vecGoal( goalx, goaly, 0 );
|
Vector vecGoal( goalx, goaly, 0 );
|
||||||
Vector vecDir = vecGoal - m_vecPos;
|
Vector vecDir = vecGoal - m_vecPos;
|
||||||
float flDistRemaining = VectorNormalize( vecDir );
|
float flDistRemaining = VectorNormalize( vecDir );
|
||||||
m_vecPos += vecDir * min(flDistRemaining, (speed * gpGlobals->frametime) );
|
m_vecPos += vecDir * MIN(flDistRemaining, (speed * gpGlobals->frametime) );
|
||||||
|
|
||||||
// Lerp and Clamp scale
|
// Lerp and Clamp scale
|
||||||
float scaleDelta = fabs( goalscale - m_scale );
|
float scaleDelta = fabs( goalscale - m_scale );
|
||||||
float scaleMove = min( AUTOAIM_SCALE_SPEED * gpGlobals->frametime, scaleDelta );
|
float scaleMove = MIN( AUTOAIM_SCALE_SPEED * gpGlobals->frametime, scaleDelta );
|
||||||
if( m_scale < goalscale )
|
if( m_scale < goalscale )
|
||||||
{
|
{
|
||||||
m_scale += scaleMove;
|
m_scale += scaleMove;
|
||||||
|
@ -315,7 +315,7 @@ void CHudCredits::DrawOutroCreditsName( void )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
cColor[3] = max( 0, m_Alpha );
|
cColor[3] = MAX( 0, m_Alpha );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -361,7 +361,7 @@ void CHudCredits::DrawLogo( void )
|
|||||||
{
|
{
|
||||||
float flDeltaTime = ( m_flFadeTime - gpGlobals->curtime );
|
float flDeltaTime = ( m_flFadeTime - gpGlobals->curtime );
|
||||||
|
|
||||||
m_Alpha = max( 0, RemapValClamped( flDeltaTime, 5.0f, 0, -128, 255 ) );
|
m_Alpha = MAX( 0, RemapValClamped( flDeltaTime, 5.0f, 0, -128, 255 ) );
|
||||||
|
|
||||||
if ( flDeltaTime <= 0.0f )
|
if ( flDeltaTime <= 0.0f )
|
||||||
{
|
{
|
||||||
|
@ -117,7 +117,7 @@ void CHudHealth::OnThink()
|
|||||||
if ( local )
|
if ( local )
|
||||||
{
|
{
|
||||||
// Never below zero
|
// Never below zero
|
||||||
newHealth = max( local->GetHealth(), 0 );
|
newHealth = MAX( local->GetHealth(), 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Only update the fade if we've changed health
|
// Only update the fade if we've changed health
|
||||||
|
@ -468,7 +468,7 @@ void CHudWeaponSelection::Paint()
|
|||||||
|
|
||||||
// interpolate the selected box size between the small box size and the large box size
|
// interpolate the selected box size between the small box size and the large box size
|
||||||
// interpolation has been removed since there is no weapon pickup animation anymore, so it's all at the largest size
|
// interpolation has been removed since there is no weapon pickup animation anymore, so it's all at the largest size
|
||||||
float percentageDone = 1.0f; //min(1.0f, (gpGlobals->curtime - m_flPickupStartTime) / m_flWeaponPickupGrowTime);
|
float percentageDone = 1.0f; //MIN(1.0f, (gpGlobals->curtime - m_flPickupStartTime) / m_flWeaponPickupGrowTime);
|
||||||
int largeBoxWide = m_flSmallBoxSize + ((m_flLargeBoxWide - m_flSmallBoxSize) * percentageDone);
|
int largeBoxWide = m_flSmallBoxSize + ((m_flLargeBoxWide - m_flSmallBoxSize) * percentageDone);
|
||||||
int largeBoxTall = m_flSmallBoxSize + ((m_flLargeBoxTall - m_flSmallBoxSize) * percentageDone);
|
int largeBoxTall = m_flSmallBoxSize + ((m_flLargeBoxTall - m_flSmallBoxSize) * percentageDone);
|
||||||
Color selectedColor;
|
Color selectedColor;
|
||||||
|
@ -194,7 +194,7 @@ void CHudZoom::Paint( void )
|
|||||||
{
|
{
|
||||||
surface()->DrawFilledRect(xpos, ypos, xpos + 1, ypos + m_flDashHeight);
|
surface()->DrawFilledRect(xpos, ypos, xpos + 1, ypos + m_flDashHeight);
|
||||||
surface()->DrawFilledRect(wide - xpos, ypos, wide - xpos + 1, ypos + m_flDashHeight);
|
surface()->DrawFilledRect(wide - xpos, ypos, wide - xpos + 1, ypos + m_flDashHeight);
|
||||||
xpos = (int)((wide / 2) + (m_flDashGap * ++dashCount * max(scale,0.1f)));
|
xpos = (int)((wide / 2) + (m_flDashGap * ++dashCount * MAX(scale,0.1f)));
|
||||||
}
|
}
|
||||||
|
|
||||||
// draw the darkened edges, with a rotated texture in the four corners
|
// draw the darkened edges, with a rotated texture in the four corners
|
||||||
|
@ -533,7 +533,7 @@ float C_HL2MP_Player::GetFOV( void )
|
|||||||
int min_fov = GetMinFOV();
|
int min_fov = GetMinFOV();
|
||||||
|
|
||||||
// Don't let it go too low
|
// Don't let it go too low
|
||||||
flFOVOffset = max( min_fov, flFOVOffset );
|
flFOVOffset = MAX( min_fov, flFOVOffset );
|
||||||
|
|
||||||
return flFOVOffset;
|
return flFOVOffset;
|
||||||
}
|
}
|
||||||
|
@ -131,8 +131,8 @@ void CHudChatLine::PerformFadeout( void )
|
|||||||
{
|
{
|
||||||
wchar_t wText[4096];
|
wchar_t wText[4096];
|
||||||
// draw the first x characters in the player color
|
// draw the first x characters in the player color
|
||||||
wcsncpy( wText, wbuf, min( m_iNameLength + 1, MAX_PLAYER_NAME_LENGTH+32) );
|
wcsncpy( wText, wbuf, MIN( m_iNameLength + 1, MAX_PLAYER_NAME_LENGTH+32) );
|
||||||
wText[ min( m_iNameLength, MAX_PLAYER_NAME_LENGTH+31) ] = 0;
|
wText[ MIN( m_iNameLength, MAX_PLAYER_NAME_LENGTH+31) ] = 0;
|
||||||
|
|
||||||
m_clrNameColor[3] = alpha;
|
m_clrNameColor[3] = alpha;
|
||||||
|
|
||||||
@ -430,8 +430,8 @@ void CHudChat::ChatPrintf( int iPlayerIndex, const char *fmt, ... )
|
|||||||
line->SetExpireTime();
|
line->SetExpireTime();
|
||||||
|
|
||||||
// draw the first x characters in the player color
|
// draw the first x characters in the player color
|
||||||
Q_strncpy( buf, pmsg, min( iNameLength + 1, MAX_PLAYER_NAME_LENGTH+32) );
|
Q_strncpy( buf, pmsg, MIN( iNameLength + 1, MAX_PLAYER_NAME_LENGTH+32) );
|
||||||
buf[ min( iNameLength, MAX_PLAYER_NAME_LENGTH+31) ] = 0;
|
buf[ MIN( iNameLength, MAX_PLAYER_NAME_LENGTH+31) ] = 0;
|
||||||
line->InsertColorChange( Color( flColor[0], flColor[1], flColor[2], 255 ) );
|
line->InsertColorChange( Color( flColor[0], flColor[1], flColor[2], 255 ) );
|
||||||
line->InsertString( buf );
|
line->InsertString( buf );
|
||||||
Q_strncpy( buf, pmsg + iNameLength, strlen( pmsg ));
|
Q_strncpy( buf, pmsg + iNameLength, strlen( pmsg ));
|
||||||
|
@ -90,9 +90,9 @@ void CHL2MPClientScoreBoardDialog::PaintBackground()
|
|||||||
int y = 0;
|
int y = 0;
|
||||||
for ( i=0; i<NumSegments; ++i )
|
for ( i=0; i<NumSegments; ++i )
|
||||||
{
|
{
|
||||||
x1 = min( x + coord[xIndex]*xMult, x + coord[xIndex+1]*xMult );
|
x1 = MIN( x + coord[xIndex]*xMult, x + coord[xIndex+1]*xMult );
|
||||||
x2 = max( x + coord[xIndex]*xMult, x + coord[xIndex+1]*xMult );
|
x2 = MAX( x + coord[xIndex]*xMult, x + coord[xIndex+1]*xMult );
|
||||||
y1 = max( y + coord[yIndex]*yMult, y + coord[yIndex+1]*yMult );
|
y1 = MAX( y + coord[yIndex]*yMult, y + coord[yIndex+1]*yMult );
|
||||||
y2 = y + coord[NumSegments];
|
y2 = y + coord[NumSegments];
|
||||||
surface()->DrawFilledRect( x1, y1, x2, y2 );
|
surface()->DrawFilledRect( x1, y1, x2, y2 );
|
||||||
|
|
||||||
@ -111,9 +111,9 @@ void CHL2MPClientScoreBoardDialog::PaintBackground()
|
|||||||
yMult = 1;
|
yMult = 1;
|
||||||
for ( i=0; i<NumSegments; ++i )
|
for ( i=0; i<NumSegments; ++i )
|
||||||
{
|
{
|
||||||
x1 = min( x + coord[xIndex]*xMult, x + coord[xIndex+1]*xMult );
|
x1 = MIN( x + coord[xIndex]*xMult, x + coord[xIndex+1]*xMult );
|
||||||
x2 = max( x + coord[xIndex]*xMult, x + coord[xIndex+1]*xMult );
|
x2 = MAX( x + coord[xIndex]*xMult, x + coord[xIndex+1]*xMult );
|
||||||
y1 = max( y + coord[yIndex]*yMult, y + coord[yIndex+1]*yMult );
|
y1 = MAX( y + coord[yIndex]*yMult, y + coord[yIndex+1]*yMult );
|
||||||
y2 = y + coord[NumSegments];
|
y2 = y + coord[NumSegments];
|
||||||
surface()->DrawFilledRect( x1, y1, x2, y2 );
|
surface()->DrawFilledRect( x1, y1, x2, y2 );
|
||||||
xIndex += xDir;
|
xIndex += xDir;
|
||||||
@ -131,10 +131,10 @@ void CHL2MPClientScoreBoardDialog::PaintBackground()
|
|||||||
yMult = -1;
|
yMult = -1;
|
||||||
for ( i=0; i<NumSegments; ++i )
|
for ( i=0; i<NumSegments; ++i )
|
||||||
{
|
{
|
||||||
x1 = min( x + coord[xIndex]*xMult, x + coord[xIndex+1]*xMult );
|
x1 = MIN( x + coord[xIndex]*xMult, x + coord[xIndex+1]*xMult );
|
||||||
x2 = max( x + coord[xIndex]*xMult, x + coord[xIndex+1]*xMult );
|
x2 = MAX( x + coord[xIndex]*xMult, x + coord[xIndex+1]*xMult );
|
||||||
y1 = y - coord[NumSegments];
|
y1 = y - coord[NumSegments];
|
||||||
y2 = min( y + coord[yIndex]*yMult, y + coord[yIndex+1]*yMult );
|
y2 = MIN( y + coord[yIndex]*yMult, y + coord[yIndex+1]*yMult );
|
||||||
surface()->DrawFilledRect( x1, y1, x2, y2 );
|
surface()->DrawFilledRect( x1, y1, x2, y2 );
|
||||||
xIndex += xDir;
|
xIndex += xDir;
|
||||||
yIndex += yDir;
|
yIndex += yDir;
|
||||||
@ -151,10 +151,10 @@ void CHL2MPClientScoreBoardDialog::PaintBackground()
|
|||||||
yMult = -1;
|
yMult = -1;
|
||||||
for ( i=0; i<NumSegments; ++i )
|
for ( i=0; i<NumSegments; ++i )
|
||||||
{
|
{
|
||||||
x1 = min( x + coord[xIndex]*xMult, x + coord[xIndex+1]*xMult );
|
x1 = MIN( x + coord[xIndex]*xMult, x + coord[xIndex+1]*xMult );
|
||||||
x2 = max( x + coord[xIndex]*xMult, x + coord[xIndex+1]*xMult );
|
x2 = MAX( x + coord[xIndex]*xMult, x + coord[xIndex+1]*xMult );
|
||||||
y1 = y - coord[NumSegments];
|
y1 = y - coord[NumSegments];
|
||||||
y2 = min( y + coord[yIndex]*yMult, y + coord[yIndex+1]*yMult );
|
y2 = MIN( y + coord[yIndex]*yMult, y + coord[yIndex+1]*yMult );
|
||||||
surface()->DrawFilledRect( x1, y1, x2, y2 );
|
surface()->DrawFilledRect( x1, y1, x2, y2 );
|
||||||
xIndex += xDir;
|
xIndex += xDir;
|
||||||
yIndex += yDir;
|
yIndex += yDir;
|
||||||
@ -207,10 +207,10 @@ void CHL2MPClientScoreBoardDialog::PaintBorder()
|
|||||||
int y = 0;
|
int y = 0;
|
||||||
for ( i=0; i<NumSegments; ++i )
|
for ( i=0; i<NumSegments; ++i )
|
||||||
{
|
{
|
||||||
x1 = min( x + coord[xIndex]*xMult, x + coord[xIndex+1]*xMult );
|
x1 = MIN( x + coord[xIndex]*xMult, x + coord[xIndex+1]*xMult );
|
||||||
x2 = max( x + coord[xIndex]*xMult, x + coord[xIndex+1]*xMult );
|
x2 = MAX( x + coord[xIndex]*xMult, x + coord[xIndex+1]*xMult );
|
||||||
y1 = min( y + coord[yIndex]*yMult, y + coord[yIndex+1]*yMult );
|
y1 = MIN( y + coord[yIndex]*yMult, y + coord[yIndex+1]*yMult );
|
||||||
y2 = max( y + coord[yIndex]*yMult, y + coord[yIndex+1]*yMult );
|
y2 = MAX( y + coord[yIndex]*yMult, y + coord[yIndex+1]*yMult );
|
||||||
surface()->DrawFilledRect( x1, y1, x2, y2 );
|
surface()->DrawFilledRect( x1, y1, x2, y2 );
|
||||||
|
|
||||||
xIndex += xDir;
|
xIndex += xDir;
|
||||||
@ -228,10 +228,10 @@ void CHL2MPClientScoreBoardDialog::PaintBorder()
|
|||||||
yMult = 1;
|
yMult = 1;
|
||||||
for ( i=0; i<NumSegments; ++i )
|
for ( i=0; i<NumSegments; ++i )
|
||||||
{
|
{
|
||||||
x1 = min( x + coord[xIndex]*xMult, x + coord[xIndex+1]*xMult );
|
x1 = MIN( x + coord[xIndex]*xMult, x + coord[xIndex+1]*xMult );
|
||||||
x2 = max( x + coord[xIndex]*xMult, x + coord[xIndex+1]*xMult );
|
x2 = MAX( x + coord[xIndex]*xMult, x + coord[xIndex+1]*xMult );
|
||||||
y1 = min( y + coord[yIndex]*yMult, y + coord[yIndex+1]*yMult );
|
y1 = MIN( y + coord[yIndex]*yMult, y + coord[yIndex+1]*yMult );
|
||||||
y2 = max( y + coord[yIndex]*yMult, y + coord[yIndex+1]*yMult );
|
y2 = MAX( y + coord[yIndex]*yMult, y + coord[yIndex+1]*yMult );
|
||||||
surface()->DrawFilledRect( x1, y1, x2, y2 );
|
surface()->DrawFilledRect( x1, y1, x2, y2 );
|
||||||
xIndex += xDir;
|
xIndex += xDir;
|
||||||
yIndex += yDir;
|
yIndex += yDir;
|
||||||
@ -248,10 +248,10 @@ void CHL2MPClientScoreBoardDialog::PaintBorder()
|
|||||||
yMult = -1;
|
yMult = -1;
|
||||||
for ( i=0; i<NumSegments; ++i )
|
for ( i=0; i<NumSegments; ++i )
|
||||||
{
|
{
|
||||||
x1 = min( x + coord[xIndex]*xMult, x + coord[xIndex+1]*xMult );
|
x1 = MIN( x + coord[xIndex]*xMult, x + coord[xIndex+1]*xMult );
|
||||||
x2 = max( x + coord[xIndex]*xMult, x + coord[xIndex+1]*xMult );
|
x2 = MAX( x + coord[xIndex]*xMult, x + coord[xIndex+1]*xMult );
|
||||||
y1 = min( y + coord[yIndex]*yMult, y + coord[yIndex+1]*yMult );
|
y1 = MIN( y + coord[yIndex]*yMult, y + coord[yIndex+1]*yMult );
|
||||||
y2 = max( y + coord[yIndex]*yMult, y + coord[yIndex+1]*yMult );
|
y2 = MAX( y + coord[yIndex]*yMult, y + coord[yIndex+1]*yMult );
|
||||||
surface()->DrawFilledRect( x1, y1, x2, y2 );
|
surface()->DrawFilledRect( x1, y1, x2, y2 );
|
||||||
xIndex += xDir;
|
xIndex += xDir;
|
||||||
yIndex += yDir;
|
yIndex += yDir;
|
||||||
@ -268,10 +268,10 @@ void CHL2MPClientScoreBoardDialog::PaintBorder()
|
|||||||
yMult = -1;
|
yMult = -1;
|
||||||
for ( i=0; i<NumSegments; ++i )
|
for ( i=0; i<NumSegments; ++i )
|
||||||
{
|
{
|
||||||
x1 = min( x + coord[xIndex]*xMult, x + coord[xIndex+1]*xMult );
|
x1 = MIN( x + coord[xIndex]*xMult, x + coord[xIndex+1]*xMult );
|
||||||
x2 = max( x + coord[xIndex]*xMult, x + coord[xIndex+1]*xMult );
|
x2 = MAX( x + coord[xIndex]*xMult, x + coord[xIndex+1]*xMult );
|
||||||
y1 = min( y + coord[yIndex]*yMult, y + coord[yIndex+1]*yMult );
|
y1 = MIN( y + coord[yIndex]*yMult, y + coord[yIndex+1]*yMult );
|
||||||
y2 = max( y + coord[yIndex]*yMult, y + coord[yIndex+1]*yMult );
|
y2 = MAX( y + coord[yIndex]*yMult, y + coord[yIndex+1]*yMult );
|
||||||
surface()->DrawFilledRect( x1, y1, x2, y2 );
|
surface()->DrawFilledRect( x1, y1, x2, y2 );
|
||||||
xIndex += xDir;
|
xIndex += xDir;
|
||||||
yIndex += yDir;
|
yIndex += yDir;
|
||||||
|
@ -588,7 +588,7 @@ int CBaseHudChat::ComputeBreakChar( int width, const char *text, int textlen )
|
|||||||
// this one
|
// this one
|
||||||
if ( lastbreak == textlen )
|
if ( lastbreak == textlen )
|
||||||
{
|
{
|
||||||
lastbreak = max( 0, i - 1 );
|
lastbreak = MAX( 0, i - 1 );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1035,7 +1035,7 @@ void CHudCloseCaption::Paint( void )
|
|||||||
float desiredAlpha = visibleitems.Count() >= 1 ? 1.0f : 0.0f;
|
float desiredAlpha = visibleitems.Count() >= 1 ? 1.0f : 0.0f;
|
||||||
|
|
||||||
// Always return at least one line height for drawing the surrounding box
|
// Always return at least one line height for drawing the surrounding box
|
||||||
totalheight = max( totalheight, m_nLineHeight );
|
totalheight = MAX( totalheight, m_nLineHeight );
|
||||||
|
|
||||||
// Trigger box growing
|
// Trigger box growing
|
||||||
if ( totalheight != m_nGoalHeight )
|
if ( totalheight != m_nGoalHeight )
|
||||||
@ -1091,7 +1091,7 @@ void CHudCloseCaption::Paint( void )
|
|||||||
|
|
||||||
Color bgColor = GetBgColor();
|
Color bgColor = GetBgColor();
|
||||||
bgColor[3] = m_flBackgroundAlpha;
|
bgColor[3] = m_flBackgroundAlpha;
|
||||||
DrawBox( rcText.left, max(rcText.top,0), rcText.right - rcText.left, rcText.bottom - max(rcText.top,0), bgColor, m_flCurrentAlpha );
|
DrawBox( rcText.left, MAX(rcText.top,0), rcText.right - rcText.left, rcText.bottom - MAX(rcText.top,0), bgColor, m_flCurrentAlpha );
|
||||||
|
|
||||||
if ( !visibleitems.Count() )
|
if ( !visibleitems.Count() )
|
||||||
{
|
{
|
||||||
@ -1129,7 +1129,7 @@ void CHudCloseCaption::Paint( void )
|
|||||||
{
|
{
|
||||||
float ttl = si->item->GetTimeToLive();
|
float ttl = si->item->GetTimeToLive();
|
||||||
ttl -= si->item->GetAddedTime();
|
ttl -= si->item->GetAddedTime();
|
||||||
ttl = max( 0.0f, ttl );
|
ttl = MAX( 0.0f, ttl );
|
||||||
si->item->SetTimeToLive( ttl );
|
si->item->SetTimeToLive( ttl );
|
||||||
si->item->SetAddedTime( 0.0f );
|
si->item->SetAddedTime( 0.0f );
|
||||||
}
|
}
|
||||||
@ -1272,7 +1272,7 @@ void CHudCloseCaption::OnTick( void )
|
|||||||
if ( predisplay > 0.0f )
|
if ( predisplay > 0.0f )
|
||||||
{
|
{
|
||||||
predisplay -= dt;
|
predisplay -= dt;
|
||||||
predisplay = max( 0.0f, predisplay );
|
predisplay = MAX( 0.0f, predisplay );
|
||||||
item->SetPreDisplayTime( predisplay );
|
item->SetPreDisplayTime( predisplay );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -1280,7 +1280,7 @@ void CHudCloseCaption::OnTick( void )
|
|||||||
// remove time from actual playback
|
// remove time from actual playback
|
||||||
float ttl = item->GetTimeToLive();
|
float ttl = item->GetTimeToLive();
|
||||||
ttl -= dt;
|
ttl -= dt;
|
||||||
ttl = max( 0.0f, ttl );
|
ttl = MAX( 0.0f, ttl );
|
||||||
item->SetTimeToLive( ttl );
|
item->SetTimeToLive( ttl );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1528,7 +1528,7 @@ void CHudCloseCaption::Process( const wchar_t *stream, float duration, char cons
|
|||||||
addedlife = prevlife - lifespan;
|
addedlife = prevlife - lifespan;
|
||||||
}
|
}
|
||||||
|
|
||||||
lifespan = max( lifespan, prevlife );
|
lifespan = MAX( lifespan, prevlife );
|
||||||
}
|
}
|
||||||
|
|
||||||
float delay = 0.0f;
|
float delay = 0.0f;
|
||||||
@ -1572,7 +1572,7 @@ void CHudCloseCaption::Process( const wchar_t *stream, float duration, char cons
|
|||||||
out = phrase;
|
out = phrase;
|
||||||
|
|
||||||
// Delay must be positive
|
// Delay must be positive
|
||||||
delay = max( 0.0f, (float)wcstod( args, NULL ) );
|
delay = MAX( 0.0f, (float)wcstod( args, NULL ) );
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -1619,7 +1619,7 @@ void CHudCloseCaption::CreateFonts( void )
|
|||||||
m_hFonts[ CCFONT_ITALIC ] = pScheme->GetFont( "CloseCaption_Italic" );
|
m_hFonts[ CCFONT_ITALIC ] = pScheme->GetFont( "CloseCaption_Italic" );
|
||||||
m_hFonts[ CCFONT_ITALICBOLD ] = pScheme->GetFont( "CloseCaption_BoldItalic" );
|
m_hFonts[ CCFONT_ITALICBOLD ] = pScheme->GetFont( "CloseCaption_BoldItalic" );
|
||||||
#endif
|
#endif
|
||||||
m_nLineHeight = max( 6, vgui::surface()->GetFontTall( m_hFonts[ CCFONT_NORMAL ] ) );
|
m_nLineHeight = MAX( 6, vgui::surface()->GetFontTall( m_hFonts[ CCFONT_NORMAL ] ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
struct WorkUnitParams
|
struct WorkUnitParams
|
||||||
@ -1706,8 +1706,8 @@ void CHudCloseCaption::AddWorkUnit( CCloseCaptionItem *item,
|
|||||||
int curheight = item->GetHeight();
|
int curheight = item->GetHeight();
|
||||||
int curwidth = item->GetWidth();
|
int curwidth = item->GetWidth();
|
||||||
|
|
||||||
curheight = max( curheight, params.y + wu->GetHeight() );
|
curheight = MAX( curheight, params.y + wu->GetHeight() );
|
||||||
curwidth = max( curwidth, params.x + params.width );
|
curwidth = MAX( curwidth, params.x + params.width );
|
||||||
|
|
||||||
item->SetHeight( curheight );
|
item->SetHeight( curheight );
|
||||||
item->SetWidth( curwidth );
|
item->SetWidth( curwidth );
|
||||||
@ -2771,7 +2771,7 @@ void EmitRandomCaption_f()
|
|||||||
int count = 1;
|
int count = 1;
|
||||||
if ( engine->Cmd_Argc() == 2 )
|
if ( engine->Cmd_Argc() == 2 )
|
||||||
{
|
{
|
||||||
count = max( 1, atoi( engine->Cmd_Argv( 1 ) ) );
|
count = MAX( 1, atoi( engine->Cmd_Argv( 1 ) ) );
|
||||||
}
|
}
|
||||||
CHudCloseCaption *hudCloseCaption = GET_HUDELEMENT( CHudCloseCaption );
|
CHudCloseCaption *hudCloseCaption = GET_HUDELEMENT( CHudCloseCaption );
|
||||||
if ( hudCloseCaption )
|
if ( hudCloseCaption )
|
||||||
|
@ -288,7 +288,7 @@ bool CHudHintDisplay::SetHintText( const char *text )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
int tallest = max( tallest1, tallest2 );
|
int tallest = MAX( tallest1, tallest2 );
|
||||||
|
|
||||||
// position the labels
|
// position the labels
|
||||||
int col1_x = m_iTextX;
|
int col1_x = m_iTextX;
|
||||||
|
@ -89,8 +89,8 @@ void CHud::Think(void)
|
|||||||
void CHud::DrawProgressBar( int x, int y, int width, int height, float percentage, Color& clr, unsigned char type )
|
void CHud::DrawProgressBar( int x, int y, int width, int height, float percentage, Color& clr, unsigned char type )
|
||||||
{
|
{
|
||||||
//Clamp our percentage
|
//Clamp our percentage
|
||||||
percentage = min( 1.0f, percentage );
|
percentage = MIN( 1.0f, percentage );
|
||||||
percentage = max( 0.0f, percentage );
|
percentage = MAX( 0.0f, percentage );
|
||||||
|
|
||||||
Color lowColor = clr;
|
Color lowColor = clr;
|
||||||
lowColor[ 0 ] /= 2;
|
lowColor[ 0 ] /= 2;
|
||||||
@ -145,8 +145,8 @@ void CHud::DrawIconProgressBar( int x, int y, CHudTexture *icon, CHudTexture *ic
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
//Clamp our percentage
|
//Clamp our percentage
|
||||||
percentage = min( 1.0f, percentage );
|
percentage = MIN( 1.0f, percentage );
|
||||||
percentage = max( 0.0f, percentage );
|
percentage = MAX( 0.0f, percentage );
|
||||||
|
|
||||||
int height = icon->Height();
|
int height = icon->Height();
|
||||||
int width = icon->Width();
|
int width = icon->Width();
|
||||||
|
@ -579,11 +579,11 @@ void CInput::GetFullscreenMousePos( int *mx, int *my, int *unclampedx /*=NULL*/,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Clamp
|
// Clamp
|
||||||
current_posx = max( 0, current_posx );
|
current_posx = MAX( 0, current_posx );
|
||||||
current_posx = min( ScreenWidth(), current_posx );
|
current_posx = MIN( ScreenWidth(), current_posx );
|
||||||
|
|
||||||
current_posy = max( 0, current_posy );
|
current_posy = MAX( 0, current_posy );
|
||||||
current_posy = min( ScreenHeight(), current_posy );
|
current_posy = MIN( ScreenHeight(), current_posy );
|
||||||
|
|
||||||
*mx = current_posx;
|
*mx = current_posx;
|
||||||
*my = current_posy;
|
*my = current_posy;
|
||||||
|
@ -623,7 +623,7 @@ inline bool CInterpolatedVarArrayBase<Type>::GetInterpolationInfo(
|
|||||||
if ( dt > 0.0001f )
|
if ( dt > 0.0001f )
|
||||||
{
|
{
|
||||||
pInfo->frac = ( targettime - older_change_time ) / ( newer_change_time - older_change_time );
|
pInfo->frac = ( targettime - older_change_time ) / ( newer_change_time - older_change_time );
|
||||||
pInfo->frac = min( pInfo->frac, 2.0f );
|
pInfo->frac = MIN( pInfo->frac, 2.0f );
|
||||||
|
|
||||||
CVarHistory::IndexType_t oldestindex = varHistory.Next( i );
|
CVarHistory::IndexType_t oldestindex = varHistory.Next( i );
|
||||||
|
|
||||||
@ -1090,7 +1090,7 @@ inline void CInterpolatedVarArrayBase<Type>::_Extrapolate(
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
float flExtrapolationAmount = min( flDestinationTime - pNew->changetime, flMaxExtrapolationAmount );
|
float flExtrapolationAmount = MIN( flDestinationTime - pNew->changetime, flMaxExtrapolationAmount );
|
||||||
|
|
||||||
float divisor = 1.0f / (pNew->changetime - pOld->changetime);
|
float divisor = 1.0f / (pNew->changetime - pOld->changetime);
|
||||||
for ( int i=0; i < m_nMaxCount; i++ )
|
for ( int i=0; i < m_nMaxCount; i++ )
|
||||||
|
@ -91,7 +91,7 @@ void CLampHaloProxy::OnBind( C_BaseEntity *pEnt )
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
fade = min( (fade - 0.25) * 1.35, 1.0f );
|
fade = MIN( (fade - 0.25) * 1.35, 1.0f );
|
||||||
}
|
}
|
||||||
|
|
||||||
m_pFadeValue->SetFloatValue( fade );
|
m_pFadeValue->SetFloatValue( fade );
|
||||||
|
@ -167,8 +167,8 @@ inline const Particle* CParticleRenderIterator::GetNext( float sortKey )
|
|||||||
// Update the incremental sort.
|
// Update the incremental sort.
|
||||||
if( m_bBucketSort )
|
if( m_bBucketSort )
|
||||||
{
|
{
|
||||||
m_MinZ = min( sortKey, m_MinZ );
|
m_MinZ = MIN( sortKey, m_MinZ );
|
||||||
m_MaxZ = max( sortKey, m_MaxZ );
|
m_MaxZ = MAX( sortKey, m_MaxZ );
|
||||||
|
|
||||||
m_zCoords[m_nZCoords] = sortKey;
|
m_zCoords[m_nZCoords] = sortKey;
|
||||||
++m_nZCoords;
|
++m_nZCoords;
|
||||||
|
@ -556,7 +556,7 @@ Vector CFireParticle::UpdateColor( const SimpleParticle *pParticle )
|
|||||||
for ( int i = 0; i < 3; i++ )
|
for ( int i = 0; i < 3; i++ )
|
||||||
{
|
{
|
||||||
//FIXME: This is frame dependant... but I don't want to store off start/end colors yet
|
//FIXME: This is frame dependant... but I don't want to store off start/end colors yet
|
||||||
//pParticle->m_uchColor[i] = max( 0, pParticle->m_uchColor[i]-2 );
|
//pParticle->m_uchColor[i] = MAX( 0, pParticle->m_uchColor[i]-2 );
|
||||||
}
|
}
|
||||||
|
|
||||||
return CSimpleEmitter::UpdateColor( pParticle );
|
return CSimpleEmitter::UpdateColor( pParticle );
|
||||||
|
@ -110,7 +110,7 @@ inline void CParticleSphereRenderer::AddLightColor(
|
|||||||
|
|
||||||
inline void CParticleSphereRenderer::ClampColor( Vector &vColor )
|
inline void CParticleSphereRenderer::ClampColor( Vector &vColor )
|
||||||
{
|
{
|
||||||
float flMax = max( vColor.x, max( vColor.y, vColor.z ) );
|
float flMax = MAX( vColor.x, MAX( vColor.y, vColor.z ) );
|
||||||
if( flMax > 1 )
|
if( flMax > 1 )
|
||||||
{
|
{
|
||||||
vColor *= 255.0f / flMax;
|
vColor *= 255.0f / flMax;
|
||||||
|
@ -1361,9 +1361,9 @@ int CPrediction::ComputeFirstCommandToExecute( bool received_new_world_update, i
|
|||||||
// this is where we would normally start
|
// this is where we would normally start
|
||||||
int start = incoming_acknowledged + 1;
|
int start = incoming_acknowledged + 1;
|
||||||
// outgoing_command is where we really want to start
|
// outgoing_command is where we really want to start
|
||||||
skipahead = max( 0, ( outgoing_command - start ) );
|
skipahead = MAX( 0, ( outgoing_command - start ) );
|
||||||
// Don't start past the last predicted command, though, or we'll get prediction errors
|
// Don't start past the last predicted command, though, or we'll get prediction errors
|
||||||
skipahead = min( skipahead, m_nCommandsPredicted );
|
skipahead = MIN( skipahead, m_nCommandsPredicted );
|
||||||
|
|
||||||
if ( m_nCommandsPredicted != skipahead )
|
if ( m_nCommandsPredicted != skipahead )
|
||||||
{
|
{
|
||||||
|
@ -119,8 +119,8 @@ void CHudChatLine::PerformFadeout( void )
|
|||||||
{
|
{
|
||||||
wchar_t wText[4096];
|
wchar_t wText[4096];
|
||||||
// draw the first x characters in the player color
|
// draw the first x characters in the player color
|
||||||
wcsncpy( wText, wbuf, min( m_iNameLength + 1, MAX_PLAYER_NAME_LENGTH+32) );
|
wcsncpy( wText, wbuf, MIN( m_iNameLength + 1, MAX_PLAYER_NAME_LENGTH+32) );
|
||||||
wText[ min( m_iNameLength, MAX_PLAYER_NAME_LENGTH+31) ] = 0;
|
wText[ MIN( m_iNameLength, MAX_PLAYER_NAME_LENGTH+31) ] = 0;
|
||||||
|
|
||||||
m_clrNameColor[3] = alpha;
|
m_clrNameColor[3] = alpha;
|
||||||
|
|
||||||
@ -433,8 +433,8 @@ void CHudChat::ChatPrintf( int iPlayerIndex, const char *fmt, ... )
|
|||||||
line->SetExpireTime();
|
line->SetExpireTime();
|
||||||
|
|
||||||
// draw the first x characters in the player color
|
// draw the first x characters in the player color
|
||||||
Q_strncpy( buf, pmsg, min( iNameLength + 1, MAX_PLAYER_NAME_LENGTH+32) );
|
Q_strncpy( buf, pmsg, MIN( iNameLength + 1, MAX_PLAYER_NAME_LENGTH+32) );
|
||||||
buf[ min( iNameLength, MAX_PLAYER_NAME_LENGTH+31) ] = 0;
|
buf[ MIN( iNameLength, MAX_PLAYER_NAME_LENGTH+31) ] = 0;
|
||||||
line->InsertColorChange( Color( flColor[0], flColor[1], flColor[2], 255 ) );
|
line->InsertColorChange( Color( flColor[0], flColor[1], flColor[2], 255 ) );
|
||||||
line->InsertString( buf );
|
line->InsertString( buf );
|
||||||
Q_strncpy( buf, pmsg + iNameLength, strlen( pmsg ));
|
Q_strncpy( buf, pmsg + iNameLength, strlen( pmsg ));
|
||||||
|
@ -117,7 +117,7 @@ void CHudHealth::OnThink()
|
|||||||
if ( local )
|
if ( local )
|
||||||
{
|
{
|
||||||
// Never below zero
|
// Never below zero
|
||||||
newHealth = max( local->GetHealth(), 0 );
|
newHealth = MAX( local->GetHealth(), 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Only update the fade if we've changed health
|
// Only update the fade if we've changed health
|
||||||
|
@ -217,7 +217,7 @@ void CHudWeaponSelection::Paint()
|
|||||||
|
|
||||||
// interpolate the selected box size between the small box size and the large box size
|
// interpolate the selected box size between the small box size and the large box size
|
||||||
// interpolation has been removed since there is no weapon pickup animation anymore, so it's all at the largest size
|
// interpolation has been removed since there is no weapon pickup animation anymore, so it's all at the largest size
|
||||||
float percentageDone = 1.0f; //min(1.0f, (gpGlobals->curtime - m_flPickupStartTime) / m_flWeaponPickupGrowTime);
|
float percentageDone = 1.0f; //MIN(1.0f, (gpGlobals->curtime - m_flPickupStartTime) / m_flWeaponPickupGrowTime);
|
||||||
int largeBoxWide = m_flSmallBoxSize + ((m_flLargeBoxWide - m_flSmallBoxSize) * percentageDone);
|
int largeBoxWide = m_flSmallBoxSize + ((m_flLargeBoxWide - m_flSmallBoxSize) * percentageDone);
|
||||||
int largeBoxTall = m_flSmallBoxSize + ((m_flLargeBoxTall - m_flSmallBoxSize) * percentageDone);
|
int largeBoxTall = m_flSmallBoxSize + ((m_flLargeBoxTall - m_flSmallBoxSize) * percentageDone);
|
||||||
Color selectedColor;
|
Color selectedColor;
|
||||||
|
@ -74,10 +74,10 @@ void DrawSmokeFogOverlay()
|
|||||||
static float dist = 10;
|
static float dist = 10;
|
||||||
|
|
||||||
Vector vColor = g_SmokeFogOverlayColor;
|
Vector vColor = g_SmokeFogOverlayColor;
|
||||||
vColor.x = min(max(vColor.x, 0), 1);
|
vColor.x = MIN(MAX(vColor.x, 0), 1);
|
||||||
vColor.y = min(max(vColor.y, 0), 1);
|
vColor.y = MIN(MAX(vColor.y, 0), 1);
|
||||||
vColor.z = min(max(vColor.z, 0), 1);
|
vColor.z = MIN(MAX(vColor.z, 0), 1);
|
||||||
float alpha = min(max(g_SmokeFogOverlayAlpha, 0), 1);
|
float alpha = MIN(MAX(g_SmokeFogOverlayAlpha, 0), 1);
|
||||||
|
|
||||||
meshBuilder.Begin( pMesh, MATERIAL_QUADS, 1 );
|
meshBuilder.Begin( pMesh, MATERIAL_QUADS, 1 );
|
||||||
|
|
||||||
|
@ -94,13 +94,13 @@ static int IntersectWRect(const wrect_t *prc1, const wrect_t *prc2, wrect_t *prc
|
|||||||
if (!prc)
|
if (!prc)
|
||||||
prc = &rc;
|
prc = &rc;
|
||||||
|
|
||||||
prc->left = max(prc1->left, prc2->left);
|
prc->left = MAX(prc1->left, prc2->left);
|
||||||
prc->right = min(prc1->right, prc2->right);
|
prc->right = MIN(prc1->right, prc2->right);
|
||||||
|
|
||||||
if (prc->left < prc->right)
|
if (prc->left < prc->right)
|
||||||
{
|
{
|
||||||
prc->top = max(prc1->top, prc2->top);
|
prc->top = MAX(prc1->top, prc2->top);
|
||||||
prc->bottom = min(prc1->bottom, prc2->bottom);
|
prc->bottom = MIN(prc1->bottom, prc2->bottom);
|
||||||
|
|
||||||
if (prc->top < prc->bottom)
|
if (prc->top < prc->bottom)
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -102,7 +102,7 @@ void CEntityPanel::ComputeAndSetSize( void )
|
|||||||
// Get distance to entity
|
// Get distance to entity
|
||||||
float flDistance = (m_pBaseEntity->GetRenderOrigin() - MainViewOrigin()).Length();
|
float flDistance = (m_pBaseEntity->GetRenderOrigin() - MainViewOrigin()).Length();
|
||||||
flDistance *= 2;
|
flDistance *= 2;
|
||||||
m_flScale = 0.25 + max( 0, 2.0 - (flDistance / 2048) );
|
m_flScale = 0.25 + MAX( 0, 2.0 - (flDistance / 2048) );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update the size
|
// Update the size
|
||||||
|
@ -683,7 +683,7 @@ void CBlockingFileIOPanel::DrawIOTime( int x, int y, int w, int h, int slot, ch
|
|||||||
int historyWide = ( int ) ( w * hfrac + 0.5f );
|
int historyWide = ( int ) ( w * hfrac + 0.5f );
|
||||||
int spikeWide = ( int ) ( w * spikefrac + 0.5f );
|
int spikeWide = ( int ) ( w * spikefrac + 0.5f );
|
||||||
|
|
||||||
int useWide = max( barWide, historyWide );
|
int useWide = MAX( barWide, historyWide );
|
||||||
|
|
||||||
vgui::surface()->DrawSetColor( Color( 0, 0, 0, 31 ) );
|
vgui::surface()->DrawSetColor( Color( 0, 0, 0, 31 ) );
|
||||||
vgui::surface()->DrawFilledRect( x, y, x + w, y + h );
|
vgui::surface()->DrawFilledRect( x, y, x + w, y + h );
|
||||||
|
@ -390,15 +390,15 @@ void CNetGraphPanel::DrawTimes( vrect_t vrect, cmdinfo_t *cmdinfo, int x, int w
|
|||||||
int ptx, pty;
|
int ptx, pty;
|
||||||
|
|
||||||
// Draw cmd_rate value
|
// Draw cmd_rate value
|
||||||
ptx = max( x + w - 1 - 25, 1 );
|
ptx = MAX( x + w - 1 - 25, 1 );
|
||||||
pty = max( vrect.y + vrect.height - 4 - LERP_HEIGHT + 1, 1 );
|
pty = MAX( vrect.y + vrect.height - 4 - LERP_HEIGHT + 1, 1 );
|
||||||
|
|
||||||
extrap_point = LERP_HEIGHT / 3;
|
extrap_point = LERP_HEIGHT / 3;
|
||||||
|
|
||||||
for (a=0 ; a<w ; a++)
|
for (a=0 ; a<w ; a++)
|
||||||
{
|
{
|
||||||
i = ( m_OutgoingSequence - a ) & ( TIMINGS - 1 );
|
i = ( m_OutgoingSequence - a ) & ( TIMINGS - 1 );
|
||||||
h = min( ( cmdinfo[i].cmd_lerp / 3.0 ) * LERP_HEIGHT, LERP_HEIGHT );
|
h = MIN( ( cmdinfo[i].cmd_lerp / 3.0 ) * LERP_HEIGHT, LERP_HEIGHT );
|
||||||
|
|
||||||
rcFill.x = x + w -a - 1;
|
rcFill.x = x + w -a - 1;
|
||||||
rcFill.width = 1;
|
rcFill.width = 1;
|
||||||
@ -505,7 +505,7 @@ void CNetGraphPanel::GetFrameData( INetChannelInfo *netchannel, int *biggest_me
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Can't be below zero
|
// Can't be below zero
|
||||||
m_AvgLatency = max( 0.0, m_AvgLatency );
|
m_AvgLatency = MAX( 0.0, m_AvgLatency );
|
||||||
|
|
||||||
// Fill in frame data
|
// Fill in frame data
|
||||||
for ( int seqnr =m_IncomingSequence - m_UpdateWindowSize + 1
|
for ( int seqnr =m_IncomingSequence - m_UpdateWindowSize + 1
|
||||||
@ -755,7 +755,7 @@ void CNetGraphPanel::DrawHatches( int x, int y, int maxmsgbytes )
|
|||||||
byte color[3];
|
byte color[3];
|
||||||
|
|
||||||
ystep = (int)( 10.0 / net_scale.GetFloat() );
|
ystep = (int)( 10.0 / net_scale.GetFloat() );
|
||||||
ystep = max( ystep, 1 );
|
ystep = MAX( ystep, 1 );
|
||||||
|
|
||||||
rcHatch.y = y;
|
rcHatch.y = y;
|
||||||
rcHatch.height = 1;
|
rcHatch.height = 1;
|
||||||
@ -921,7 +921,7 @@ void CNetGraphPanel::Paint()
|
|||||||
vrect.height = sh;
|
vrect.height = sh;
|
||||||
|
|
||||||
|
|
||||||
w = min( (int)TIMINGS, m_EstimatedWidth );
|
w = MIN( (int)TIMINGS, m_EstimatedWidth );
|
||||||
if ( vrect.width < w + 10 )
|
if ( vrect.width < w + 10 )
|
||||||
{
|
{
|
||||||
w = vrect.width - 10;
|
w = vrect.width - 10;
|
||||||
@ -952,7 +952,7 @@ void CNetGraphPanel::Paint()
|
|||||||
DrawTimes( vrect, m_Cmdinfo, x, w );
|
DrawTimes( vrect, m_Cmdinfo, x, w );
|
||||||
|
|
||||||
// Draw update rate
|
// Draw update rate
|
||||||
DrawUpdateRate( max( 1, x + w - 25 ), max( 1, y - net_graphheight.GetFloat() - 1 ) );
|
DrawUpdateRate( MAX( 1, x + w - 25 ), MAX( 1, y - net_graphheight.GetFloat() - 1 ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
DrawTextFields( graphtype, x, y, m_Graph, m_Cmdinfo );
|
DrawTextFields( graphtype, x, y, m_Graph, m_Cmdinfo );
|
||||||
|
@ -481,7 +481,7 @@ void CViewRenderBeams::InitBeams( void )
|
|||||||
int p = CommandLine()->ParmValue("-particles", -1);
|
int p = CommandLine()->ParmValue("-particles", -1);
|
||||||
if ( p >= 0 )
|
if ( p >= 0 )
|
||||||
{
|
{
|
||||||
m_nNumBeamTrails = max( p, MIN_PARTICLES );
|
m_nNumBeamTrails = MAX( p, MIN_PARTICLES );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -1540,8 +1540,8 @@ void CViewRenderBeams::UpdateBeam( Beam_t *pbeam, float frametime )
|
|||||||
{
|
{
|
||||||
frac = remaining / pbeam->life;
|
frac = remaining / pbeam->life;
|
||||||
}
|
}
|
||||||
frac = min( 1.0f, frac );
|
frac = MIN( 1.0f, frac );
|
||||||
frac = max( 0.0f, frac );
|
frac = MAX( 0.0f, frac );
|
||||||
|
|
||||||
frac = 1.0f - frac;
|
frac = 1.0f - frac;
|
||||||
|
|
||||||
|
@ -526,8 +526,8 @@ void CViewEffects::FadeCalculate( void )
|
|||||||
{
|
{
|
||||||
iFadeAlpha += pFade->alpha;
|
iFadeAlpha += pFade->alpha;
|
||||||
}
|
}
|
||||||
iFadeAlpha = min( iFadeAlpha, pFade->alpha );
|
iFadeAlpha = MIN( iFadeAlpha, pFade->alpha );
|
||||||
iFadeAlpha = max( 0, iFadeAlpha );
|
iFadeAlpha = MAX( 0, iFadeAlpha );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -1087,7 +1087,7 @@ void CViewRender::DrawOpaqueRenderables( ClientWorldListInfo_t& info, CRenderLis
|
|||||||
nOpaque = renderList.m_RenderGroupCounts[RENDER_GROUP_OPAQUE_STATIC];
|
nOpaque = renderList.m_RenderGroupCounts[RENDER_GROUP_OPAQUE_STATIC];
|
||||||
if ( nOpaque )
|
if ( nOpaque )
|
||||||
{
|
{
|
||||||
nOpaque = min( nOpaque, 512 );
|
nOpaque = MIN( nOpaque, 512 );
|
||||||
|
|
||||||
IClientRenderable *pStatics[512];
|
IClientRenderable *pStatics[512];
|
||||||
for( i=0; i < nOpaque; ++i )
|
for( i=0; i < nOpaque; ++i )
|
||||||
@ -2615,8 +2615,8 @@ static void DrawScreenSpaceRectangleWithSlop(
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
// add slop
|
// add slop
|
||||||
int slopwidth=width+FILTER_KERNEL_SLOP; //min(dest_rt->GetActualWidth()-destx,width+FILTER_KERNEL_SLOP);
|
int slopwidth=width+FILTER_KERNEL_SLOP; //MIN(dest_rt->GetActualWidth()-destx,width+FILTER_KERNEL_SLOP);
|
||||||
int slopheight=height+FILTER_KERNEL_SLOP; //min(dest_rt->GetActualHeight()-desty,height+FILTER_KERNEL_SLOP);
|
int slopheight=height+FILTER_KERNEL_SLOP; //MIN(dest_rt->GetActualHeight()-desty,height+FILTER_KERNEL_SLOP);
|
||||||
// adjust coordinates for slop
|
// adjust coordinates for slop
|
||||||
src_texture_x1=FLerp(src_texture_x0,src_texture_x1,destx,destx+width-1,destx+slopwidth-1);
|
src_texture_x1=FLerp(src_texture_x0,src_texture_x1,destx,destx+width-1,destx+slopwidth-1);
|
||||||
src_texture_y1=FLerp(src_texture_y0,src_texture_y1,desty,desty+height-1,desty+slopheight-1);
|
src_texture_y1=FLerp(src_texture_y0,src_texture_y1,desty,desty+height-1,desty+slopheight-1);
|
||||||
@ -2882,7 +2882,7 @@ public:
|
|||||||
int width=500*(e.m_max_lum-e.m_min_lum);
|
int width=500*(e.m_max_lum-e.m_min_lum);
|
||||||
if (np)
|
if (np)
|
||||||
{
|
{
|
||||||
int height=max(1,min(HISTOGRAM_BAR_SIZE,np/6000));
|
int height=MAX(1,MIN(HISTOGRAM_BAR_SIZE,np/6000));
|
||||||
materials->Viewport(xp,HISTOGRAM_BAR_SIZE-height,width,height);
|
materials->Viewport(xp,HISTOGRAM_BAR_SIZE-height,width,height);
|
||||||
materials->ClearColor3ub(255,0,0);
|
materials->ClearColor3ub(255,0,0);
|
||||||
materials->ClearBuffers(true,true);
|
materials->ClearBuffers(true,true);
|
||||||
@ -2958,7 +2958,7 @@ static void SetToneMapScale(float newvalue, float minvalue, float maxvalue)
|
|||||||
avg+=weight*s_MovingAverageToneMapScale[i];
|
avg+=weight*s_MovingAverageToneMapScale[i];
|
||||||
}
|
}
|
||||||
avg*=(1.0/sumweights);
|
avg*=(1.0/sumweights);
|
||||||
avg=min(maxvalue,max(minvalue,avg));
|
avg=MIN(maxvalue,MAX(minvalue,avg));
|
||||||
mat_hdr_tonemapscale.SetValue(avg);
|
mat_hdr_tonemapscale.SetValue(avg);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -3069,10 +3069,10 @@ static void DoPostProcessingEffects( int x, int y, int w, int h )
|
|||||||
float avg_lum=g_HDR_HistogramSystem.GetAverageLuminance();
|
float avg_lum=g_HDR_HistogramSystem.GetAverageLuminance();
|
||||||
float last_scale=materials->GetToneMappingScaleLinear().x;
|
float last_scale=materials->GetToneMappingScaleLinear().x;
|
||||||
float actual_unscaled_luminance=avg_lum*(1.0/last_scale);
|
float actual_unscaled_luminance=avg_lum*(1.0/last_scale);
|
||||||
actual_unscaled_luminance=max(0.000000001,avg_lum);
|
actual_unscaled_luminance=MAX(0.000000001,avg_lum);
|
||||||
float target_scale=0.005/actual_unscaled_luminance;
|
float target_scale=0.005/actual_unscaled_luminance;
|
||||||
float scalevalue=max(flAutoExposureMin,
|
float scalevalue=MAX(flAutoExposureMin,
|
||||||
min(flAutoExposureMax,target_scale));
|
MIN(flAutoExposureMax,target_scale));
|
||||||
if (mat_debug_autoexposure.GetInt())
|
if (mat_debug_autoexposure.GetInt())
|
||||||
Warning("avg_lum=%f ra=%f target=%f adj target=%f\n",
|
Warning("avg_lum=%f ra=%f target=%f adj target=%f\n",
|
||||||
avg_lum,actual_unscaled_luminance,target_scale,scalevalue);
|
avg_lum,actual_unscaled_luminance,target_scale,scalevalue);
|
||||||
@ -3154,9 +3154,9 @@ static void DoPostProcessingEffects( int x, int y, int w, int h )
|
|||||||
// Warning("avg_lum=%f\n",g_HDR_HistogramSystem.GetAverageLuminance());
|
// Warning("avg_lum=%f\n",g_HDR_HistogramSystem.GetAverageLuminance());
|
||||||
if (mat_dynamic_tonemapping.GetInt())
|
if (mat_dynamic_tonemapping.GetInt())
|
||||||
{
|
{
|
||||||
float avg_lum=max(0.0001,g_HDR_HistogramSystem.GetAverageLuminance());
|
float avg_lum=MAX(0.0001,g_HDR_HistogramSystem.GetAverageLuminance());
|
||||||
float scalevalue=max(flAutoExposureMin,
|
float scalevalue=MAX(flAutoExposureMin,
|
||||||
min(flAutoExposureMax,0.18/avg_lum));
|
MIN(flAutoExposureMax,0.18/avg_lum));
|
||||||
mat_hdr_tonemapscale.SetValue(scalevalue);
|
mat_hdr_tonemapscale.SetValue(scalevalue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3188,9 +3188,9 @@ static void DoPostProcessingEffects( int x, int y, int w, int h )
|
|||||||
g_HDR_HistogramSystem.DisplayHistogram();
|
g_HDR_HistogramSystem.DisplayHistogram();
|
||||||
if (mat_dynamic_tonemapping.GetInt())
|
if (mat_dynamic_tonemapping.GetInt())
|
||||||
{
|
{
|
||||||
float avg_lum=max(0.0001,g_HDR_HistogramSystem.GetAverageLuminance());
|
float avg_lum=MAX(0.0001,g_HDR_HistogramSystem.GetAverageLuminance());
|
||||||
float scalevalue=max(flAutoExposureMin,
|
float scalevalue=MAX(flAutoExposureMin,
|
||||||
min(flAutoExposureMax,0.023/avg_lum));
|
MIN(flAutoExposureMax,0.023/avg_lum));
|
||||||
SetToneMapScale(scalevalue,flAutoExposureMin,flAutoExposureMax);
|
SetToneMapScale(scalevalue,flAutoExposureMin,flAutoExposureMax);
|
||||||
}
|
}
|
||||||
materials->SetRenderTarget( NULL );
|
materials->SetRenderTarget( NULL );
|
||||||
|
@ -458,8 +458,8 @@ const char *SplitContext( const char *raw, char *key, int keylen, char *value, i
|
|||||||
}
|
}
|
||||||
|
|
||||||
int len = colon1 - raw;
|
int len = colon1 - raw;
|
||||||
Q_strncpy( key, raw, min( len + 1, keylen ) );
|
Q_strncpy( key, raw, MIN( len + 1, keylen ) );
|
||||||
key[ min( len, keylen - 1 ) ] = 0;
|
key[ MIN( len, keylen - 1 ) ] = 0;
|
||||||
|
|
||||||
bool last = false;
|
bool last = false;
|
||||||
char *end = Q_strstr( colon1 + 1, "," );
|
char *end = Q_strstr( colon1 + 1, "," );
|
||||||
@ -476,7 +476,7 @@ const char *SplitContext( const char *raw, char *key, int keylen, char *value, i
|
|||||||
if ( duration )
|
if ( duration )
|
||||||
*duration = atof( colon2 + 1 );
|
*duration = atof( colon2 + 1 );
|
||||||
|
|
||||||
len = min( colon2 - ( colon1 + 1 ), valuelen - 1 );
|
len = MIN( colon2 - ( colon1 + 1 ), valuelen - 1 );
|
||||||
Q_strncpy( value, colon1 + 1, len + 1 );
|
Q_strncpy( value, colon1 + 1, len + 1 );
|
||||||
value[ len ] = 0;
|
value[ len ] = 0;
|
||||||
}
|
}
|
||||||
@ -485,7 +485,7 @@ const char *SplitContext( const char *raw, char *key, int keylen, char *value, i
|
|||||||
if ( duration )
|
if ( duration )
|
||||||
*duration = 0.0;
|
*duration = 0.0;
|
||||||
|
|
||||||
len = min( end - ( colon1 + 1 ), valuelen - 1 );
|
len = MIN( end - ( colon1 + 1 ), valuelen - 1 );
|
||||||
Q_strncpy( value, colon1 + 1, len + 1 );
|
Q_strncpy( value, colon1 + 1, len + 1 );
|
||||||
value[ len ] = 0;
|
value[ len ] = 0;
|
||||||
}
|
}
|
||||||
|
@ -74,7 +74,7 @@ void CAI_InterestTarget::Add( CBaseEntity *pTarget, float flImportance, float fl
|
|||||||
{
|
{
|
||||||
if (target.m_flStartTime == gpGlobals->curtime)
|
if (target.m_flStartTime == gpGlobals->curtime)
|
||||||
{
|
{
|
||||||
flImportance = max( flImportance, target.m_flInterest );
|
flImportance = MAX( flImportance, target.m_flInterest );
|
||||||
}
|
}
|
||||||
Remove( i );
|
Remove( i );
|
||||||
break;
|
break;
|
||||||
@ -114,7 +114,7 @@ void CAI_InterestTarget::Add( CBaseEntity *pTarget, const Vector &vecPosition, f
|
|||||||
{
|
{
|
||||||
if (target.m_flStartTime == gpGlobals->curtime)
|
if (target.m_flStartTime == gpGlobals->curtime)
|
||||||
{
|
{
|
||||||
flImportance = max( flImportance, target.m_flInterest );
|
flImportance = MAX( flImportance, target.m_flInterest );
|
||||||
}
|
}
|
||||||
Remove( i );
|
Remove( i );
|
||||||
break;
|
break;
|
||||||
|
@ -12,9 +12,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#undef MINMAX_H
|
|
||||||
#include "minmax.h" // max() define
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// CAI_BaseActor
|
// CAI_BaseActor
|
||||||
//
|
//
|
||||||
|
@ -673,7 +673,7 @@ int CBaseAnimatingOverlay::AllocateLayer( int iPriority )
|
|||||||
{
|
{
|
||||||
if (m_AnimOverlay[i].m_nPriority <= iPriority)
|
if (m_AnimOverlay[i].m_nPriority <= iPriority)
|
||||||
{
|
{
|
||||||
iNewOrder = max( iNewOrder, m_AnimOverlay[i].m_nOrder + 1 );
|
iNewOrder = MAX( iNewOrder, m_AnimOverlay[i].m_nOrder + 1 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_AnimOverlay[ i ].IsDying())
|
else if (m_AnimOverlay[ i ].IsDying())
|
||||||
@ -759,7 +759,7 @@ void CBaseAnimatingOverlay::SetLayerPriority( int iLayer, int iPriority )
|
|||||||
{
|
{
|
||||||
if (m_AnimOverlay[i].m_nPriority <= iPriority)
|
if (m_AnimOverlay[i].m_nPriority <= iPriority)
|
||||||
{
|
{
|
||||||
iNewOrder = max( iNewOrder, m_AnimOverlay[i].m_nOrder + 1 );
|
iNewOrder = MAX( iNewOrder, m_AnimOverlay[i].m_nOrder + 1 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -207,7 +207,7 @@ float CRagdollMagnet::DistToPoint( const Vector &vecPoint )
|
|||||||
axis.InitializePlane( vecUp, GetAbsOrigin() );
|
axis.InitializePlane( vecUp, GetAbsOrigin() );
|
||||||
vDist = fabs( axis.PointDist( vecPoint ) );
|
vDist = fabs( axis.PointDist( vecPoint ) );
|
||||||
|
|
||||||
return max( hDist, vDist );
|
return MAX( hDist, vDist );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -1036,7 +1036,7 @@ void CPointCommentaryNode::UpdateViewPostThink( void )
|
|||||||
{
|
{
|
||||||
// Blend back to the player's position over time.
|
// Blend back to the player's position over time.
|
||||||
float flCurTime = (gpGlobals->curtime - m_flFinishedTime);
|
float flCurTime = (gpGlobals->curtime - m_flFinishedTime);
|
||||||
float flTimeToBlend = min( 2.0, m_flFinishedTime - m_flStartTime );
|
float flTimeToBlend = MIN( 2.0, m_flFinishedTime - m_flStartTime );
|
||||||
float flBlendPerc = 1.0 - clamp( flCurTime / flTimeToBlend, 0, 1 );
|
float flBlendPerc = 1.0 - clamp( flCurTime / flTimeToBlend, 0, 1 );
|
||||||
|
|
||||||
//Msg("OUT: CurTime %.2f, BlendTime: %.2f, Blend: %.3f\n", flCurTime, flTimeToBlend, flBlendPerc );
|
//Msg("OUT: CurTime %.2f, BlendTime: %.2f, Blend: %.3f\n", flCurTime, flTimeToBlend, flBlendPerc );
|
||||||
|
@ -143,7 +143,7 @@ void CEnvBeam::Spawn( void )
|
|||||||
|
|
||||||
BaseClass::Spawn();
|
BaseClass::Spawn();
|
||||||
|
|
||||||
m_noiseAmplitude = min(MAX_BEAM_NOISEAMPLITUDE, m_noiseAmplitude);
|
m_noiseAmplitude = MIN(MAX_BEAM_NOISEAMPLITUDE, m_noiseAmplitude);
|
||||||
|
|
||||||
// Check for tapering
|
// Check for tapering
|
||||||
if ( HasSpawnFlags( SF_BEAM_TAPEROUT ) )
|
if ( HasSpawnFlags( SF_BEAM_TAPEROUT ) )
|
||||||
@ -747,8 +747,8 @@ void CEnvBeam::BeamUpdateVars( void )
|
|||||||
|
|
||||||
RelinkBeam();
|
RelinkBeam();
|
||||||
|
|
||||||
SetWidth( min(MAX_BEAM_WIDTH, m_boltWidth) );
|
SetWidth( MIN(MAX_BEAM_WIDTH, m_boltWidth) );
|
||||||
SetNoise( min(MAX_BEAM_NOISEAMPLITUDE, m_noiseAmplitude) );
|
SetNoise( MIN(MAX_BEAM_NOISEAMPLITUDE, m_noiseAmplitude) );
|
||||||
SetFrame( m_frameStart );
|
SetFrame( m_frameStart );
|
||||||
SetScrollRate( m_speed );
|
SetScrollRate( m_speed );
|
||||||
if ( m_spawnflags & SF_BEAM_SHADEIN )
|
if ( m_spawnflags & SF_BEAM_SHADEIN )
|
||||||
|
@ -214,7 +214,7 @@ void CEnvShake::ApplyShake( ShakeCommand_t command )
|
|||||||
radius = 512;
|
radius = 512;
|
||||||
}
|
}
|
||||||
Vector extents = Vector(radius, radius, radius);
|
Vector extents = Vector(radius, radius, radius);
|
||||||
extents.z = max(extents.z, 100);
|
extents.z = MAX(extents.z, 100);
|
||||||
Vector mins = GetAbsOrigin() - extents;
|
Vector mins = GetAbsOrigin() - extents;
|
||||||
Vector maxs = GetAbsOrigin() + extents;
|
Vector maxs = GetAbsOrigin() + extents;
|
||||||
int count = UTIL_EntitiesInBox( list, 1024, mins, maxs, 0 );
|
int count = UTIL_EntitiesInBox( list, 1024, mins, maxs, 0 );
|
||||||
|
@ -207,9 +207,9 @@ float CPointAngularVelocitySensor::SampleAngularVelocity(CBaseEntity *pEntity)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
QAngle vecAngVel = pEntity->GetLocalAngularVelocity();
|
QAngle vecAngVel = pEntity->GetLocalAngularVelocity();
|
||||||
float flMax = max(fabs(vecAngVel[PITCH]), fabs(vecAngVel[YAW]));
|
float flMax = MAX(fabs(vecAngVel[PITCH]), fabs(vecAngVel[YAW]));
|
||||||
|
|
||||||
return max(flMax, fabs(vecAngVel[ROLL]));
|
return MAX(flMax, fabs(vecAngVel[ROLL]));
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -254,7 +254,7 @@ bool CAI_BaseActor::StartSceneEvent( CSceneEventInfo *info, CChoreoScene *scene,
|
|||||||
Blink();
|
Blink();
|
||||||
// don't blink for duration, or next random blink time
|
// don't blink for duration, or next random blink time
|
||||||
float flDuration = (event->GetEndTime() - scene->GetTime());
|
float flDuration = (event->GetEndTime() - scene->GetTime());
|
||||||
m_flBlinktime = gpGlobals->curtime + max( flDuration, random->RandomFloat( 1.5, 4.5 ) );
|
m_flBlinktime = gpGlobals->curtime + MAX( flDuration, random->RandomFloat( 1.5, 4.5 ) );
|
||||||
}
|
}
|
||||||
else if (stricmp( event->GetParameters(), "AI_HOLSTER") == 0)
|
else if (stricmp( event->GetParameters(), "AI_HOLSTER") == 0)
|
||||||
{
|
{
|
||||||
@ -410,8 +410,8 @@ bool CAI_BaseActor::ProcessSceneEvent( CSceneEventInfo *info, CChoreoScene *scen
|
|||||||
{
|
{
|
||||||
dir = 1;
|
dir = 1;
|
||||||
}
|
}
|
||||||
flSpineYaw = min( diff, 30 );
|
flSpineYaw = MIN( diff, 30 );
|
||||||
flBodyYaw = min( diff - flSpineYaw, 30 );
|
flBodyYaw = MIN( diff - flSpineYaw, 30 );
|
||||||
m_goalSpineYaw = m_goalSpineYaw * (1.0 - intensity) + intensity * flSpineYaw * dir;
|
m_goalSpineYaw = m_goalSpineYaw * (1.0 - intensity) + intensity * flSpineYaw * dir;
|
||||||
m_goalBodyYaw = m_goalBodyYaw * (1.0 - intensity) + intensity * flBodyYaw * dir;
|
m_goalBodyYaw = m_goalBodyYaw * (1.0 - intensity) + intensity * flBodyYaw * dir;
|
||||||
|
|
||||||
@ -442,15 +442,15 @@ bool CAI_BaseActor::ProcessSceneEvent( CSceneEventInfo *info, CChoreoScene *scen
|
|||||||
}
|
}
|
||||||
|
|
||||||
// calc how much to use the spine for turning
|
// calc how much to use the spine for turning
|
||||||
float spineintensity = (1.0 - max( 0.0, (intensity - 0.5) / 0.5 ));
|
float spineintensity = (1.0 - MAX( 0.0, (intensity - 0.5) / 0.5 ));
|
||||||
// force spine to full if not in scene or locked
|
// force spine to full if not in scene or locked
|
||||||
if (!bInScene || event->IsLockBodyFacing() )
|
if (!bInScene || event->IsLockBodyFacing() )
|
||||||
{
|
{
|
||||||
spineintensity = 1.0;
|
spineintensity = 1.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
flSpineYaw = min( diff * spineintensity, 30 );
|
flSpineYaw = MIN( diff * spineintensity, 30 );
|
||||||
flBodyYaw = min( diff * spineintensity - flSpineYaw, 30 );
|
flBodyYaw = MIN( diff * spineintensity - flSpineYaw, 30 );
|
||||||
info->m_flFacingYaw = info->m_flInitialYaw + (diff - flBodyYaw - flSpineYaw) * dir;
|
info->m_flFacingYaw = info->m_flInitialYaw + (diff - flBodyYaw - flSpineYaw) * dir;
|
||||||
|
|
||||||
if (!event->IsLockBodyFacing())
|
if (!event->IsLockBodyFacing())
|
||||||
@ -461,7 +461,7 @@ bool CAI_BaseActor::ProcessSceneEvent( CSceneEventInfo *info, CChoreoScene *scen
|
|||||||
if (bInScene)
|
if (bInScene)
|
||||||
{
|
{
|
||||||
// FIXME: what's a reasonable time to wait?
|
// FIXME: what's a reasonable time to wait?
|
||||||
AddSceneLock( min( 2.0, event->GetEndTime() - scene->GetTime() + 0.2 ) );
|
AddSceneLock( MIN( 2.0, event->GetEndTime() - scene->GetTime() + 0.2 ) );
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -473,7 +473,7 @@ bool CAI_BaseActor::ProcessSceneEvent( CSceneEventInfo *info, CChoreoScene *scen
|
|||||||
{
|
{
|
||||||
// keep eyes not blinking for duration
|
// keep eyes not blinking for duration
|
||||||
float flDuration = (event->GetEndTime() - scene->GetTime());
|
float flDuration = (event->GetEndTime() - scene->GetTime());
|
||||||
m_flBlinktime = max( m_flBlinktime, gpGlobals->curtime + flDuration );
|
m_flBlinktime = MAX( m_flBlinktime, gpGlobals->curtime + flDuration );
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
case SCENE_AI_HOLSTER:
|
case SCENE_AI_HOLSTER:
|
||||||
@ -505,7 +505,7 @@ bool CAI_BaseActor::ProcessSceneEvent( CSceneEventInfo *info, CChoreoScene *scen
|
|||||||
{
|
{
|
||||||
float flDuration = (event->GetEndTime() - scene->GetTime());
|
float flDuration = (event->GetEndTime() - scene->GetTime());
|
||||||
int i = m_syntheticLookQueue.Count() - 1;
|
int i = m_syntheticLookQueue.Count() - 1;
|
||||||
m_syntheticLookQueue[i].m_flEndTime = min( m_syntheticLookQueue[i].m_flEndTime, gpGlobals->curtime + flDuration );
|
m_syntheticLookQueue[i].m_flEndTime = MIN( m_syntheticLookQueue[i].m_flEndTime, gpGlobals->curtime + flDuration );
|
||||||
m_syntheticLookQueue[i].m_flInterest = 0.1;
|
m_syntheticLookQueue[i].m_flInterest = 0.1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1496,7 +1496,7 @@ void CAI_BaseActor::MaintainLookTargets( float flInterval )
|
|||||||
// no target, decay all head control direction
|
// no target, decay all head control direction
|
||||||
m_goalHeadDirection = m_goalHeadDirection * 0.8 + vHead * 0.2;
|
m_goalHeadDirection = m_goalHeadDirection * 0.8 + vHead * 0.2;
|
||||||
|
|
||||||
m_goalHeadInfluence = max( m_goalHeadInfluence - 0.2, 0 );
|
m_goalHeadInfluence = MAX( m_goalHeadInfluence - 0.2, 0 );
|
||||||
|
|
||||||
VectorNormalize( m_goalHeadDirection );
|
VectorNormalize( m_goalHeadDirection );
|
||||||
UpdateHeadBodyControl( vEyePosition + m_goalHeadDirection * 100, m_goalHeadInfluence, vEyePosition + m_goalHeadDirection * 100, 0.0 );
|
UpdateHeadBodyControl( vEyePosition + m_goalHeadDirection * 100, m_goalHeadInfluence, vEyePosition + m_goalHeadDirection * 100, 0.0 );
|
||||||
|
@ -3445,7 +3445,7 @@ void CAI_BaseNPC::RebalanceThinks()
|
|||||||
|
|
||||||
int iMaxThinkersPerTick = static_cast<int>(ceil( (float)( rebalanceCandidates.Count() + 1 ) / (float)iTicksPer10Hz )); // +1 to account for "this"
|
int iMaxThinkersPerTick = static_cast<int>(ceil( (float)( rebalanceCandidates.Count() + 1 ) / (float)iTicksPer10Hz )); // +1 to account for "this"
|
||||||
|
|
||||||
int iCurTickDistributing = min( gpGlobals->tickcount, rebalanceCandidates[0].iNextThinkTick );
|
int iCurTickDistributing = MIN( gpGlobals->tickcount, rebalanceCandidates[0].iNextThinkTick );
|
||||||
int iRemainingThinksToDistribute = iMaxThinkersPerTick - 1; // Start with one fewer first time because "this" is
|
int iRemainingThinksToDistribute = iMaxThinkersPerTick - 1; // Start with one fewer first time because "this" is
|
||||||
// always gets a slot in the current tick to avoid complications
|
// always gets a slot in the current tick to avoid complications
|
||||||
// in the calculation of "last think"
|
// in the calculation of "last think"
|
||||||
@ -5499,7 +5499,7 @@ void CAI_BaseNPC::GatherEnemyConditions( CBaseEntity *pEnemy )
|
|||||||
float tooFar = m_flDistTooFar;
|
float tooFar = m_flDistTooFar;
|
||||||
if ( GetActiveWeapon() && HasCondition(COND_SEE_ENEMY) )
|
if ( GetActiveWeapon() && HasCondition(COND_SEE_ENEMY) )
|
||||||
{
|
{
|
||||||
tooFar = max( m_flDistTooFar, GetActiveWeapon()->m_fMaxRange1 );
|
tooFar = MAX( m_flDistTooFar, GetActiveWeapon()->m_fMaxRange1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( flDistToEnemy >= tooFar )
|
if ( flDistToEnemy >= tooFar )
|
||||||
|
@ -34,8 +34,6 @@
|
|||||||
#include "ai_navgoaltype.h" //GoalType_t enum
|
#include "ai_navgoaltype.h" //GoalType_t enum
|
||||||
#include "eventlist.h"
|
#include "eventlist.h"
|
||||||
#include "soundent.h"
|
#include "soundent.h"
|
||||||
#undef MINMAX_H
|
|
||||||
#include "minmax.h"
|
|
||||||
|
|
||||||
#define PLAYER_SQUADNAME "player_squad"
|
#define PLAYER_SQUADNAME "player_squad"
|
||||||
|
|
||||||
@ -1467,7 +1465,7 @@ public:
|
|||||||
//
|
//
|
||||||
//-----------------------------------------------------
|
//-----------------------------------------------------
|
||||||
|
|
||||||
void AddSceneLock( float flDuration ) { m_flSceneTime = max( gpGlobals->curtime + flDuration, m_flSceneTime ); };
|
void AddSceneLock( float flDuration ) { m_flSceneTime = MAX( gpGlobals->curtime + flDuration, m_flSceneTime ); };
|
||||||
bool IsInLockedScene( void ) { return m_flSceneTime > gpGlobals->curtime; };
|
bool IsInLockedScene( void ) { return m_flSceneTime > gpGlobals->curtime; };
|
||||||
float m_flSceneTime;
|
float m_flSceneTime;
|
||||||
string_t m_iszSceneCustomMoveSeq;
|
string_t m_iszSceneCustomMoveSeq;
|
||||||
|
@ -790,11 +790,11 @@ bool CAI_BaseNPC::FindCoverPos( CSound *pSound, Vector *pResult )
|
|||||||
{
|
{
|
||||||
if ( !GetTacticalServices()->FindCoverPos( pSound->GetSoundReactOrigin(),
|
if ( !GetTacticalServices()->FindCoverPos( pSound->GetSoundReactOrigin(),
|
||||||
pSound->GetSoundReactOrigin(),
|
pSound->GetSoundReactOrigin(),
|
||||||
min( pSound->Volume(), 120.0 ),
|
MIN( pSound->Volume(), 120.0 ),
|
||||||
CoverRadius(),
|
CoverRadius(),
|
||||||
pResult ) )
|
pResult ) )
|
||||||
{
|
{
|
||||||
return GetTacticalServices()->FindLateralCover( pSound->GetSoundReactOrigin(), min( pSound->Volume(), 60.0 ), pResult );
|
return GetTacticalServices()->FindLateralCover( pSound->GetSoundReactOrigin(), MIN( pSound->Volume(), 60.0 ), pResult );
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -1732,7 +1732,7 @@ void CAI_BaseNPC::StartTask( const Task_t *pTask )
|
|||||||
{
|
{
|
||||||
if ( GetActiveWeapon() && GetEnemy() )
|
if ( GetActiveWeapon() && GetEnemy() )
|
||||||
{
|
{
|
||||||
float range = max( GetActiveWeapon()->m_fMaxRange1, GetActiveWeapon()->m_fMaxRange2 );
|
float range = MAX( GetActiveWeapon()->m_fMaxRange1, GetActiveWeapon()->m_fMaxRange2 );
|
||||||
if ( pTask->flTaskData != 0 && pTask->flTaskData < range )
|
if ( pTask->flTaskData != 0 && pTask->flTaskData < range )
|
||||||
range = pTask->flTaskData;
|
range = pTask->flTaskData;
|
||||||
float dist = EnemyDistance( GetEnemy() );
|
float dist = EnemyDistance( GetEnemy() );
|
||||||
@ -1763,8 +1763,8 @@ void CAI_BaseNPC::StartTask( const Task_t *pTask )
|
|||||||
|
|
||||||
if ( GetActiveWeapon() )
|
if ( GetActiveWeapon() )
|
||||||
{
|
{
|
||||||
flMaxRange = max( GetActiveWeapon()->m_fMaxRange1, GetActiveWeapon()->m_fMaxRange2 );
|
flMaxRange = MAX( GetActiveWeapon()->m_fMaxRange1, GetActiveWeapon()->m_fMaxRange2 );
|
||||||
flMinRange = min( GetActiveWeapon()->m_fMinRange1, GetActiveWeapon()->m_fMinRange2 );
|
flMinRange = MIN( GetActiveWeapon()->m_fMinRange1, GetActiveWeapon()->m_fMinRange2 );
|
||||||
}
|
}
|
||||||
|
|
||||||
//Check against NPC's max range
|
//Check against NPC's max range
|
||||||
@ -1903,8 +1903,8 @@ void CAI_BaseNPC::StartTask( const Task_t *pTask )
|
|||||||
|
|
||||||
if ( GetActiveWeapon() )
|
if ( GetActiveWeapon() )
|
||||||
{
|
{
|
||||||
flMaxRange = max( GetActiveWeapon()->m_fMaxRange1, GetActiveWeapon()->m_fMaxRange2 );
|
flMaxRange = MAX( GetActiveWeapon()->m_fMaxRange1, GetActiveWeapon()->m_fMaxRange2 );
|
||||||
flMinRange = min( GetActiveWeapon()->m_fMinRange1, GetActiveWeapon()->m_fMinRange2 );
|
flMinRange = MIN( GetActiveWeapon()->m_fMinRange1, GetActiveWeapon()->m_fMinRange2 );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check against NPC's max range
|
// Check against NPC's max range
|
||||||
@ -2054,8 +2054,8 @@ void CAI_BaseNPC::StartTask( const Task_t *pTask )
|
|||||||
float flMinRange = 0;
|
float flMinRange = 0;
|
||||||
if (GetActiveWeapon())
|
if (GetActiveWeapon())
|
||||||
{
|
{
|
||||||
flMaxRange = max(GetActiveWeapon()->m_fMaxRange1,GetActiveWeapon()->m_fMaxRange2);
|
flMaxRange = MAX(GetActiveWeapon()->m_fMaxRange1,GetActiveWeapon()->m_fMaxRange2);
|
||||||
flMinRange = min(GetActiveWeapon()->m_fMinRange1,GetActiveWeapon()->m_fMinRange2);
|
flMinRange = MIN(GetActiveWeapon()->m_fMinRange1,GetActiveWeapon()->m_fMinRange2);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check against NPC's max range
|
// Check against NPC's max range
|
||||||
@ -3453,7 +3453,7 @@ void CAI_BaseNPC::RunTask( const Task_t *pTask )
|
|||||||
}
|
}
|
||||||
|
|
||||||
AngleVectors( ang, &move );
|
AngleVectors( ang, &move );
|
||||||
if ( GetNavigator()->SetVectorGoal( move, (float)pTask->flTaskData, min(36,pTask->flTaskData), true ) && IsValidMoveAwayDest( GetNavigator()->GetGoalPos() ))
|
if ( GetNavigator()->SetVectorGoal( move, (float)pTask->flTaskData, MIN(36,pTask->flTaskData), true ) && IsValidMoveAwayDest( GetNavigator()->GetGoalPos() ))
|
||||||
{
|
{
|
||||||
TaskComplete();
|
TaskComplete();
|
||||||
}
|
}
|
||||||
@ -3462,7 +3462,7 @@ void CAI_BaseNPC::RunTask( const Task_t *pTask )
|
|||||||
ang.y = GetMotor()->GetIdealYaw() + 91;
|
ang.y = GetMotor()->GetIdealYaw() + 91;
|
||||||
AngleVectors( ang, &move );
|
AngleVectors( ang, &move );
|
||||||
|
|
||||||
if ( GetNavigator()->SetVectorGoal( move, (float)pTask->flTaskData, min(24,pTask->flTaskData), true ) && IsValidMoveAwayDest( GetNavigator()->GetGoalPos() ) )
|
if ( GetNavigator()->SetVectorGoal( move, (float)pTask->flTaskData, MIN(24,pTask->flTaskData), true ) && IsValidMoveAwayDest( GetNavigator()->GetGoalPos() ) )
|
||||||
{
|
{
|
||||||
TaskComplete();
|
TaskComplete();
|
||||||
}
|
}
|
||||||
@ -3479,7 +3479,7 @@ void CAI_BaseNPC::RunTask( const Task_t *pTask )
|
|||||||
ang.y = GetMotor()->GetIdealYaw() + 271;
|
ang.y = GetMotor()->GetIdealYaw() + 271;
|
||||||
AngleVectors( ang, &move );
|
AngleVectors( ang, &move );
|
||||||
|
|
||||||
if ( GetNavigator()->SetVectorGoal( move, (float)pTask->flTaskData, min(24,pTask->flTaskData), true ) && IsValidMoveAwayDest( GetNavigator()->GetGoalPos() ) )
|
if ( GetNavigator()->SetVectorGoal( move, (float)pTask->flTaskData, MIN(24,pTask->flTaskData), true ) && IsValidMoveAwayDest( GetNavigator()->GetGoalPos() ) )
|
||||||
{
|
{
|
||||||
TaskComplete();
|
TaskComplete();
|
||||||
}
|
}
|
||||||
@ -3501,7 +3501,7 @@ void CAI_BaseNPC::RunTask( const Task_t *pTask )
|
|||||||
|
|
||||||
AngleVectors( ang, &move );
|
AngleVectors( ang, &move );
|
||||||
|
|
||||||
if ( GetNavigator()->SetVectorGoal( move, (float)pTask->flTaskData, min(6,pTask->flTaskData), false ) && IsValidMoveAwayDest( GetNavigator()->GetGoalPos() ) )
|
if ( GetNavigator()->SetVectorGoal( move, (float)pTask->flTaskData, MIN(6,pTask->flTaskData), false ) && IsValidMoveAwayDest( GetNavigator()->GetGoalPos() ) )
|
||||||
{
|
{
|
||||||
TaskComplete();
|
TaskComplete();
|
||||||
}
|
}
|
||||||
|
@ -435,14 +435,14 @@ bool CAI_FollowBehavior::IsFollowTargetInRange()
|
|||||||
|
|
||||||
if( GetNpcState() == NPC_STATE_COMBAT )
|
if( GetNpcState() == NPC_STATE_COMBAT )
|
||||||
{
|
{
|
||||||
if( IsFollowGoalInRange( max( m_FollowNavGoal.coverTolerance, m_FollowNavGoal.enemyLOSTolerance ), GetGoalZRange(), GetGoalFlags() ) )
|
if( IsFollowGoalInRange( MAX( m_FollowNavGoal.coverTolerance, m_FollowNavGoal.enemyLOSTolerance ), GetGoalZRange(), GetGoalFlags() ) )
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if( IsFollowGoalInRange( max( m_FollowNavGoal.tolerance, GetGoalRange() ), GetGoalZRange(), GetGoalFlags() ) )
|
if( IsFollowGoalInRange( MAX( m_FollowNavGoal.tolerance, GetGoalRange() ), GetGoalZRange(), GetGoalFlags() ) )
|
||||||
{
|
{
|
||||||
if ( m_FollowNavGoal.flags & AIFF_REQUIRE_LOS_OUTSIDE_COMBAT )
|
if ( m_FollowNavGoal.flags & AIFF_REQUIRE_LOS_OUTSIDE_COMBAT )
|
||||||
{
|
{
|
||||||
@ -827,7 +827,7 @@ CAI_Hint *CAI_FollowBehavior::FindFollowPoint()
|
|||||||
hintCriteria.SetFlag( bits_HINT_NODE_VISIBLE | bits_HINT_NODE_NEAREST );
|
hintCriteria.SetFlag( bits_HINT_NODE_VISIBLE | bits_HINT_NODE_NEAREST );
|
||||||
|
|
||||||
// Add the search position
|
// Add the search position
|
||||||
hintCriteria.AddIncludePosition( GetGoalPosition(), max( m_FollowNavGoal.followPointTolerance, GetGoalRange() ) );
|
hintCriteria.AddIncludePosition( GetGoalPosition(), MAX( m_FollowNavGoal.followPointTolerance, GetGoalRange() ) );
|
||||||
hintCriteria.AddExcludePosition( GetGoalPosition(), (GetFollowTarget()->WorldAlignMins().AsVector2D() - GetFollowTarget()->WorldAlignMaxs().AsVector2D()).Length());
|
hintCriteria.AddExcludePosition( GetGoalPosition(), (GetFollowTarget()->WorldAlignMins().AsVector2D() - GetFollowTarget()->WorldAlignMaxs().AsVector2D()).Length());
|
||||||
|
|
||||||
return CAI_HintManager::FindHint( GetOuter(), hintCriteria );
|
return CAI_HintManager::FindHint( GetOuter(), hintCriteria );
|
||||||
@ -839,7 +839,7 @@ bool CAI_FollowBehavior::IsFollowPointInRange()
|
|||||||
{
|
{
|
||||||
return ( GetHintNode() &&
|
return ( GetHintNode() &&
|
||||||
GetHintNode()->HintType() == HINT_FOLLOW_WAIT_POINT &&
|
GetHintNode()->HintType() == HINT_FOLLOW_WAIT_POINT &&
|
||||||
(GetHintNode()->GetAbsOrigin() - GetFollowTarget()->GetAbsOrigin()).LengthSqr() < Square(max(m_FollowNavGoal.followPointTolerance, GetGoalRange())) );
|
(GetHintNode()->GetAbsOrigin() - GetFollowTarget()->GetAbsOrigin()).LengthSqr() < Square(MAX(m_FollowNavGoal.followPointTolerance, GetGoalRange())) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1390,7 +1390,7 @@ void CAI_FollowBehavior::StartTask( const Task_t *pTask )
|
|||||||
if ( pLeader )
|
if ( pLeader )
|
||||||
{
|
{
|
||||||
Vector coverPos = vec3_invalid;
|
Vector coverPos = vec3_invalid;
|
||||||
float coverRadius = min( GetOuter()->CoverRadius(), m_FollowNavGoal.coverTolerance );
|
float coverRadius = MIN( GetOuter()->CoverRadius(), m_FollowNavGoal.coverTolerance );
|
||||||
|
|
||||||
if ( FindCoverFromEnemyAtFollowTarget( coverRadius, &coverPos ) )
|
if ( FindCoverFromEnemyAtFollowTarget( coverRadius, &coverPos ) )
|
||||||
{
|
{
|
||||||
@ -1479,7 +1479,7 @@ void CAI_FollowBehavior::RunTask( const Task_t *pTask )
|
|||||||
{
|
{
|
||||||
Assert( GetOuter()->m_vInterruptSavePosition == vec3_invalid );
|
Assert( GetOuter()->m_vInterruptSavePosition == vec3_invalid );
|
||||||
Vector coverPos = vec3_invalid;
|
Vector coverPos = vec3_invalid;
|
||||||
float coverRadius = min( (float)12*12, m_FollowNavGoal.coverTolerance );
|
float coverRadius = MIN( (float)12*12, m_FollowNavGoal.coverTolerance );
|
||||||
if ( FindCoverFromEnemyAtFollowTarget( coverRadius, &coverPos ) )
|
if ( FindCoverFromEnemyAtFollowTarget( coverRadius, &coverPos ) )
|
||||||
{
|
{
|
||||||
GetOuter()->m_vInterruptSavePosition = coverPos;
|
GetOuter()->m_vInterruptSavePosition = coverPos;
|
||||||
|
@ -148,7 +148,7 @@ void CAI_RappelBehavior::SetDescentSpeed()
|
|||||||
float factor;
|
float factor;
|
||||||
factor = flDist / RAPPEL_DECEL_DIST;
|
factor = flDist / RAPPEL_DECEL_DIST;
|
||||||
|
|
||||||
speed = max( RAPPEL_MIN_SPEED, speed * factor );
|
speed = MAX( RAPPEL_MIN_SPEED, speed * factor );
|
||||||
}
|
}
|
||||||
|
|
||||||
Vector vecNewVelocity = vec3_origin;
|
Vector vecNewVelocity = vec3_origin;
|
||||||
|
@ -380,7 +380,7 @@ void CAI_BlendedMotor::SetMoveScriptAnim( float flNewSpeed )
|
|||||||
m_flSecondaryWeight = 0.0;
|
m_flSecondaryWeight = 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_flSecondaryWeight = min( m_flSecondaryWeight + 0.3, 1.0 );
|
m_flSecondaryWeight = MIN( m_flSecondaryWeight + 0.3, 1.0 );
|
||||||
|
|
||||||
if (m_flSecondaryWeight < 1.0)
|
if (m_flSecondaryWeight < 1.0)
|
||||||
{
|
{
|
||||||
@ -1092,7 +1092,7 @@ void CAI_BlendedMotor::BuildVelocityScript( const AILocalMoveGoal_t &move )
|
|||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
idealVelocity = idealVelocity * min( m_flReactiveSpeedAdjust, m_flPredictiveSpeedAdjust );
|
idealVelocity = idealVelocity * MIN( m_flReactiveSpeedAdjust, m_flPredictiveSpeedAdjust );
|
||||||
|
|
||||||
//-------------------------
|
//-------------------------
|
||||||
|
|
||||||
@ -1178,7 +1178,7 @@ void CAI_BlendedMotor::BuildVelocityScript( const AILocalMoveGoal_t &move )
|
|||||||
|
|
||||||
{
|
{
|
||||||
float minJumpHeight = 0;
|
float minJumpHeight = 0;
|
||||||
float maxHorzVel = max( GetCurSpeed(), 100 );
|
float maxHorzVel = MAX( GetCurSpeed(), 100 );
|
||||||
float gravity = sv_gravity.GetFloat() * GetOuter()->GetGravity();
|
float gravity = sv_gravity.GetFloat() * GetOuter()->GetGravity();
|
||||||
Vector vecApex;
|
Vector vecApex;
|
||||||
Vector rawJumpVel = GetMoveProbe()->CalcJumpLaunchVelocity(script.vecLocation, pNext->vecLocation, gravity, &minJumpHeight, maxHorzVel, &vecApex );
|
Vector rawJumpVel = GetMoveProbe()->CalcJumpLaunchVelocity(script.vecLocation, pNext->vecLocation, gravity, &minJumpHeight, maxHorzVel, &vecApex );
|
||||||
@ -1447,7 +1447,7 @@ void CAI_BlendedMotor::BuildVelocityScript( const AILocalMoveGoal_t &move )
|
|||||||
// clamp min velocities
|
// clamp min velocities
|
||||||
for (i = 0; i < m_scriptMove.Count(); i++)
|
for (i = 0; i < m_scriptMove.Count(); i++)
|
||||||
{
|
{
|
||||||
m_scriptMove[i].flMaxVelocity = max( m_scriptMove[i].flMaxVelocity, MIN_VELOCITY );
|
m_scriptMove[i].flMaxVelocity = MAX( m_scriptMove[i].flMaxVelocity, MIN_VELOCITY );
|
||||||
}
|
}
|
||||||
|
|
||||||
// rebuild fields
|
// rebuild fields
|
||||||
@ -1517,7 +1517,7 @@ void CAI_BlendedMotor::InsertSlowdown( float distToObstruction, float idealAccel
|
|||||||
// clamp the next velocity to the possible accel in the given distance
|
// clamp the next velocity to the possible accel in the given distance
|
||||||
if (!bAlwaysSlowdown && SolveQuadratic( -0.5 * idealAccel, m_scriptMove[0].flMaxVelocity, -distToObstruction, r1, r2 ))
|
if (!bAlwaysSlowdown && SolveQuadratic( -0.5 * idealAccel, m_scriptMove[0].flMaxVelocity, -distToObstruction, r1, r2 ))
|
||||||
{
|
{
|
||||||
script.flMaxVelocity = max( 10, m_scriptMove[0].flMaxVelocity - idealAccel * r1 );
|
script.flMaxVelocity = MAX( 10, m_scriptMove[0].flMaxVelocity - idealAccel * r1 );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -1718,7 +1718,7 @@ bool CAI_BlendedMotor::AddTurnGesture( float flYD )
|
|||||||
float speed = (diff / (turnCompletion * actualDuration / rate)) * 0.1;
|
float speed = (diff / (turnCompletion * actualDuration / rate)) * 0.1;
|
||||||
|
|
||||||
speed = clamp( speed, 15, 35 );
|
speed = clamp( speed, 15, 35 );
|
||||||
speed = min( speed, diff );
|
speed = MIN( speed, diff );
|
||||||
|
|
||||||
actualDuration = (diff / (turnCompletion * speed)) * 0.1 ;
|
actualDuration = (diff / (turnCompletion * speed)) * 0.1 ;
|
||||||
|
|
||||||
@ -1731,7 +1731,7 @@ bool CAI_BlendedMotor::AddTurnGesture( float flYD )
|
|||||||
Remember( bits_MEMORY_TURNING );
|
Remember( bits_MEMORY_TURNING );
|
||||||
|
|
||||||
// don't overlap the turn portion of the gestures, and don't play them too often
|
// don't overlap the turn portion of the gestures, and don't play them too often
|
||||||
m_flNextTurnGesture = gpGlobals->curtime + max( turnCompletion * actualDuration, 0.3 );
|
m_flNextTurnGesture = gpGlobals->curtime + MAX( turnCompletion * actualDuration, 0.3 );
|
||||||
|
|
||||||
/*
|
/*
|
||||||
if ( GetOuter()->m_debugOverlays & OVERLAY_NPC_SELECTED_BIT )
|
if ( GetOuter()->m_debugOverlays & OVERLAY_NPC_SELECTED_BIT )
|
||||||
|
@ -508,7 +508,7 @@ CAI_Hint *CAI_HintManager::FindHint( CAI_BaseNPC *pNPC, const Vector &position,
|
|||||||
pNPC ? pNPC->entindex() : -1,
|
pNPC ? pNPC->entindex() : -1,
|
||||||
position.x, position.y, position.z,
|
position.x, position.y, position.z,
|
||||||
timer.GetDuration().GetMillisecondsF(),
|
timer.GetDuration().GetMillisecondsF(),
|
||||||
timer.GetDuration().GetMillisecondsF()/max( (float)visited, 1.0f ) );
|
timer.GetDuration().GetMillisecondsF()/MAX( (float)visited, 1.0f ) );
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
return pBestHint;
|
return pBestHint;
|
||||||
@ -1347,7 +1347,7 @@ int CAI_Hint::DrawDebugTextOverlays(void)
|
|||||||
Q_snprintf(tempstr,sizeof(tempstr),"%s (%i)", GetHintTypeDescription( HintType() ), HintType());
|
Q_snprintf(tempstr,sizeof(tempstr),"%s (%i)", GetHintTypeDescription( HintType() ), HintType());
|
||||||
EntityText(text_offset,tempstr,0);
|
EntityText(text_offset,tempstr,0);
|
||||||
text_offset++;
|
text_offset++;
|
||||||
Q_snprintf(tempstr,sizeof(tempstr),"delay %f", max( 0.0f, m_flNextUseTime - gpGlobals->curtime ) ) ;
|
Q_snprintf(tempstr,sizeof(tempstr),"delay %f", MAX( 0.0f, m_flNextUseTime - gpGlobals->curtime ) ) ;
|
||||||
EntityText(text_offset,tempstr,0);
|
EntityText(text_offset,tempstr,0);
|
||||||
text_offset++;
|
text_offset++;
|
||||||
|
|
||||||
|
@ -91,13 +91,13 @@ bool CAI_LocalNavigator::MoveCalcDirect( AILocalMoveGoal_t *pMoveGoal, bool bOnl
|
|||||||
CAI_Motor *pMotor = GetOuter()->GetMotor();
|
CAI_Motor *pMotor = GetOuter()->GetMotor();
|
||||||
float minCheckDist = pMotor->MinCheckDist();
|
float minCheckDist = pMotor->MinCheckDist();
|
||||||
float probeDist = m_pPlaneSolver->CalcProbeDist( pMoveGoal->speed ); // having this match steering allows one fewer traces
|
float probeDist = m_pPlaneSolver->CalcProbeDist( pMoveGoal->speed ); // having this match steering allows one fewer traces
|
||||||
float checkDist = max( minCheckDist, probeDist );
|
float checkDist = MAX( minCheckDist, probeDist );
|
||||||
float checkStepDist = max( 16.0, probeDist * 0.5 );
|
float checkStepDist = MAX( 16.0, probeDist * 0.5 );
|
||||||
|
|
||||||
if ( pMoveGoal->flags & ( AILMG_TARGET_IS_TRANSITION | AILMG_TARGET_IS_GOAL ) )
|
if ( pMoveGoal->flags & ( AILMG_TARGET_IS_TRANSITION | AILMG_TARGET_IS_GOAL ) )
|
||||||
{
|
{
|
||||||
// clamp checkDist to be no farther than max distance to goal
|
// clamp checkDist to be no farther than max distance to goal
|
||||||
checkDist = min( checkDist, pMoveGoal->maxDist );
|
checkDist = MIN( checkDist, pMoveGoal->maxDist );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( checkDist <= 0.0 )
|
if ( checkDist <= 0.0 )
|
||||||
|
@ -303,7 +303,7 @@ AIMoveResult_t CAI_Motor::MoveClimbExecute( const Vector &climbDest, const Vecto
|
|||||||
if (m_nDismountSequence != ACT_INVALID)
|
if (m_nDismountSequence != ACT_INVALID)
|
||||||
{
|
{
|
||||||
// catch situations where the climb mount/dismount finished before reaching goal
|
// catch situations where the climb mount/dismount finished before reaching goal
|
||||||
climbSpeed = max( climbSpeed, 30.0 );
|
climbSpeed = MAX( climbSpeed, 30.0 );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -763,7 +763,7 @@ void CAI_Motor::UpdateYaw( int yawSpeed )
|
|||||||
ideal = UTIL_AngleMod( GetIdealYaw() );
|
ideal = UTIL_AngleMod( GetIdealYaw() );
|
||||||
|
|
||||||
// FIXME: this needs a proper interval
|
// FIXME: this needs a proper interval
|
||||||
float dt = min( 0.2, gpGlobals->curtime - GetLastThink() );
|
float dt = MIN( 0.2, gpGlobals->curtime - GetLastThink() );
|
||||||
|
|
||||||
newYaw = AI_ClampYaw( (float)yawSpeed * 10.0, current, ideal, dt );
|
newYaw = AI_ClampYaw( (float)yawSpeed * 10.0, current, ideal, dt );
|
||||||
|
|
||||||
@ -933,7 +933,7 @@ float CAI_Motor::MinCheckDist( void )
|
|||||||
{
|
{
|
||||||
// Take the groundspeed into account
|
// Take the groundspeed into account
|
||||||
float flMoveDist = GetMoveInterval() * GetIdealSpeed();
|
float flMoveDist = GetMoveInterval() * GetIdealSpeed();
|
||||||
float flMinDist = max( MinStoppingDist(), flMoveDist);
|
float flMinDist = MAX( MinStoppingDist(), flMoveDist);
|
||||||
if ( flMinDist < GetHullWidth() )
|
if ( flMinDist < GetHullWidth() )
|
||||||
flMinDist = GetHullWidth();
|
flMinDist = GetHullWidth();
|
||||||
return flMinDist;
|
return flMinDist;
|
||||||
|
@ -528,7 +528,7 @@ bool CAI_MoveProbe::TestGroundMove( const Vector &vecActualStart, const Vector &
|
|||||||
|
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
float flStepSize = min( LOCAL_STEP_SIZE, pMoveTrace->flTotalDist - distClear );
|
float flStepSize = MIN( LOCAL_STEP_SIZE, pMoveTrace->flTotalDist - distClear );
|
||||||
if ( flStepSize < 0.001 )
|
if ( flStepSize < 0.001 )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -643,7 +643,7 @@ bool CAI_MoveProbe::TestGroundMove( const Vector &vecActualStart, const Vector &
|
|||||||
// and not a ledge above or below the target.
|
// and not a ledge above or below the target.
|
||||||
if (!(flags & AITGM_2D))
|
if (!(flags & AITGM_2D))
|
||||||
{
|
{
|
||||||
float threshold = max( 0.5f * GetHullHeight(), StepHeight() + 0.1 );
|
float threshold = MAX( 0.5f * GetHullHeight(), StepHeight() + 0.1 );
|
||||||
if (fabs(pMoveTrace->vEndPosition.z - vecDesiredEnd.z) > threshold)
|
if (fabs(pMoveTrace->vEndPosition.z - vecDesiredEnd.z) > threshold)
|
||||||
{
|
{
|
||||||
#if 0
|
#if 0
|
||||||
@ -1094,9 +1094,9 @@ Vector CAI_MoveProbe::CalcJumpLaunchVelocity(const Vector &startPos, const Vecto
|
|||||||
float minHorzHeight = 0.5 * flGravity * (minHorzTime * 0.5) * (minHorzTime * 0.5);
|
float minHorzHeight = 0.5 * flGravity * (minHorzTime * 0.5) * (minHorzTime * 0.5);
|
||||||
|
|
||||||
// jump height must be enough to hang in the air
|
// jump height must be enough to hang in the air
|
||||||
*pminHeight = max( *pminHeight, minHorzHeight );
|
*pminHeight = MAX( *pminHeight, minHorzHeight );
|
||||||
// jump height must be enough to cover the step up
|
// jump height must be enough to cover the step up
|
||||||
*pminHeight = max( *pminHeight, stepHeight );
|
*pminHeight = MAX( *pminHeight, stepHeight );
|
||||||
|
|
||||||
// time from start to apex
|
// time from start to apex
|
||||||
float t0 = sqrt( ( 2.0 * *pminHeight) / flGravity );
|
float t0 = sqrt( ( 2.0 * *pminHeight) / flGravity );
|
||||||
|
@ -1342,7 +1342,7 @@ AIMoveResult_t CAI_Navigator::MoveClimb()
|
|||||||
// Look for a block by another NPC, and attempt to recover
|
// Look for a block by another NPC, and attempt to recover
|
||||||
AIMoveTrace_t moveTrace;
|
AIMoveTrace_t moveTrace;
|
||||||
if ( climbDist > 0.01 &&
|
if ( climbDist > 0.01 &&
|
||||||
!GetMoveProbe()->MoveLimit( NAV_CLIMB, GetLocalOrigin(), GetLocalOrigin() + ( climbDir * min(0.1,climbDist - 0.005) ), MASK_NPCSOLID, GetNavTargetEntity(), &moveTrace ) )
|
!GetMoveProbe()->MoveLimit( NAV_CLIMB, GetLocalOrigin(), GetLocalOrigin() + ( climbDir * MIN(0.1,climbDist - 0.005) ), MASK_NPCSOLID, GetNavTargetEntity(), &moveTrace ) )
|
||||||
{
|
{
|
||||||
CAI_BaseNPC *pOther = ( moveTrace.pObstruction ) ? moveTrace.pObstruction->MyNPCPointer() : NULL;
|
CAI_BaseNPC *pOther = ( moveTrace.pObstruction ) ? moveTrace.pObstruction->MyNPCPointer() : NULL;
|
||||||
if ( pOther )
|
if ( pOther )
|
||||||
@ -2953,7 +2953,7 @@ AI_NavPathProgress_t CAI_Navigator::ProgressFlyPath( const AI_ProgressFlyPathPar
|
|||||||
|
|
||||||
if ( CurWaypointIsGoal() )
|
if ( CurWaypointIsGoal() )
|
||||||
{
|
{
|
||||||
float tolerance = max( params.goalTolerance, GetPath()->GetGoalTolerance() );
|
float tolerance = MAX( params.goalTolerance, GetPath()->GetGoalTolerance() );
|
||||||
if ( waypointDist <= tolerance )
|
if ( waypointDist <= tolerance )
|
||||||
return AINPP_COMPLETE;
|
return AINPP_COMPLETE;
|
||||||
}
|
}
|
||||||
|
@ -528,11 +528,11 @@ void CAI_NetworkManager::LoadNetworkGraph( void )
|
|||||||
// ------------------------------------------------------------------------
|
// ------------------------------------------------------------------------
|
||||||
if ( engine->IsInEditMode() )
|
if ( engine->IsInEditMode() )
|
||||||
{
|
{
|
||||||
numNodes = max( numNodes, 1024 );
|
numNodes = MAX( numNodes, 1024 );
|
||||||
}
|
}
|
||||||
|
|
||||||
m_pNetwork->m_pAInode = new CAI_Node*[max( numNodes, 1 )];
|
m_pNetwork->m_pAInode = new CAI_Node*[MAX( numNodes, 1 )];
|
||||||
memset( m_pNetwork->m_pAInode, 0, sizeof( CAI_Node* ) * max( numNodes, 1 ) );
|
memset( m_pNetwork->m_pAInode, 0, sizeof( CAI_Node* ) * MAX( numNodes, 1 ) );
|
||||||
|
|
||||||
// -------------------------------
|
// -------------------------------
|
||||||
// Load all the nodes to the file
|
// Load all the nodes to the file
|
||||||
@ -578,8 +578,8 @@ void CAI_NetworkManager::LoadNetworkGraph( void )
|
|||||||
// Load WC lookup table
|
// Load WC lookup table
|
||||||
// -------------------------------
|
// -------------------------------
|
||||||
delete [] GetEditOps()->m_pNodeIndexTable;
|
delete [] GetEditOps()->m_pNodeIndexTable;
|
||||||
GetEditOps()->m_pNodeIndexTable = new int[max( m_pNetwork->m_iNumNodes, 1 )];
|
GetEditOps()->m_pNodeIndexTable = new int[MAX( m_pNetwork->m_iNumNodes, 1 )];
|
||||||
memset( GetEditOps()->m_pNodeIndexTable, 0, sizeof( int ) *max( m_pNetwork->m_iNumNodes, 1 ) );
|
memset( GetEditOps()->m_pNodeIndexTable, 0, sizeof( int ) *MAX( m_pNetwork->m_iNumNodes, 1 ) );
|
||||||
|
|
||||||
for (node = 0; node < m_pNetwork->m_iNumNodes; node++)
|
for (node = 0; node < m_pNetwork->m_iNumNodes; node++)
|
||||||
{
|
{
|
||||||
@ -692,7 +692,7 @@ void CAI_NetworkManager::LoadNetworkGraph( void )
|
|||||||
// ------------------------------------------------------------------------
|
// ------------------------------------------------------------------------
|
||||||
if ( engine->IsInEditMode() )
|
if ( engine->IsInEditMode() )
|
||||||
{
|
{
|
||||||
numNodes = max( numNodes, 1024 );
|
numNodes = MAX( numNodes, 1024 );
|
||||||
}
|
}
|
||||||
|
|
||||||
m_pAInode = new CAI_Node*[numNodes];
|
m_pAInode = new CAI_Node*[numNodes];
|
||||||
|
@ -860,7 +860,7 @@ bool CAI_PlaneSolver::Solve( const AILocalMoveGoal_t &goal, float distClear, Vec
|
|||||||
|
|
||||||
if ( goal.flags & ( AILMG_TARGET_IS_TRANSITION | AILMG_TARGET_IS_GOAL ) )
|
if ( goal.flags & ( AILMG_TARGET_IS_TRANSITION | AILMG_TARGET_IS_GOAL ) )
|
||||||
{
|
{
|
||||||
probeDist = min( goal.maxDist, probeDist );
|
probeDist = MIN( goal.maxDist, probeDist );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( GenerateObstacleSuggestions( goal, goal.directTrace, distClear, probeDist, degreesPositiveArc, NUM_PROBES ) != SR_FAIL )
|
if ( GenerateObstacleSuggestions( goal, goal.directTrace, distClear, probeDist, degreesPositiveArc, NUM_PROBES ) != SR_FAIL )
|
||||||
|
@ -16,10 +16,6 @@
|
|||||||
#undef min
|
#undef min
|
||||||
#endif
|
#endif
|
||||||
#include "stdstring.h"
|
#include "stdstring.h"
|
||||||
#ifndef _WIN32
|
|
||||||
#undef MINMAX_H
|
|
||||||
#include "minmax.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined( _WIN32 )
|
#if defined( _WIN32 )
|
||||||
#pragma once
|
#pragma once
|
||||||
|
@ -275,7 +275,7 @@ float CAI_Path::GetGoalSpeed( const Vector &startPos )
|
|||||||
Vector goalDirection = GetGoalDirection( startPos );
|
Vector goalDirection = GetGoalDirection( startPos );
|
||||||
Vector targetVelocity = m_goalSpeedTarget->GetSmoothedVelocity();
|
Vector targetVelocity = m_goalSpeedTarget->GetSmoothedVelocity();
|
||||||
float dot = DotProduct( goalDirection, targetVelocity );
|
float dot = DotProduct( goalDirection, targetVelocity );
|
||||||
dot = max( 0.0f, dot );
|
dot = MAX( 0.0f, dot );
|
||||||
// return a relative impact speed of m_goalSpeed
|
// return a relative impact speed of m_goalSpeed
|
||||||
if (m_goalSpeed > 0.0)
|
if (m_goalSpeed > 0.0)
|
||||||
{
|
{
|
||||||
|
@ -682,7 +682,7 @@ bool CAI_Expresser::CanSpeak()
|
|||||||
if ( m_flLastTimeAcceptedSpeak == gpGlobals->curtime ) // only one speak accepted per think
|
if ( m_flLastTimeAcceptedSpeak == gpGlobals->curtime ) // only one speak accepted per think
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
float timeOk = max( m_flStopTalkTime, m_flBlockedTalkTime );
|
float timeOk = MAX( m_flStopTalkTime, m_flBlockedTalkTime );
|
||||||
return ( timeOk <= gpGlobals->curtime );
|
return ( timeOk <= gpGlobals->curtime );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -697,7 +697,7 @@ bool CAI_Expresser::CanSpeakAfterMyself()
|
|||||||
if ( m_flLastTimeAcceptedSpeak == gpGlobals->curtime ) // only one speak accepted per think
|
if ( m_flLastTimeAcceptedSpeak == gpGlobals->curtime ) // only one speak accepted per think
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
float timeOk = max( m_flStopTalkTimeWithoutDelay, m_flBlockedTalkTime );
|
float timeOk = MAX( m_flStopTalkTimeWithoutDelay, m_flBlockedTalkTime );
|
||||||
return ( timeOk <= gpGlobals->curtime );
|
return ( timeOk <= gpGlobals->curtime );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1449,7 +1449,7 @@ void CBaseAnimating::CalculateIKLocks( float currentTime )
|
|||||||
VectorMA( pTarget->est.pos, pTarget->est.height, up, p1 );
|
VectorMA( pTarget->est.pos, pTarget->est.height, up, p1 );
|
||||||
VectorMA( pTarget->est.pos, -pTarget->est.height, up, p2 );
|
VectorMA( pTarget->est.pos, -pTarget->est.height, up, p2 );
|
||||||
|
|
||||||
float r = max(pTarget->est.radius,1);
|
float r = MAX(pTarget->est.radius,1);
|
||||||
|
|
||||||
// don't IK to other characters
|
// don't IK to other characters
|
||||||
ray.Init( p1, p2, Vector(-r,-r,0), Vector(r,r,1) );
|
ray.Init( p1, p2, Vector(-r,-r,0), Vector(r,r,1) );
|
||||||
|
@ -2641,7 +2641,7 @@ int CBaseCombatCharacter::GiveAmmo( int iCount, int iAmmoIndex, bool bSuppressSo
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
int iMax = GetAmmoDef()->MaxCarry(iAmmoIndex);
|
int iMax = GetAmmoDef()->MaxCarry(iAmmoIndex);
|
||||||
int iAdd = min( iCount, iMax - m_iAmmo[iAmmoIndex] );
|
int iAdd = MIN( iCount, iMax - m_iAmmo[iAmmoIndex] );
|
||||||
if ( iAdd < 1 )
|
if ( iAdd < 1 )
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
@ -2854,7 +2854,7 @@ void RadiusDamage( const CTakeDamageInfo &info, const Vector &vecSrc, float flRa
|
|||||||
{
|
{
|
||||||
// Even the tiniest explosion gets attention. Don't let the radius
|
// Even the tiniest explosion gets attention. Don't let the radius
|
||||||
// be less than 128 units.
|
// be less than 128 units.
|
||||||
float soundRadius = max( 128.0f, flRadius * 1.5 );
|
float soundRadius = MAX( 128.0f, flRadius * 1.5 );
|
||||||
|
|
||||||
CSoundEnt::InsertSound( SOUND_COMBAT | SOUND_CONTEXT_EXPLOSION, vecSrc, static_cast<int>(soundRadius), 0.25, info.GetInflictor() );
|
CSoundEnt::InsertSound( SOUND_COMBAT | SOUND_CONTEXT_EXPLOSION, vecSrc, static_cast<int>(soundRadius), 0.25, info.GetInflictor() );
|
||||||
}
|
}
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user