diff options
author | Filip Gawin <filip.gawin@zoho.com> | 2019-08-27 20:50:59 +0200 |
---|---|---|
committer | Filip Gawin <filip.gawin@zoho.com> | 2019-08-27 22:29:23 +0200 |
commit | 01ac2929cd723b579454788ffbe9579d1863d240 (patch) | |
tree | 84f9f7df642f09a32adb1fa779ffeeb15fa2c206 /src/core | |
parent | More more more audio (diff) | |
download | re3-01ac2929cd723b579454788ffbe9579d1863d240.tar re3-01ac2929cd723b579454788ffbe9579d1863d240.tar.gz re3-01ac2929cd723b579454788ffbe9579d1863d240.tar.bz2 re3-01ac2929cd723b579454788ffbe9579d1863d240.tar.lz re3-01ac2929cd723b579454788ffbe9579d1863d240.tar.xz re3-01ac2929cd723b579454788ffbe9579d1863d240.tar.zst re3-01ac2929cd723b579454788ffbe9579d1863d240.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/Camera.cpp | 10 | ||||
-rw-r--r-- | src/core/Collision.cpp | 8 | ||||
-rw-r--r-- | src/core/Frontend.cpp | 2 | ||||
-rw-r--r-- | src/core/IniFile.cpp | 4 | ||||
-rw-r--r-- | src/core/Pad.cpp | 4 | ||||
-rw-r--r-- | src/core/Streaming.cpp | 42 | ||||
-rw-r--r-- | src/core/Wanted.cpp | 2 | ||||
-rw-r--r-- | src/core/common.h | 4 | ||||
-rw-r--r-- | src/core/main.cpp | 2 |
9 files changed, 39 insertions, 39 deletions
diff --git a/src/core/Camera.cpp b/src/core/Camera.cpp index f15232f3..cb16c3ad 100644 --- a/src/core/Camera.cpp +++ b/src/core/Camera.cpp @@ -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; diff --git a/src/core/Collision.cpp b/src/core/Collision.cpp index 538bcae6..66b29d9f 100644 --- a/src/core/Collision.cpp +++ b/src/core/Collision.cpp @@ -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++){ diff --git a/src/core/Frontend.cpp b/src/core/Frontend.cpp index f4545f7b..effcb0b4 100644 --- a/src/core/Frontend.cpp +++ b/src/core/Frontend.cpp @@ -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 diff --git a/src/core/IniFile.cpp b/src/core/IniFile.cpp index 46dceff3..08b30876 100644 --- a/src/core/IniFile.cpp +++ b/src/core/IniFile.cpp @@ -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; diff --git a/src/core/Pad.cpp b/src/core/Pad.cpp index b5086d64..f334a255 100644 --- a/src/core/Pad.cpp +++ b/src/core/Pad.cpp @@ -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); } diff --git a/src/core/Streaming.cpp b/src/core/Streaming.cpp index 8158cd1d..a7bde91e 100644 --- a/src/core/Streaming.cpp +++ b/src/core/Streaming.cpp @@ -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++){ diff --git a/src/core/Wanted.cpp b/src/core/Wanted.cpp index daed9155..26b115e3 100644 --- a/src/core/Wanted.cpp +++ b/src/core/Wanted.cpp @@ -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) diff --git a/src/core/common.h b/src/core/common.h index d1f71720..b3a271c6 100644 --- a/src/core/common.h +++ b/src/core/common.h @@ -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))))) diff --git a/src/core/main.cpp b/src/core/main.cpp index a82a2ab8..50494ef3 100644 --- a/src/core/main.cpp +++ b/src/core/main.cpp @@ -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) |