mirror of
https://github.com/halpz/re3.git
synced 2025-07-04 20:20:43 +00:00
Cleanup
This commit is contained in:
@ -209,7 +209,7 @@ WellBufferMe(float Target, float *CurrentValue, float *CurrentSpeed, float MaxSp
|
||||
else if(TargetSpeed > 0.0f && *CurrentSpeed > TargetSpeed)
|
||||
*CurrentSpeed = TargetSpeed;
|
||||
|
||||
*CurrentValue += *CurrentSpeed * Min(10.0f, CTimer::GetTimeStep());
|
||||
*CurrentValue += *CurrentSpeed * min(10.0f, CTimer::GetTimeStep());
|
||||
}
|
||||
|
||||
void
|
||||
@ -697,7 +697,7 @@ CCam::Process_FollowPed(const CVector &CameraTarget, float TargetOrientation, fl
|
||||
// Process height offset to avoid peds and cars
|
||||
|
||||
float TargetZOffSet = m_fUnknownZOffSet + m_fDimensionOfHighestNearCar;
|
||||
TargetZOffSet = Max(TargetZOffSet, m_fPedBetweenCameraHeightOffset);
|
||||
TargetZOffSet = max(TargetZOffSet, m_fPedBetweenCameraHeightOffset);
|
||||
float TargetHeight = CameraTarget.z + TargetZOffSet - Source.z;
|
||||
|
||||
if(TargetHeight > m_fCamBufferedHeight){
|
||||
@ -753,7 +753,7 @@ CCam::Process_FollowPed(const CVector &CameraTarget, float TargetOrientation, fl
|
||||
}
|
||||
}
|
||||
|
||||
TargetCoors.z += Min(1.0f, m_fCamBufferedHeight/2.0f);
|
||||
TargetCoors.z += min(1.0f, m_fCamBufferedHeight/2.0f);
|
||||
m_cvecTargetCoorsForFudgeInter = TargetCoors;
|
||||
|
||||
Front = TargetCoors - Source;
|
||||
@ -991,7 +991,7 @@ CCam::WorkOutCamHeight(const CVector &TargetCoors, float TargetOrientation, floa
|
||||
}
|
||||
if(FoundCamRoof){
|
||||
// Camera is under something
|
||||
float roof = FoundRoofCenter ? Min(CamRoof, CarRoof) : CamRoof;
|
||||
float roof = FoundRoofCenter ? min(CamRoof, CarRoof) : CamRoof;
|
||||
// Same weirdness again?
|
||||
TargetAlpha = CGeneral::GetATanOfXY(CA_MAX_DISTANCE, roof - CamTargetZ - 1.5f);
|
||||
CamClear = false;
|
||||
@ -1249,7 +1249,7 @@ void
|
||||
CCam::Cam_On_A_String_Unobscured(const CVector &TargetCoors, float BaseDist)
|
||||
{
|
||||
CA_MAX_DISTANCE = BaseDist + 0.1f + TheCamera.CarZoomValueSmooth;
|
||||
CA_MIN_DISTANCE = Min(BaseDist*0.6f, 3.5f);
|
||||
CA_MIN_DISTANCE = min(BaseDist*0.6f, 3.5f);
|
||||
|
||||
CVector Dist = Source - TargetCoors;
|
||||
|
||||
|
@ -153,10 +153,10 @@ CCollision::LoadCollisionWhenINeedIt(bool forceChange)
|
||||
// on water we expect to be between levels
|
||||
multipleLevels = true;
|
||||
}else{
|
||||
xmin = Max(sx - 1, 0);
|
||||
xmax = Min(sx + 1, NUMSECTORS_X-1);
|
||||
ymin = Max(sy - 1, 0);
|
||||
ymax = Min(sy + 1, NUMSECTORS_Y-1);
|
||||
xmin = max(sx - 1, 0);
|
||||
xmax = min(sx + 1, NUMSECTORS_X-1);
|
||||
ymin = max(sy - 1, 0);
|
||||
ymax = min(sy + 1, NUMSECTORS_Y-1);
|
||||
|
||||
for(x = xmin; x <= xmax; x++)
|
||||
for(y = ymin; y <= ymax; y++){
|
||||
|
@ -1030,7 +1030,7 @@ int CMenuManager::FadeIn(int alpha)
|
||||
m_nCurrScreen == MENUPAGE_SAVING_IN_PROGRESS ||
|
||||
m_nCurrScreen == MENUPAGE_DELETING)
|
||||
return alpha;
|
||||
return Min(m_nMenuFadeAlpha, alpha);
|
||||
return min(m_nMenuFadeAlpha, alpha);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -17,10 +17,10 @@ void CIniFile::LoadIniFile()
|
||||
if (f){
|
||||
CFileMgr::ReadLine(f, gString, 200);
|
||||
sscanf(gString, "%f", &PedNumberMultiplier);
|
||||
PedNumberMultiplier = Min(3.0f, Max(0.5f, PedNumberMultiplier));
|
||||
PedNumberMultiplier = min(3.0f, max(0.5f, PedNumberMultiplier));
|
||||
CFileMgr::ReadLine(f, gString, 200);
|
||||
sscanf(gString, "%f", &CarNumberMultiplier);
|
||||
CarNumberMultiplier = Min(3.0f, Max(0.5f, CarNumberMultiplier));
|
||||
CarNumberMultiplier = min(3.0f, max(0.5f, CarNumberMultiplier));
|
||||
CFileMgr::CloseFile(f);
|
||||
}
|
||||
CPopulation::MaxNumberOfPedsInUse = 25.0f * PedNumberMultiplier;
|
||||
|
@ -299,10 +299,10 @@ CControllerState CPad::ReconcileTwoControllersInput(CControllerState const &Stat
|
||||
{ if ( State1.button || State2.button ) ReconState.button = 255; }
|
||||
|
||||
#define _RECONCILE_AXIS_POSITIVE(axis) \
|
||||
{ if ( State1.axis >= 0 && State2.axis >= 0 ) ReconState.axis = Max(State1.axis, State2.axis); }
|
||||
{ if ( State1.axis >= 0 && State2.axis >= 0 ) ReconState.axis = max(State1.axis, State2.axis); }
|
||||
|
||||
#define _RECONCILE_AXIS_NEGATIVE(axis) \
|
||||
{ if ( State1.axis <= 0 && State2.axis <= 0 ) ReconState.axis = Min(State1.axis, State2.axis); }
|
||||
{ if ( State1.axis <= 0 && State2.axis <= 0 ) ReconState.axis = min(State1.axis, State2.axis); }
|
||||
|
||||
#define _RECONCILE_AXIS(axis) \
|
||||
{ _RECONCILE_AXIS_POSITIVE(axis); _RECONCILE_AXIS_NEGATIVE(axis); }
|
||||
|
@ -1940,7 +1940,7 @@ CStreaming::ProcessEntitiesInSectorList(CPtrList &list, float x, float y, float
|
||||
CTimeModelInfo *mi = (CTimeModelInfo*)CModelInfo::GetModelInfo(e->GetModelIndex());
|
||||
if(mi->m_type != MITYPE_TIME || CClock::GetIsTimeInRange(mi->GetTimeOn(), mi->GetTimeOff())){
|
||||
lodDistSq = sq(mi->GetLargestLodDistance());
|
||||
lodDistSq = Min(lodDistSq, sq(STREAM_DIST));
|
||||
lodDistSq = min(lodDistSq, sq(STREAM_DIST));
|
||||
pos = CVector2D(e->GetPosition());
|
||||
if(xmin < pos.x && pos.x < xmax &&
|
||||
ymin < pos.y && pos.y < ymax &&
|
||||
@ -2160,20 +2160,20 @@ CStreaming::DeleteRwObjectsBehindCamera(int32 mem)
|
||||
if(Abs(TheCamera.GetForward().x) > Abs(TheCamera.GetForward().y)){
|
||||
// looking west/east
|
||||
|
||||
ymin = Max(iy - 10, 0);
|
||||
ymax = Min(iy + 10, NUMSECTORS_Y);
|
||||
ymin = max(iy - 10, 0);
|
||||
ymax = min(iy + 10, NUMSECTORS_Y);
|
||||
assert(ymin <= ymax);
|
||||
|
||||
// Delete a block of sectors that we know is behind the camera
|
||||
if(TheCamera.GetForward().x > 0){
|
||||
// looking east
|
||||
xmax = Max(ix - 2, 0);
|
||||
xmin = Max(ix - 10, 0);
|
||||
xmax = max(ix - 2, 0);
|
||||
xmin = max(ix - 10, 0);
|
||||
inc = 1;
|
||||
}else{
|
||||
// looking west
|
||||
xmax = Min(ix + 2, NUMSECTORS_X);
|
||||
xmin = Min(ix + 10, NUMSECTORS_X);
|
||||
xmax = min(ix + 2, NUMSECTORS_X);
|
||||
xmin = min(ix + 10, NUMSECTORS_X);
|
||||
inc = -1;
|
||||
}
|
||||
for(y = ymin; y <= ymax; y++){
|
||||
@ -2189,13 +2189,13 @@ CStreaming::DeleteRwObjectsBehindCamera(int32 mem)
|
||||
// Now a block that intersects with the camera's frustum
|
||||
if(TheCamera.GetForward().x > 0){
|
||||
// looking east
|
||||
xmax = Max(ix + 10, 0);
|
||||
xmin = Max(ix - 2, 0);
|
||||
xmax = max(ix + 10, 0);
|
||||
xmin = max(ix - 2, 0);
|
||||
inc = 1;
|
||||
}else{
|
||||
// looking west
|
||||
xmax = Min(ix - 10, NUMSECTORS_X);
|
||||
xmin = Min(ix + 2, NUMSECTORS_X);
|
||||
xmax = min(ix - 10, NUMSECTORS_X);
|
||||
xmin = min(ix + 2, NUMSECTORS_X);
|
||||
inc = -1;
|
||||
}
|
||||
for(y = ymin; y <= ymax; y++){
|
||||
@ -2224,20 +2224,20 @@ CStreaming::DeleteRwObjectsBehindCamera(int32 mem)
|
||||
}else{
|
||||
// looking north/south
|
||||
|
||||
xmin = Max(ix - 10, 0);
|
||||
xmax = Min(ix + 10, NUMSECTORS_X);
|
||||
xmin = max(ix - 10, 0);
|
||||
xmax = min(ix + 10, NUMSECTORS_X);
|
||||
assert(xmin <= xmax);
|
||||
|
||||
// Delete a block of sectors that we know is behind the camera
|
||||
if(TheCamera.GetForward().y > 0){
|
||||
// looking north
|
||||
ymax = Max(iy - 2, 0);
|
||||
ymin = Max(iy - 10, 0);
|
||||
ymax = max(iy - 2, 0);
|
||||
ymin = max(iy - 10, 0);
|
||||
inc = 1;
|
||||
}else{
|
||||
// looking south
|
||||
ymax = Min(iy + 2, NUMSECTORS_Y);
|
||||
ymin = Min(iy + 10, NUMSECTORS_Y);
|
||||
ymax = min(iy + 2, NUMSECTORS_Y);
|
||||
ymin = min(iy + 10, NUMSECTORS_Y);
|
||||
inc = -1;
|
||||
}
|
||||
for(x = xmin; x <= xmax; x++){
|
||||
@ -2253,13 +2253,13 @@ CStreaming::DeleteRwObjectsBehindCamera(int32 mem)
|
||||
// Now a block that intersects with the camera's frustum
|
||||
if(TheCamera.GetForward().y > 0){
|
||||
// looking north
|
||||
ymax = Max(iy + 10, 0);
|
||||
ymin = Max(iy - 2, 0);
|
||||
ymax = max(iy + 10, 0);
|
||||
ymin = max(iy - 2, 0);
|
||||
inc = 1;
|
||||
}else{
|
||||
// looking south
|
||||
ymax = Min(iy - 10, NUMSECTORS_Y);
|
||||
ymin = Min(iy + 2, NUMSECTORS_Y);
|
||||
ymax = min(iy - 10, NUMSECTORS_Y);
|
||||
ymin = min(iy + 2, NUMSECTORS_Y);
|
||||
inc = -1;
|
||||
}
|
||||
for(x = xmin; x <= xmax; x++){
|
||||
|
@ -209,7 +209,7 @@ CWanted::ReportCrimeNow(eCrimeType type, const CVector &coors, bool policeDoesnt
|
||||
else
|
||||
sensitivity = m_fCrimeSensitivity;
|
||||
|
||||
wantedLevelDrop = Min(CCullZones::GetWantedLevelDrop(), 100);
|
||||
wantedLevelDrop = min(CCullZones::GetWantedLevelDrop(), 100);
|
||||
|
||||
chaos = (1.0f - wantedLevelDrop/100.0f) * sensitivity;
|
||||
if (policeDoesntCare)
|
||||
|
@ -195,8 +195,8 @@ void re3_assert(const char *expr, const char *filename, unsigned int lineno, con
|
||||
#define ARRAY_SIZE(array) (sizeof(array) / sizeof(array[0]))
|
||||
#define BIT(num) (1<<(num))
|
||||
|
||||
#define Max(a, b) (((a) > (b)) ? (a) : (b))
|
||||
#define Min(a, b) (((a) < (b)) ? (a) : (b))
|
||||
#define max(a, b) (((a) > (b)) ? (a) : (b))
|
||||
#define min(a, b) (((a) < (b)) ? (a) : (b))
|
||||
#define ABS(a) (((a) < 0) ? (-(a)) : (a))
|
||||
#define norm(value, min, max) (((value) < (min)) ? 0 : (((value) > (max)) ? 1 : (((value) - (min)) / ((max) - (min)))))
|
||||
|
||||
|
@ -453,7 +453,7 @@ DoFade(void)
|
||||
CRGBA fadeColor;
|
||||
CRect rect;
|
||||
int fadeValue = CDraw::FadeValue;
|
||||
float brightness = Min(CMenuManager::m_PrefsBrightness, 256);
|
||||
float brightness = min(CMenuManager::m_PrefsBrightness, 256);
|
||||
if(brightness <= 50)
|
||||
brightness = 50;
|
||||
if(FrontEndMenuManager.m_bMenuActive)
|
||||
|
Reference in New Issue
Block a user