summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorNikolay Korolev <nickvnuk@gmail.com>2020-04-21 10:55:39 +0200
committerNikolay Korolev <nickvnuk@gmail.com>2020-04-21 10:55:39 +0200
commit7cc3410846796a7bb0946384c7e22652f2bb60e6 (patch)
tree0b3d6d0675c44c21c83541f9f9c71e6244c6cf06 /src/core
parentMerge remote-tracking branch 'upstream/master' (diff)
parentlibrw skin pipe (diff)
downloadre3-7cc3410846796a7bb0946384c7e22652f2bb60e6.tar
re3-7cc3410846796a7bb0946384c7e22652f2bb60e6.tar.gz
re3-7cc3410846796a7bb0946384c7e22652f2bb60e6.tar.bz2
re3-7cc3410846796a7bb0946384c7e22652f2bb60e6.tar.lz
re3-7cc3410846796a7bb0946384c7e22652f2bb60e6.tar.xz
re3-7cc3410846796a7bb0946384c7e22652f2bb60e6.tar.zst
re3-7cc3410846796a7bb0946384c7e22652f2bb60e6.zip
Diffstat (limited to 'src/core')
-rw-r--r--src/core/Cam.cpp64
-rw-r--r--src/core/Camera.cpp44
-rw-r--r--src/core/Collision.cpp8
-rw-r--r--src/core/Crime.h36
-rw-r--r--src/core/Frontend.cpp18
-rw-r--r--src/core/Frontend.h2
-rw-r--r--src/core/Game.cpp2
-rw-r--r--src/core/Game.h3
-rw-r--r--src/core/General.h2
-rw-r--r--src/core/IniFile.cpp4
-rw-r--r--src/core/Pad.cpp8
-rw-r--r--src/core/PlayerInfo.cpp44
-rw-r--r--src/core/Pools.cpp2
-rw-r--r--src/core/Profile.cpp28
-rw-r--r--src/core/Stats.cpp8
-rw-r--r--src/core/Streaming.cpp42
-rw-r--r--src/core/Streaming.h1
-rw-r--r--src/core/Timer.cpp2
-rw-r--r--src/core/Wanted.cpp4
-rw-r--r--src/core/Wanted.h38
-rw-r--r--src/core/World.cpp76
-rw-r--r--src/core/ZoneCull.cpp2
-rw-r--r--src/core/common.h57
-rw-r--r--src/core/main.cpp2
-rw-r--r--src/core/patcher.cpp2
-rw-r--r--src/core/timebars.cpp4
26 files changed, 251 insertions, 252 deletions
diff --git a/src/core/Cam.cpp b/src/core/Cam.cpp
index 505f838f..e9bbb5a7 100644
--- a/src/core/Cam.cpp
+++ b/src/core/Cam.cpp
@@ -117,9 +117,9 @@ CCam::Process(void)
float FwdSpeedX = ((CVehicle*)CamTargetEntity)->GetMoveSpeed().x * Fwd.x;
float FwdSpeedY = ((CVehicle*)CamTargetEntity)->GetMoveSpeed().y * Fwd.y;
if(FwdSpeedX + FwdSpeedY > 0.0f)
- TargetSpeedVar = min(Sqrt(SQR(FwdSpeedX) + SQR(FwdSpeedY))/0.9f, 1.0f);
+ TargetSpeedVar = Min(Sqrt(SQR(FwdSpeedX) + SQR(FwdSpeedY))/0.9f, 1.0f);
else
- TargetSpeedVar = -min(Sqrt(SQR(FwdSpeedX) + SQR(FwdSpeedY))/1.8f, 0.5f);
+ TargetSpeedVar = -Min(Sqrt(SQR(FwdSpeedX) + SQR(FwdSpeedY))/1.8f, 0.5f);
SpeedVar = 0.895f*SpeedVar + 0.105*TargetSpeedVar;
}else{
CameraTarget = CamTargetEntity->GetPosition();
@@ -341,7 +341,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
@@ -467,7 +467,7 @@ CCam::ProcessSpecialHeightRoutines(void)
vehicle->IsVehicle()){
float height = vehicle->GetColModel()->boundingBox.GetSize().z;
if(FoundCar){
- HighestCar = max(HighestCar, height);
+ HighestCar = Max(HighestCar, height);
}else{
FoundCar = true;
HighestCar = height;
@@ -481,7 +481,7 @@ CCam::ProcessSpecialHeightRoutines(void)
vehicle->IsVehicle()){
float height = vehicle->GetColModel()->boundingBox.GetSize().z;
if(FoundCar){
- HighestCar = max(HighestCar, height);
+ HighestCar = Max(HighestCar, height);
}else{
FoundCar = true;
HighestCar = height;
@@ -1323,7 +1323,7 @@ CCam::Process_FollowPed(const CVector &CameraTarget, float TargetOrientation, fl
else if(ReqSpeed > 0.0f && BetaSpeed > ReqSpeed)
BetaSpeed = ReqSpeed;
- Beta += BetaSpeed * min(10.0f, CTimer::GetTimeStep());
+ Beta += BetaSpeed * Min(10.0f, CTimer::GetTimeStep());
*/
WellBufferMe(FixedTargetOrientation, &Beta, &BetaSpeed, MaxSpeed, Acceleration, true);
@@ -1398,7 +1398,7 @@ CCam::Process_FollowPed(const CVector &CameraTarget, float TargetOrientation, fl
// Process height offset to avoid peds and cars
float TargetZOffSet = m_fRoadOffSet + m_fDimensionOfHighestNearCar;
- TargetZOffSet = max(TargetZOffSet, m_fPedBetweenCameraHeightOffset);
+ TargetZOffSet = Max(TargetZOffSet, m_fPedBetweenCameraHeightOffset);
float TargetHeight = CameraTarget.z + TargetZOffSet - Source.z;
if(TargetHeight > m_fCamBufferedHeight){
@@ -1454,7 +1454,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;
@@ -1553,7 +1553,7 @@ CCam::Process_FollowPedWithMouse(const CVector &CameraTarget, float TargetOrient
#else
if(Alpha > fBaseDist) // comparing an angle against a distance?
#endif
- CamDist = fBaseDist + Cos(min(Alpha*fFalloff, HALFPI))*fAngleDist;
+ CamDist = fBaseDist + Cos(Min(Alpha*fFalloff, HALFPI))*fAngleDist;
else
CamDist = fBaseDist + Cos(Alpha)*fAngleDist;
@@ -1585,14 +1585,14 @@ CCam::Process_FollowPedWithMouse(const CVector &CameraTarget, float TargetOrient
PedColDist = (TargetCoors - colPoint.point).Magnitude();
Source = colPoint.point;
if(PedColDist < DEFAULT_NEAR + 0.3f)
- RwCameraSetNearClipPlane(Scene.camera, max(PedColDist-0.3f, 0.05f));
+ RwCameraSetNearClipPlane(Scene.camera, Max(PedColDist-0.3f, 0.05f));
}else{
- RwCameraSetNearClipPlane(Scene.camera, min(ColCamDist-0.35f, DEFAULT_NEAR));
+ RwCameraSetNearClipPlane(Scene.camera, Min(ColCamDist-0.35f, DEFAULT_NEAR));
}
}else{
Source = colPoint.point;
if(PedColDist < DEFAULT_NEAR + 0.3f)
- RwCameraSetNearClipPlane(Scene.camera, max(PedColDist-0.3f, 0.05f));
+ RwCameraSetNearClipPlane(Scene.camera, Max(PedColDist-0.3f, 0.05f));
}
}
CWorld::pIgnoreEntity = nil;
@@ -1609,7 +1609,7 @@ CCam::Process_FollowPedWithMouse(const CVector &CameraTarget, float TargetOrient
float dist = (CamToCol - Front*frontDist).Magnitude() / ViewPlaneWidth;
// Try to decrease near clip
- dist = max(min(Near, dist), 0.1f);
+ dist = Max(Min(Near, dist), 0.1f);
if(dist < Near)
RwCameraSetNearClipPlane(Scene.camera, dist);
@@ -1639,7 +1639,7 @@ CCam::Process_FollowPedWithMouse(const CVector &CameraTarget, float TargetOrient
float PlayerDist = (Source - player->GetPosition()).Magnitude();
if(PlayerDist < 2.75f)
Near = PlayerDist/2.75f * DEFAULT_NEAR - 0.3f;
- RwCameraSetNearClipPlane(Scene.camera, max(Near, 0.1f));
+ RwCameraSetNearClipPlane(Scene.camera, Max(Near, 0.1f));
}
}
@@ -1881,7 +1881,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;
@@ -2139,7 +2139,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;
@@ -2361,7 +2361,7 @@ CCam::Process_TopDownPed(const CVector &CameraTarget, float TargetOrientation, f
if(FindPlayerPed()->m_pPointGunAt){
Dist = (FindPlayerPed()->m_pPointGunAt->GetPosition() - CameraTarget).Magnitude2D();
if(Dist > 6.0f)
- HeightTarget = max(HeightTarget, Dist/22.0f*37.0f);
+ HeightTarget = Max(HeightTarget, Dist/22.0f*37.0f);
}
Source = TargetCoors + CVector(0.0f, -1.0f, 9.0f);
@@ -2826,13 +2826,13 @@ CCam::Process_1rstPersonPedOnPC(const CVector&, float TargetOrientation, float,
m_vecBufferedPlayerBodyOffset.z =
TheCamera.m_fGaitSwayBuffer * m_vecBufferedPlayerBodyOffset.z +
(1.0f-TheCamera.m_fGaitSwayBuffer) * HeadPos.z;
- HeadPos = RwV3d(CamTargetEntity->GetMatrix() * m_vecBufferedPlayerBodyOffset);
+ HeadPos = (CamTargetEntity->GetMatrix() * m_vecBufferedPlayerBodyOffset).toRwV3d();
}else{
float HeadDelta = (HeadPos - InitialHeadPos).Magnitude2D();
CVector Fwd = CamTargetEntity->GetForward();
Fwd.z = 0.0f;
Fwd.Normalise();
- HeadPos = RwV3d(HeadDelta*1.23f*Fwd + CamTargetEntity->GetPosition());
+ HeadPos = (HeadDelta*1.23f*Fwd + CamTargetEntity->GetPosition()).toRwV3d();
HeadPos.z += 0.59f;
}
Source = HeadPos;
@@ -3138,7 +3138,7 @@ CCam::Process_Syphon(const CVector &CameraTarget, float, float, float)
Front = TargetCoors - Source;
m_fMinDistAwayFromCamWhenInterPolating = Front.Magnitude2D();
if(m_fMinDistAwayFromCamWhenInterPolating < 1.1f)
- RwCameraSetNearClipPlane(Scene.camera, max(m_fMinDistAwayFromCamWhenInterPolating - 0.35f, 0.05f));
+ RwCameraSetNearClipPlane(Scene.camera, Max(m_fMinDistAwayFromCamWhenInterPolating - 0.35f, 0.05f));
Front.Normalise();
GetVectorsReadyForRW();
}
@@ -3395,7 +3395,7 @@ CCam::Process_Fight_Cam(const CVector &CameraTarget, float TargetOrientation, fl
WellBufferMe(TargetOrientation, &m_fBufferedTargetOrientation, &m_fBufferedTargetOrientationSpeed, 0.07f, 0.004f, true);
TargetCoors = CameraTarget + 0.5f*CVector(Cos(m_fBufferedTargetOrientation), Sin(m_fBufferedTargetOrientation), 0.0f);
- TargetCamHeight = CameraTarget.z - Source.z + max(m_fPedBetweenCameraHeightOffset, m_fRoadOffSet + m_fDimensionOfHighestNearCar) - 0.5f;
+ TargetCamHeight = CameraTarget.z - Source.z + Max(m_fPedBetweenCameraHeightOffset, m_fRoadOffSet + m_fDimensionOfHighestNearCar) - 0.5f;
if(TargetCamHeight > m_fCamBufferedHeight)
WellBufferMe(TargetCamHeight, &m_fCamBufferedHeight, &m_fCamBufferedHeightSpeed, 0.15f, 0.04f, false);
else
@@ -4569,14 +4569,14 @@ CCam::Process_FollowPed_Rotation(const CVector &CameraTarget, float TargetOrient
PedColDist = (TargetCoors - colPoint.point).Magnitude();
Source = colPoint.point;
if(PedColDist < DEFAULT_NEAR + 0.3f)
- RwCameraSetNearClipPlane(Scene.camera, max(PedColDist-0.3f, 0.05f));
+ RwCameraSetNearClipPlane(Scene.camera, Max(PedColDist-0.3f, 0.05f));
}else{
- RwCameraSetNearClipPlane(Scene.camera, min(ColCamDist-0.35f, DEFAULT_NEAR));
+ RwCameraSetNearClipPlane(Scene.camera, Min(ColCamDist-0.35f, DEFAULT_NEAR));
}
}else{
Source = colPoint.point;
if(PedColDist < DEFAULT_NEAR + 0.3f)
- RwCameraSetNearClipPlane(Scene.camera, max(PedColDist-0.3f, 0.05f));
+ RwCameraSetNearClipPlane(Scene.camera, Max(PedColDist-0.3f, 0.05f));
}
}
CWorld::pIgnoreEntity = nil;
@@ -4593,7 +4593,7 @@ CCam::Process_FollowPed_Rotation(const CVector &CameraTarget, float TargetOrient
float dist = (CamToCol - Front*frontDist).Magnitude() / ViewPlaneWidth;
// Try to decrease near clip
- dist = max(min(Near, dist), 0.1f);
+ dist = Max(Min(Near, dist), 0.1f);
if(dist < Near)
RwCameraSetNearClipPlane(Scene.camera, dist);
@@ -4727,7 +4727,7 @@ CCam::Process_FollowCar_SA(const CVector& CameraTarget, float TargetOrientation,
minDistForVehType = minDistForVehType * 0.65f;
}
- float nextDistance = max(newDistance, minDistForVehType);
+ float nextDistance = Max(newDistance, minDistForVehType);
CA_MAX_DISTANCE = newDistance;
CA_MIN_DISTANCE = 3.5f;
@@ -4824,7 +4824,7 @@ CCam::Process_FollowCar_SA(const CVector& CameraTarget, float TargetOrientation,
float betaChangeMult2 = (car->m_vecMoveSpeed - DotProduct(car->m_vecMoveSpeed, Front) * Front).Magnitude();
- float betaChange = min(1.0f, betaChangeMult1 * betaChangeMult2) * (velocityRightHeading - camRightHeading);
+ float betaChange = Min(1.0f, betaChangeMult1 * betaChangeMult2) * (velocityRightHeading - camRightHeading);
if (betaChange <= betaChangeLimit) {
if (betaChange < -betaChangeLimit)
betaChange = -betaChangeLimit;
@@ -4840,7 +4840,7 @@ CCam::Process_FollowCar_SA(const CVector& CameraTarget, float TargetOrientation,
float carPosChange = (TargetCoors - m_aTargetHistoryPosTwo).Magnitude();
if (carPosChange < newDistance && newDistance > minDistForThisCar) {
- newDistance = max(minDistForThisCar, carPosChange);
+ newDistance = Max(minDistForThisCar, carPosChange);
}
float maxAlphaAllowed = CARCAM_SET[camSetArrPos][13];
@@ -4864,7 +4864,7 @@ CCam::Process_FollowCar_SA(const CVector& CameraTarget, float TargetOrientation,
v200 = (1.5f - carCol->boundingBox.min.y) / Cos(v88);
} else {
float a6g = 1.2f + carCol->boundingBox.max.x;
- v200 = a6g / Cos(max(0.0f, HALFPI - v88));
+ v200 = a6g / Cos(Max(0.0f, HALFPI - v88));
}
maxAlphaAllowed = Cos(Beta - (car->GetForward().Heading() - HALFPI)) * Atan2(car->GetForward().z, car->GetForward().Magnitude2D())
+ Atan2(TargetCoors.z - car->GetPosition().z + car->GetHeightAboveRoad(), v200 * 1.2f);
@@ -4957,7 +4957,7 @@ CCam::Process_FollowCar_SA(const CVector& CameraTarget, float TargetOrientation,
yMovement = 0.0;
xMovement = 0.0;
targetAlpha = Alpha;
- stepsLeftToChangeBetaByMouse = max(0.0f, stepsLeftToChangeBetaByMouse - CTimer::GetTimeStep());
+ stepsLeftToChangeBetaByMouse = Max(0.0f, stepsLeftToChangeBetaByMouse - CTimer::GetTimeStep());
mouseChangesBeta = true;
}
}
@@ -4976,7 +4976,7 @@ CCam::Process_FollowCar_SA(const CVector& CameraTarget, float TargetOrientation,
float newAngleSpeedMaxBlendAmount = CARCAM_SET[camSetArrPos][9];
float angleChangeStep = pow(CARCAM_SET[camSetArrPos][8], CTimer::GetTimeStep());
- float targetBetaWithStickBlendAmount = betaSpeedFromStickX + (targetBeta - Beta) / max(CTimer::GetTimeStep(), 1.0f);
+ float targetBetaWithStickBlendAmount = betaSpeedFromStickX + (targetBeta - Beta) / Max(CTimer::GetTimeStep(), 1.0f);
if (targetBetaWithStickBlendAmount < -newAngleSpeedMaxBlendAmount)
targetBetaWithStickBlendAmount = -newAngleSpeedMaxBlendAmount;
@@ -5101,7 +5101,7 @@ CCam::Process_FollowCar_SA(const CVector& CameraTarget, float TargetOrientation,
if (!foundEnt->IsPed() || obstacleCamDist <= 1.0f) {
Source = foundCol.point;
if (obstacleTargetDist < 1.2f) {
- RwCameraSetNearClipPlane(Scene.camera, max(0.05f, obstacleTargetDist - 0.3f));
+ RwCameraSetNearClipPlane(Scene.camera, Max(0.05f, obstacleTargetDist - 0.3f));
}
} else {
if (!CWorld::ProcessLineOfSight(foundCol.point, Source, foundCol, foundEnt, true, dontCollideWithCars < 0.1f, false, true, false, true, false)) {
diff --git a/src/core/Camera.cpp b/src/core/Camera.cpp
index 202d481d..9a053056 100644
--- a/src/core/Camera.cpp
+++ b/src/core/Camera.cpp
@@ -485,7 +485,7 @@ CCamera::Process(void)
GetPosition().z += shakeOffset*(((shakeRand&0xF00)>>8)-7);
if(shakeOffset > 0.0f && m_BlurType != MBLUR_SNIPER)
- SetMotionBlurAlpha(min((int)(shakeStrength*255.0f) + 25, 150));
+ SetMotionBlurAlpha(Min((int)(shakeStrength*255.0f) + 25, 150));
if(Cams[ActiveCam].Mode == CCam::MODE_1STPERSON && FindPlayerVehicle() && FindPlayerVehicle()->GetUp().z < 0.2f)
SetMotionBlur(230, 230, 230, 215, MBLUR_NORMAL);
@@ -507,19 +507,19 @@ CCamera::Process(void)
CDraw::SetFOV(Cams[2].FOV);
m_vecGameCamPos = Cams[ActiveCam].Source;
- *RwMatrixGetPos(RwFrameGetMatrix(frame)) = (RwV3d)GetPosition();
- *RwMatrixGetAt(RwFrameGetMatrix(frame)) = (RwV3d)GetForward();
- *RwMatrixGetUp(RwFrameGetMatrix(frame)) = (RwV3d)GetUp();
- *RwMatrixGetRight(RwFrameGetMatrix(frame)) = (RwV3d)GetRight();
+ *RwMatrixGetPos(RwFrameGetMatrix(frame)) = GetPosition().toRwV3d();
+ *RwMatrixGetAt(RwFrameGetMatrix(frame)) = GetForward().toRwV3d();
+ *RwMatrixGetUp(RwFrameGetMatrix(frame)) = GetUp().toRwV3d();
+ *RwMatrixGetRight(RwFrameGetMatrix(frame)) = GetRight().toRwV3d();
RwMatrixUpdate(RwFrameGetMatrix(frame));
RwFrameUpdateObjects(frame);
}else{
RwFrame *frame = RwCameraGetFrame(m_pRwCamera);
m_vecGameCamPos = GetPosition();
- *RwMatrixGetPos(RwFrameGetMatrix(frame)) = (RwV3d)GetPosition();
- *RwMatrixGetAt(RwFrameGetMatrix(frame)) = (RwV3d)GetForward();
- *RwMatrixGetUp(RwFrameGetMatrix(frame)) = (RwV3d)GetUp();
- *RwMatrixGetRight(RwFrameGetMatrix(frame)) = (RwV3d)GetRight();
+ *RwMatrixGetPos(RwFrameGetMatrix(frame)) = GetPosition().toRwV3d();
+ *RwMatrixGetAt(RwFrameGetMatrix(frame)) = GetForward().toRwV3d();
+ *RwMatrixGetUp(RwFrameGetMatrix(frame)) = GetUp().toRwV3d();
+ *RwMatrixGetRight(RwFrameGetMatrix(frame)) = GetRight().toRwV3d();
RwMatrixUpdate(RwFrameGetMatrix(frame));
RwFrameUpdateObjects(frame);
}
@@ -786,27 +786,27 @@ CCamera::CamControl(void)
if(m_bUseScriptZoomValueCar){
if(CarZoomValueSmooth < m_fCarZoomValueScript){
CarZoomValueSmooth += 0.12f * CTimer::GetTimeStep();
- CarZoomValueSmooth = min(CarZoomValueSmooth, m_fCarZoomValueScript);
+ CarZoomValueSmooth = Min(CarZoomValueSmooth, m_fCarZoomValueScript);
}else{
CarZoomValueSmooth -= 0.12f * CTimer::GetTimeStep();
- CarZoomValueSmooth = max(CarZoomValueSmooth, m_fCarZoomValueScript);
+ CarZoomValueSmooth = Max(CarZoomValueSmooth, m_fCarZoomValueScript);
}
}else if(m_bFailedCullZoneTestPreviously){
CloseInCarHeightTarget = 0.65f;
if(CarZoomValueSmooth < -0.65f){
CarZoomValueSmooth += 0.12f * CTimer::GetTimeStep();
- CarZoomValueSmooth = min(CarZoomValueSmooth, -0.65f);
+ CarZoomValueSmooth = Min(CarZoomValueSmooth, -0.65f);
}else{
CarZoomValueSmooth -= 0.12f * CTimer::GetTimeStep();
- CarZoomValueSmooth = max(CarZoomValueSmooth, -0.65f);
+ CarZoomValueSmooth = Max(CarZoomValueSmooth, -0.65f);
}
}else{
if(CarZoomValueSmooth < CarZoomValue){
CarZoomValueSmooth += 0.12f * CTimer::GetTimeStep();
- CarZoomValueSmooth = min(CarZoomValueSmooth, CarZoomValue);
+ CarZoomValueSmooth = Min(CarZoomValueSmooth, CarZoomValue);
}else{
CarZoomValueSmooth -= 0.12f * CTimer::GetTimeStep();
- CarZoomValueSmooth = max(CarZoomValueSmooth, CarZoomValue);
+ CarZoomValueSmooth = Max(CarZoomValueSmooth, CarZoomValue);
}
}
@@ -890,28 +890,28 @@ CCamera::CamControl(void)
if(m_bUseScriptZoomValuePed){
if(m_fPedZoomValueSmooth < m_fPedZoomValueScript){
m_fPedZoomValueSmooth += 0.12f * CTimer::GetTimeStep();
- m_fPedZoomValueSmooth = min(m_fPedZoomValueSmooth, m_fPedZoomValueScript);
+ m_fPedZoomValueSmooth = Min(m_fPedZoomValueSmooth, m_fPedZoomValueScript);
}else{
m_fPedZoomValueSmooth -= 0.12f * CTimer::GetTimeStep();
- m_fPedZoomValueSmooth = max(m_fPedZoomValueSmooth, m_fPedZoomValueScript);
+ m_fPedZoomValueSmooth = Max(m_fPedZoomValueSmooth, m_fPedZoomValueScript);
}
}else if(m_bFailedCullZoneTestPreviously){
static float PedZoomedInVal = 0.5f;
CloseInPedHeightTarget = 0.7f;
if(m_fPedZoomValueSmooth < PedZoomedInVal){
m_fPedZoomValueSmooth += 0.12f * CTimer::GetTimeStep();
- m_fPedZoomValueSmooth = min(m_fPedZoomValueSmooth, PedZoomedInVal);
+ m_fPedZoomValueSmooth = Min(m_fPedZoomValueSmooth, PedZoomedInVal);
}else{
m_fPedZoomValueSmooth -= 0.12f * CTimer::GetTimeStep();
- m_fPedZoomValueSmooth = max(m_fPedZoomValueSmooth, PedZoomedInVal);
+ m_fPedZoomValueSmooth = Max(m_fPedZoomValueSmooth, PedZoomedInVal);
}
}else{
if(m_fPedZoomValueSmooth < m_fPedZoomValue){
m_fPedZoomValueSmooth += 0.12f * CTimer::GetTimeStep();
- m_fPedZoomValueSmooth = min(m_fPedZoomValueSmooth, m_fPedZoomValue);
+ m_fPedZoomValueSmooth = Min(m_fPedZoomValueSmooth, m_fPedZoomValue);
}else{
m_fPedZoomValueSmooth -= 0.12f * CTimer::GetTimeStep();
- m_fPedZoomValueSmooth = max(m_fPedZoomValueSmooth, m_fPedZoomValue);
+ m_fPedZoomValueSmooth = Max(m_fPedZoomValueSmooth, m_fPedZoomValue);
}
}
@@ -2274,7 +2274,7 @@ CCamera::IsItTimeForNewcam(int32 obbeMode, int32 time)
if(fwd.Magnitude() < 2.0f)
// very close, fix near clip
- SetNearClipScript(max(fwd.Magnitude()*0.5f, 0.05f));
+ SetNearClipScript(Max(fwd.Magnitude()*0.5f, 0.05f));
// too far and driving away from cam
if(fwd.Magnitude() > 19.0f && DotProduct(FindPlayerSpeed(), fwd) > 0.0f)
return true;
diff --git a/src/core/Collision.cpp b/src/core/Collision.cpp
index 5bdb32dc..7dfe3651 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/Crime.h b/src/core/Crime.h
new file mode 100644
index 00000000..8dfae5b8
--- /dev/null
+++ b/src/core/Crime.h
@@ -0,0 +1,36 @@
+#pragma once
+
+enum eCrimeType {
+ CRIME_NONE,
+ CRIME_POSSESSION_GUN,
+ CRIME_HIT_PED,
+ CRIME_HIT_COP,
+ CRIME_SHOOT_PED,
+ CRIME_SHOOT_COP,
+ CRIME_STEAL_CAR,
+ CRIME_RUN_REDLIGHT,
+ CRIME_RECKLESS_DRIVING,
+ CRIME_SPEEDING,
+ CRIME_RUNOVER_PED,
+ CRIME_RUNOVER_COP,
+ CRIME_SHOOT_HELI,
+ CRIME_PED_BURNED,
+ CRIME_COP_BURNED,
+ CRIME_VEHICLE_BURNED,
+ CRIME_DESTROYED_CESSNA,
+ NUM_CRIME_TYPES
+};
+
+class CCrimeBeingQd
+{
+public:
+ eCrimeType m_nType;
+ uint32 m_nId;
+ uint32 m_nTime;
+ CVector m_vecPosn;
+ bool m_bReported;
+ bool m_bPoliceDoesntCare;
+
+ CCrimeBeingQd() { };
+ ~CCrimeBeingQd() { };
+};
diff --git a/src/core/Frontend.cpp b/src/core/Frontend.cpp
index a8a22650..81560b76 100644
--- a/src/core/Frontend.cpp
+++ b/src/core/Frontend.cpp
@@ -349,8 +349,8 @@ CMenuManager::PageUpList(bool playSoundOnSuccess)
if(playSoundOnSuccess)
DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_DENIED, 0);
- m_nFirstVisibleRowOnList = max(0, m_nFirstVisibleRowOnList - MAX_VISIBLE_LIST_ROW);
- m_nSelectedListRow = min(m_nSelectedListRow, m_nFirstVisibleRowOnList + MAX_VISIBLE_LIST_ROW - 1);
+ m_nFirstVisibleRowOnList = Max(0, m_nFirstVisibleRowOnList - MAX_VISIBLE_LIST_ROW);
+ m_nSelectedListRow = Min(m_nSelectedListRow, m_nFirstVisibleRowOnList + MAX_VISIBLE_LIST_ROW - 1);
} else {
m_nFirstVisibleRowOnList = 0;
m_nSelectedListRow = 0;
@@ -367,8 +367,8 @@ CMenuManager::PageDownList(bool playSoundOnSuccess)
if(playSoundOnSuccess)
DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_DENIED, 0);
- m_nFirstVisibleRowOnList = min(m_nFirstVisibleRowOnList + MAX_VISIBLE_LIST_ROW, m_nTotalListRow - MAX_VISIBLE_LIST_ROW);
- m_nSelectedListRow = max(m_nSelectedListRow, m_nFirstVisibleRowOnList);
+ m_nFirstVisibleRowOnList = Min(m_nFirstVisibleRowOnList + MAX_VISIBLE_LIST_ROW, m_nTotalListRow - MAX_VISIBLE_LIST_ROW);
+ m_nSelectedListRow = Max(m_nSelectedListRow, m_nFirstVisibleRowOnList);
} else {
m_nFirstVisibleRowOnList = m_nTotalListRow - MAX_VISIBLE_LIST_ROW;
m_nSelectedListRow = m_nTotalListRow - 1;
@@ -643,7 +643,7 @@ CMenuManager::DisplaySlider(float x, float y, float mostLeftBarSize, float mostR
} else
color = CRGBA(185, 120, 0, FadeIn(255));
- maxBarHeight = max(mostLeftBarSize, mostRightBarSize);
+ maxBarHeight = Max(mostLeftBarSize, mostRightBarSize);
float curBarFreeSpace = ((16 - i) * mostLeftBarSize + i * mostRightBarSize) / 16.0f;
float left = curBarX;
@@ -2492,7 +2492,7 @@ CMenuManager::DrawPlayerSetupScreen()
strncpy(&m_pSelectedSkin->skinNameDisplayed[k], "(", 1);
if (!strncmp(&m_pSelectedSkin->skinNameDisplayed[k], "}", 1))
strncpy(&m_pSelectedSkin->skinNameDisplayed[k], ")", 1);
- if (!strncmp(&m_pSelectedSkin->skinNameDisplayed[k], "£", 1))
+ if (!strncmp(&m_pSelectedSkin->skinNameDisplayed[k], "�", 1))
strncpy(&m_pSelectedSkin->skinNameDisplayed[k], "$", 1);
}
@@ -2829,7 +2829,7 @@ CMenuManager::FadeIn(int alpha)
m_nCurrScreen == MENUPAGE_DELETING)
return alpha;
- return min(m_nMenuFadeAlpha, alpha);
+ return Min(m_nMenuFadeAlpha, alpha);
}
void
@@ -5426,7 +5426,7 @@ CMenuManager::PrintMap(void)
if (fMapCenterY + fMapSize < SCREEN_HEIGHT - MENU_Y(60.0f))
fMapCenterY = SCREEN_HEIGHT - MENU_Y(60.0f) - fMapSize;
- fMapCenterY = min(fMapCenterY, fMapSize); // To not show beyond north border
+ fMapCenterY = Min(fMapCenterY, fMapSize); // To not show beyond north border
bMenuMapActive = false;
@@ -5488,7 +5488,7 @@ CMenuManager::ConstructStatLine(int rowIdx)
int percentCompleted = (CStats::TotalProgressInGame == 0 ? 0 :
CStats::ProgressMade * 100.0f / (CGame::nastyGame ? CStats::TotalProgressInGame : CStats::TotalProgressInGame - 1));
- percentCompleted = min(percentCompleted, 100);
+ percentCompleted = Min(percentCompleted, 100);
STAT_LINE("PER_COM", &percentCompleted, false, nil);
STAT_LINE("NMISON", &CStats::MissionsGiven, false, nil);
diff --git a/src/core/Frontend.h b/src/core/Frontend.h
index 5d5199f2..ef5279aa 100644
--- a/src/core/Frontend.h
+++ b/src/core/Frontend.h
@@ -1,4 +1,4 @@
-#pragma
+#pragma once
#include "Sprite2d.h"
diff --git a/src/core/Game.cpp b/src/core/Game.cpp
index 94c775ae..6f3eee29 100644
--- a/src/core/Game.cpp
+++ b/src/core/Game.cpp
@@ -72,7 +72,7 @@
#include "Streaming.h"
#include "SurfaceTable.h"
#include "TempColModels.h"
-#include "TimeCycle.h"
+#include "Timecycle.h"
#include "TrafficLights.h"
#include "Train.h"
#include "TxdStore.h"
diff --git a/src/core/Game.h b/src/core/Game.h
index 3b8a856d..01f5f0e9 100644
--- a/src/core/Game.h
+++ b/src/core/Game.h
@@ -1,7 +1,6 @@
#pragma once
-enum eLevelName
-{
+enum eLevelName {
LEVEL_IGNORE = -1, // beware, this is only used in CPhysical's m_nZoneLevel
LEVEL_NONE = 0,
LEVEL_INDUSTRIAL,
diff --git a/src/core/General.h b/src/core/General.h
index 77828854..7ffa99de 100644
--- a/src/core/General.h
+++ b/src/core/General.h
@@ -124,7 +124,7 @@ public:
static bool faststricmp(const char *str1, const char *str2)
{
for (; *str1; str1++, str2++) {
-#if MUCH_SLOWER
+#if MUCH_SLOWER || !defined _WIN32 || defined __MINGW32__
if (toupper(*str1) != toupper(*str2))
#else
if (__ascii_toupper(*str1) != __ascii_toupper(*str2))
diff --git a/src/core/IniFile.cpp b/src/core/IniFile.cpp
index 16e35633..df01b440 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 86aff05e..8a3fc7cb 100644
--- a/src/core/Pad.cpp
+++ b/src/core/Pad.cpp
@@ -6,7 +6,7 @@
#include "common.h"
#ifdef XINPUT
-#include <Xinput.h>
+#include <xinput.h>
#pragma comment( lib, "Xinput9_1_0.lib" )
#endif
@@ -205,7 +205,7 @@ void ArmourCheat()
void WantedLevelUpCheat()
{
CHud::SetHelpMessage(TheText.Get("CHEAT5"), true);
- FindPlayerPed()->SetWantedLevel(min(FindPlayerPed()->m_pWanted->m_nWantedLevel + 2, 6));
+ FindPlayerPed()->SetWantedLevel(Min(FindPlayerPed()->m_pWanted->m_nWantedLevel + 2, 6));
}
void WantedLevelDownCheat()
@@ -513,10 +513,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/PlayerInfo.cpp b/src/core/PlayerInfo.cpp
index 69b8b7bf..e92f7568 100644
--- a/src/core/PlayerInfo.cpp
+++ b/src/core/PlayerInfo.cpp
@@ -1,35 +1,35 @@
#include "common.h"
-#include "main.h"
-#include "PlayerPed.h"
-#include "Wanted.h"
-#include "PlayerInfo.h"
+#include "Automobile.h"
+#include "Bridge.h"
+#include "Camera.h"
+#include "Cranes.h"
+#include "Darkel.h"
+#include "Explosion.h"
#include "Fire.h"
#include "Frontend.h"
-#include "PlayerSkin.h"
-#include "Darkel.h"
+#include "General.h"
+#include "HandlingMgr.h"
#include "Messages.h"
-#include "Text.h"
-#include "Stats.h"
-#include "Remote.h"
-#include "World.h"
-#include "Replay.h"
-#include "Camera.h"
#include "Pad.h"
+#include "PathFind.h"
+#include "PlayerInfo.h"
+#include "PlayerPed.h"
+#include "PlayerSkin.h"
#include "ProjectileInfo.h"
-#include "Explosion.h"
+#include "Remote.h"
+#include "Renderer.h"
+#include "Replay.h"
#include "Script.h"
-#include "Automobile.h"
-#include "HandlingMgr.h"
-#include "General.h"
#include "SpecialFX.h"
-#include "Cranes.h"
-#include "Bridge.h"
+#include "Stats.h"
+#include "Streaming.h"
+#include "Text.h"
+#include "Wanted.h"
#include "WaterLevel.h"
-#include "PathFind.h"
+#include "World.h"
#include "ZoneCull.h"
-#include "Renderer.h"
-#include "Streaming.h"
+#include "main.h"
void
CPlayerInfo::SetPlayerSkin(char *skin)
@@ -184,7 +184,7 @@ CPlayerInfo::MakePlayerSafe(bool toggle)
m_pPed->bExplosionProof = true;
m_pPed->m_bCanBeDamaged = false;
((CPlayerPed*)m_pPed)->ClearAdrenaline();
- CancelPlayerEnteringCars(false);
+ CancelPlayerEnteringCars(nil);
gFireManager.ExtinguishPoint(GetPos(), 4000.0f);
CExplosion::RemoveAllExplosionsInArea(GetPos(), 4000.0f);
CProjectileInfo::RemoveAllProjectiles();
diff --git a/src/core/Pools.cpp b/src/core/Pools.cpp
index fb64c551..4f4588da 100644
--- a/src/core/Pools.cpp
+++ b/src/core/Pools.cpp
@@ -110,7 +110,7 @@ INITSAVEBUF
CStreaming::LoadAllRequestedModels(false);
int32 slot = ReadSaveBuf<int32>(buf);
CVehicle* pVehicle;
- char* vbuf = new char[max(sizeof(CAutomobile), sizeof(CBoat))];
+ char* vbuf = new char[Max(sizeof(CAutomobile), sizeof(CBoat))];
if (type == VEHICLE_TYPE_BOAT) {
memcpy(vbuf, buf, sizeof(CBoat));
SkipSaveBuf(buf, sizeof(CBoat));
diff --git a/src/core/Profile.cpp b/src/core/Profile.cpp
index 56584d12..05d54133 100644
--- a/src/core/Profile.cpp
+++ b/src/core/Profile.cpp
@@ -52,20 +52,20 @@ void CProfile::SuspendProfile(eProfile profile)
void CProfile::ShowResults()
{
- ms_afMaxEndTime[PROFILE_FRAME_RATE] = max(ms_afMaxEndTime[PROFILE_FRAME_RATE], ms_afEndTime[PROFILE_FRAME_RATE]);
- ms_afMaxEndTime[PROFILE_PHYSICS] = max(ms_afMaxEndTime[PROFILE_PHYSICS], ms_afEndTime[PROFILE_PHYSICS]);
- ms_afMaxEndTime[PROFILE_COLLISION] = max(ms_afMaxEndTime[PROFILE_COLLISION], ms_afEndTime[PROFILE_COLLISION]);
- ms_afMaxEndTime[PROFILE_PED_AI] = max(ms_afMaxEndTime[PROFILE_PED_AI], ms_afEndTime[PROFILE_PED_AI]);
- ms_afMaxEndTime[PROFILE_PROCESSING_TIME] = max(ms_afMaxEndTime[PROFILE_PROCESSING_TIME], ms_afEndTime[PROFILE_PROCESSING_TIME]);
- ms_afMaxEndTime[PROFILE_RENDERING_TIME] = max(ms_afMaxEndTime[PROFILE_RENDERING_TIME], ms_afEndTime[PROFILE_RENDERING_TIME]);
- ms_afMaxEndTime[PROFILE_TOTAL] = max(ms_afMaxEndTime[PROFILE_TOTAL], ms_afEndTime[PROFILE_TOTAL]);
+ ms_afMaxEndTime[PROFILE_FRAME_RATE] = Max(ms_afMaxEndTime[PROFILE_FRAME_RATE], ms_afEndTime[PROFILE_FRAME_RATE]);
+ ms_afMaxEndTime[PROFILE_PHYSICS] = Max(ms_afMaxEndTime[PROFILE_PHYSICS], ms_afEndTime[PROFILE_PHYSICS]);
+ ms_afMaxEndTime[PROFILE_COLLISION] = Max(ms_afMaxEndTime[PROFILE_COLLISION], ms_afEndTime[PROFILE_COLLISION]);
+ ms_afMaxEndTime[PROFILE_PED_AI] = Max(ms_afMaxEndTime[PROFILE_PED_AI], ms_afEndTime[PROFILE_PED_AI]);
+ ms_afMaxEndTime[PROFILE_PROCESSING_TIME] = Max(ms_afMaxEndTime[PROFILE_PROCESSING_TIME], ms_afEndTime[PROFILE_PROCESSING_TIME]);
+ ms_afMaxEndTime[PROFILE_RENDERING_TIME] = Max(ms_afMaxEndTime[PROFILE_RENDERING_TIME], ms_afEndTime[PROFILE_RENDERING_TIME]);
+ ms_afMaxEndTime[PROFILE_TOTAL] = Max(ms_afMaxEndTime[PROFILE_TOTAL], ms_afEndTime[PROFILE_TOTAL]);
- ms_afMaxCumulativeTime[PROFILE_FRAME_RATE] = max(ms_afMaxCumulativeTime[PROFILE_FRAME_RATE], ms_afCumulativeTime[PROFILE_FRAME_RATE]);
- ms_afMaxCumulativeTime[PROFILE_PHYSICS] = max(ms_afMaxCumulativeTime[PROFILE_PHYSICS], ms_afCumulativeTime[PROFILE_PHYSICS]);
- ms_afMaxCumulativeTime[PROFILE_COLLISION] = max(ms_afMaxCumulativeTime[PROFILE_COLLISION], ms_afCumulativeTime[PROFILE_COLLISION]);
- ms_afMaxCumulativeTime[PROFILE_PED_AI] = max(ms_afMaxCumulativeTime[PROFILE_PED_AI], ms_afCumulativeTime[PROFILE_PED_AI]);
- ms_afMaxCumulativeTime[PROFILE_PROCESSING_TIME] = max(ms_afMaxCumulativeTime[PROFILE_PROCESSING_TIME], ms_afCumulativeTime[PROFILE_PROCESSING_TIME]);
- ms_afMaxCumulativeTime[PROFILE_RENDERING_TIME] = max(ms_afMaxCumulativeTime[PROFILE_RENDERING_TIME], ms_afCumulativeTime[PROFILE_RENDERING_TIME]);
- ms_afMaxCumulativeTime[PROFILE_TOTAL] = max(ms_afMaxCumulativeTime[PROFILE_TOTAL], ms_afCumulativeTime[PROFILE_TOTAL]);
+ ms_afMaxCumulativeTime[PROFILE_FRAME_RATE] = Max(ms_afMaxCumulativeTime[PROFILE_FRAME_RATE], ms_afCumulativeTime[PROFILE_FRAME_RATE]);
+ ms_afMaxCumulativeTime[PROFILE_PHYSICS] = Max(ms_afMaxCumulativeTime[PROFILE_PHYSICS], ms_afCumulativeTime[PROFILE_PHYSICS]);
+ ms_afMaxCumulativeTime[PROFILE_COLLISION] = Max(ms_afMaxCumulativeTime[PROFILE_COLLISION], ms_afCumulativeTime[PROFILE_COLLISION]);
+ ms_afMaxCumulativeTime[PROFILE_PED_AI] = Max(ms_afMaxCumulativeTime[PROFILE_PED_AI], ms_afCumulativeTime[PROFILE_PED_AI]);
+ ms_afMaxCumulativeTime[PROFILE_PROCESSING_TIME] = Max(ms_afMaxCumulativeTime[PROFILE_PROCESSING_TIME], ms_afCumulativeTime[PROFILE_PROCESSING_TIME]);
+ ms_afMaxCumulativeTime[PROFILE_RENDERING_TIME] = Max(ms_afMaxCumulativeTime[PROFILE_RENDERING_TIME], ms_afCumulativeTime[PROFILE_RENDERING_TIME]);
+ ms_afMaxCumulativeTime[PROFILE_TOTAL] = Max(ms_afMaxCumulativeTime[PROFILE_TOTAL], ms_afCumulativeTime[PROFILE_TOTAL]);
}
#endif \ No newline at end of file
diff --git a/src/core/Stats.cpp b/src/core/Stats.cpp
index ef3c0ab6..99274e04 100644
--- a/src/core/Stats.cpp
+++ b/src/core/Stats.cpp
@@ -121,13 +121,13 @@ void CStats::RegisterFastestTime(int32 index, int32 time)
if (FastestTimes[index] == 0)
FastestTimes[index] = time;
else
- FastestTimes[index] = min(FastestTimes[index], time);
+ FastestTimes[index] = Min(FastestTimes[index], time);
}
void CStats::RegisterHighestScore(int32 index, int32 score)
{
assert(index >= 0 && index < TOTAL_HIGHEST_SCORES);
- HighestScores[index] = max(HighestScores[index], score);
+ HighestScores[index] = Max(HighestScores[index], score);
}
void CStats::RegisterElBurroTime(int32 time)
@@ -167,7 +167,7 @@ void CStats::AnotherCriminalCaught()
void CStats::RegisterLevelAmbulanceMission(int32 level)
{
- HighestLevelAmbulanceMission = max(HighestLevelAmbulanceMission, level);
+ HighestLevelAmbulanceMission = Max(HighestLevelAmbulanceMission, level);
}
void CStats::AnotherFireExtinguished()
@@ -177,7 +177,7 @@ void CStats::AnotherFireExtinguished()
void CStats::RegisterLongestFlightInDodo(int32 time)
{
- LongestFlightInDodo = max(LongestFlightInDodo, time);
+ LongestFlightInDodo = Max(LongestFlightInDodo, time);
}
void CStats::RegisterTimeTakenDefuseMission(int32 time)
diff --git a/src/core/Streaming.cpp b/src/core/Streaming.cpp
index dae83d89..15fe60e2 100644
--- a/src/core/Streaming.cpp
+++ b/src/core/Streaming.cpp
@@ -1950,7 +1950,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 &&
@@ -2170,20 +2170,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 - 1);
+ ymin = Max(iy - 10, 0);
+ ymax = Min(iy + 10, NUMSECTORS_Y - 1);
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 - 1);
- xmin = min(ix + 10, NUMSECTORS_X - 1);
+ xmax = Min(ix + 2, NUMSECTORS_X - 1);
+ xmin = Min(ix + 10, NUMSECTORS_X - 1);
inc = -1;
}
for(y = ymin; y <= ymax; y++){
@@ -2199,13 +2199,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 - 1);
- xmin = min(ix + 2, NUMSECTORS_X - 1);
+ xmax = Min(ix - 10, NUMSECTORS_X - 1);
+ xmin = Min(ix + 2, NUMSECTORS_X - 1);
inc = -1;
}
for(y = ymin; y <= ymax; y++){
@@ -2234,20 +2234,20 @@ CStreaming::DeleteRwObjectsBehindCamera(int32 mem)
}else{
// looking north/south
- xmin = max(ix - 10, 0);
- xmax = min(ix + 10, NUMSECTORS_X - 1);
+ xmin = Max(ix - 10, 0);
+ xmax = Min(ix + 10, NUMSECTORS_X - 1);
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 - 1);
- ymin = min(iy + 10, NUMSECTORS_Y - 1);
+ ymax = Min(iy + 2, NUMSECTORS_Y - 1);
+ ymin = Min(iy + 10, NUMSECTORS_Y - 1);
inc = -1;
}
for(x = xmin; x <= xmax; x++){
@@ -2263,13 +2263,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 - 1);
- ymin = min(iy + 2, NUMSECTORS_Y - 1);
+ ymax = Min(iy - 10, NUMSECTORS_Y - 1);
+ ymin = Min(iy + 2, NUMSECTORS_Y - 1);
inc = -1;
}
for(x = xmin; x <= xmax; x++){
diff --git a/src/core/Streaming.h b/src/core/Streaming.h
index c910c068..cf8790e9 100644
--- a/src/core/Streaming.h
+++ b/src/core/Streaming.h
@@ -71,7 +71,6 @@ struct CStreamingChannel
};
class CDirectory;
-enum eLevelName;
class CPtrList;
class CStreaming
diff --git a/src/core/Timer.cpp b/src/core/Timer.cpp
index ebd79695..8f8570d7 100644
--- a/src/core/Timer.cpp
+++ b/src/core/Timer.cpp
@@ -138,7 +138,7 @@ void CTimer::Update(void)
if ( !CRecordDataForGame::IsPlayingBack() )
{
- ms_fTimeStep = min(3.0f, ms_fTimeStep);
+ ms_fTimeStep = Min(3.0f, ms_fTimeStep);
if ( (m_snTimeInMilliseconds - m_snPreviousTimeInMilliseconds) > 60 )
m_snTimeInMilliseconds = m_snPreviousTimeInMilliseconds + 60;
diff --git a/src/core/Wanted.cpp b/src/core/Wanted.cpp
index ce7d217e..6f5fdf06 100644
--- a/src/core/Wanted.cpp
+++ b/src/core/Wanted.cpp
@@ -212,7 +212,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)
@@ -371,7 +371,7 @@ CWanted::Update(void)
CVector playerPos = FindPlayerCoors();
if (WorkOutPolicePresence(playerPos, radius) == 0) {
m_nLastUpdateTime = CTimer::GetTimeInMilliseconds();
- m_nChaos = max(0, m_nChaos - 1);
+ m_nChaos = Max(0, m_nChaos - 1);
UpdateWantedLevel();
}
}
diff --git a/src/core/Wanted.h b/src/core/Wanted.h
index afeec8b0..e3e407b0 100644
--- a/src/core/Wanted.h
+++ b/src/core/Wanted.h
@@ -1,44 +1,10 @@
#pragma once
+#include "Crime.h"
+
class CEntity;
class CCopPed;
-enum eCrimeType
-{
- CRIME_NONE,
- CRIME_POSSESSION_GUN,
- CRIME_HIT_PED,
- CRIME_HIT_COP,
- CRIME_SHOOT_PED,
- CRIME_SHOOT_COP,
- CRIME_STEAL_CAR,
- CRIME_RUN_REDLIGHT,
- CRIME_RECKLESS_DRIVING,
- CRIME_SPEEDING,
- CRIME_RUNOVER_PED,
- CRIME_RUNOVER_COP,
- CRIME_SHOOT_HELI,
- CRIME_PED_BURNED,
- CRIME_COP_BURNED,
- CRIME_VEHICLE_BURNED,
- CRIME_DESTROYED_CESSNA,
- NUM_CRIME_TYPES
-};
-
-class CCrimeBeingQd
-{
-public:
- eCrimeType m_nType;
- uint32 m_nId;
- uint32 m_nTime;
- CVector m_vecPosn;
- bool m_bReported;
- bool m_bPoliceDoesntCare;
-
- CCrimeBeingQd() { };
- ~CCrimeBeingQd() { };
-};
-
class CWanted
{
public:
diff --git a/src/core/World.cpp b/src/core/World.cpp
index 7ef43593..404b92c0 100644
--- a/src/core/World.cpp
+++ b/src/core/World.cpp
@@ -777,10 +777,10 @@ CWorld::FindObjectsOfTypeInRange(uint32 modelId, const CVector &position, float
*nEntitiesFound = 0;
const CVector2D vecSectorStartPos(position.x - radius, position.y - radius);
const CVector2D vecSectorEndPos(position.x + radius, position.y + radius);
- const int32 nStartX = max(CWorld::GetSectorIndexX(vecSectorStartPos.x), 0);
- const int32 nStartY = max(CWorld::GetSectorIndexY(vecSectorStartPos.y), 0);
- const int32 nEndX = min(CWorld::GetSectorIndexX(vecSectorEndPos.x), NUMSECTORS_X - 1);
- const int32 nEndY = min(CWorld::GetSectorIndexY(vecSectorEndPos.y), NUMSECTORS_Y - 1);
+ const int32 nStartX = Max(CWorld::GetSectorIndexX(vecSectorStartPos.x), 0);
+ const int32 nStartY = Max(CWorld::GetSectorIndexY(vecSectorStartPos.y), 0);
+ const int32 nEndX = Min(CWorld::GetSectorIndexX(vecSectorEndPos.x), NUMSECTORS_X - 1);
+ const int32 nEndY = Min(CWorld::GetSectorIndexY(vecSectorEndPos.y), NUMSECTORS_Y - 1);
for(int32 y = nStartY; y <= nEndY; y++) {
for(int32 x = nStartX; x <= nEndX; x++) {
CSector *pSector = CWorld::GetSector(x, y);
@@ -1045,10 +1045,10 @@ CWorld::FindObjectsKindaColliding(const CVector &position, float radius, bool bC
*nCollidingEntities = 0;
const CVector2D vecSectorStartPos(position.x - radius, position.y - radius);
const CVector2D vecSectorEndPos(position.x + radius, position.y + radius);
- const int32 nStartX = max(CWorld::GetSectorIndexX(vecSectorStartPos.x), 0);
- const int32 nStartY = max(CWorld::GetSectorIndexY(vecSectorStartPos.y), 0);
- const int32 nEndX = min(CWorld::GetSectorIndexX(vecSectorEndPos.x), NUMSECTORS_X - 1);
- const int32 nEndY = min(CWorld::GetSectorIndexY(vecSectorEndPos.y), NUMSECTORS_Y - 1);
+ const int32 nStartX = Max(CWorld::GetSectorIndexX(vecSectorStartPos.x), 0);
+ const int32 nStartY = Max(CWorld::GetSectorIndexY(vecSectorStartPos.y), 0);
+ const int32 nEndX = Min(CWorld::GetSectorIndexX(vecSectorEndPos.x), NUMSECTORS_X - 1);
+ const int32 nEndY = Min(CWorld::GetSectorIndexY(vecSectorEndPos.y), NUMSECTORS_Y - 1);
for(int32 y = nStartY; y <= nEndY; y++) {
for(int32 x = nStartX; x <= nEndX; x++) {
CSector *pSector = CWorld::GetSector(x, y);
@@ -1124,10 +1124,10 @@ CWorld::FindObjectsIntersectingCube(const CVector &vecStartPos, const CVector &v
{
CWorld::AdvanceCurrentScanCode();
*nIntersecting = 0;
- const int32 nStartX = max(CWorld::GetSectorIndexX(vecStartPos.x), 0);
- const int32 nStartY = max(CWorld::GetSectorIndexY(vecStartPos.y), 0);
- const int32 nEndX = min(CWorld::GetSectorIndexX(vecEndPos.x), NUMSECTORS_X - 1);
- const int32 nEndY = min(CWorld::GetSectorIndexY(vecEndPos.y), NUMSECTORS_Y - 1);
+ const int32 nStartX = Max(CWorld::GetSectorIndexX(vecStartPos.x), 0);
+ const int32 nStartY = Max(CWorld::GetSectorIndexY(vecStartPos.y), 0);
+ const int32 nEndX = Min(CWorld::GetSectorIndexX(vecEndPos.x), NUMSECTORS_X - 1);
+ const int32 nEndY = Min(CWorld::GetSectorIndexY(vecEndPos.y), NUMSECTORS_Y - 1);
for(int32 y = nStartY; y <= nEndY; y++) {
for(int32 x = nStartX; x <= nEndX; x++) {
CSector *pSector = CWorld::GetSector(x, y);
@@ -1205,10 +1205,10 @@ CWorld::FindObjectsIntersectingAngledCollisionBox(const CColBox &boundingBox, co
{
CWorld::AdvanceCurrentScanCode();
*nEntitiesFound = 0;
- const int32 nStartX = max(CWorld::GetSectorIndexX(fStartX), 0);
- const int32 nStartY = max(CWorld::GetSectorIndexY(fStartY), 0);
- const int32 nEndX = min(CWorld::GetSectorIndexX(fEndX), NUMSECTORS_X - 1);
- const int32 nEndY = min(CWorld::GetSectorIndexY(fEndY), NUMSECTORS_Y - 1);
+ const int32 nStartX = Max(CWorld::GetSectorIndexX(fStartX), 0);
+ const int32 nStartY = Max(CWorld::GetSectorIndexY(fStartY), 0);
+ const int32 nEndX = Min(CWorld::GetSectorIndexX(fEndX), NUMSECTORS_X - 1);
+ const int32 nEndY = Min(CWorld::GetSectorIndexY(fEndY), NUMSECTORS_Y - 1);
for(int32 y = nStartY; y <= nEndY; y++) {
for(int32 x = nStartX; x <= nEndX; x++) {
CSector *pSector = CWorld::GetSector(x, y);
@@ -1285,10 +1285,10 @@ CWorld::FindMissionEntitiesIntersectingCube(const CVector &vecStartPos, const CV
{
CWorld::AdvanceCurrentScanCode();
*nIntersecting = 0;
- const int32 nStartX = max(CWorld::GetSectorIndexX(vecStartPos.x), 0);
- const int32 nStartY = max(CWorld::GetSectorIndexY(vecStartPos.y), 0);
- const int32 nEndX = min(CWorld::GetSectorIndexX(vecEndPos.x), NUMSECTORS_X - 1);
- const int32 nEndY = min(CWorld::GetSectorIndexY(vecEndPos.y), NUMSECTORS_Y - 1);
+ const int32 nStartX = Max(CWorld::GetSectorIndexX(vecStartPos.x), 0);
+ const int32 nStartY = Max(CWorld::GetSectorIndexY(vecStartPos.y), 0);
+ const int32 nEndX = Min(CWorld::GetSectorIndexX(vecEndPos.x), NUMSECTORS_X - 1);
+ const int32 nEndY = Min(CWorld::GetSectorIndexY(vecEndPos.y), NUMSECTORS_Y - 1);
for(int32 y = nStartY; y <= nEndY; y++) {
for(int32 x = nStartX; x <= nEndX; x++) {
CSector *pSector = CWorld::GetSector(x, y);
@@ -1499,10 +1499,10 @@ CWorld::CallOffChaseForArea(float x1, float y1, float x2, float y2)
float fStartY = y1 - 10.0f;
float fEndX = x2 + 10.0f;
float fEndY = y2 + 10.0f;
- const int32 nStartX = max(CWorld::GetSectorIndexX(fStartX), 0);
- const int32 nStartY = max(CWorld::GetSectorIndexY(fStartY), 0);
- const int32 nEndX = min(CWorld::GetSectorIndexX(fEndX), NUMSECTORS_X - 1);
- const int32 nEndY = min(CWorld::GetSectorIndexY(fEndY), NUMSECTORS_Y - 1);
+ const int32 nStartX = Max(CWorld::GetSectorIndexX(fStartX), 0);
+ const int32 nStartY = Max(CWorld::GetSectorIndexY(fStartY), 0);
+ const int32 nEndX = Min(CWorld::GetSectorIndexX(fEndX), NUMSECTORS_X - 1);
+ const int32 nEndY = Min(CWorld::GetSectorIndexY(fEndY), NUMSECTORS_Y - 1);
for(int32 y = nStartY; y <= nEndY; y++) {
for(int32 x = nStartX; x <= nEndX; x++) {
CSector *pSector = CWorld::GetSector(x, y);
@@ -1544,13 +1544,13 @@ CWorld::CallOffChaseForAreaSectorListVehicles(CPtrList &list, float x1, float y1
}
if(bInsideSphere) {
if(pVehicle->GetPosition().x <= (x1 + x2) * 0.5f)
- pVehicle->m_vecMoveSpeed.x = min(pVehicle->m_vecMoveSpeed.x, 0.0f);
+ pVehicle->m_vecMoveSpeed.x = Min(pVehicle->m_vecMoveSpeed.x, 0.0f);
else
- pVehicle->m_vecMoveSpeed.x = max(pVehicle->m_vecMoveSpeed.x, 0.0f);
+ pVehicle->m_vecMoveSpeed.x = Max(pVehicle->m_vecMoveSpeed.x, 0.0f);
if(pVehicle->GetPosition().y <= (y1 + y2) * 0.5f)
- pVehicle->m_vecMoveSpeed.y = min(pVehicle->m_vecMoveSpeed.y, 0.0f);
+ pVehicle->m_vecMoveSpeed.y = Min(pVehicle->m_vecMoveSpeed.y, 0.0f);
else
- pVehicle->m_vecMoveSpeed.y = max(pVehicle->m_vecMoveSpeed.y, 0.0f);
+ pVehicle->m_vecMoveSpeed.y = Max(pVehicle->m_vecMoveSpeed.y, 0.0f);
}
}
}
@@ -2086,10 +2086,10 @@ CWorld::TriggerExplosion(const CVector &position, float fRadius, float fPower, C
{
CVector2D vecStartPos(position.x - fRadius, position.y - fRadius);
CVector2D vecEndPos(position.x + fRadius, position.y + fRadius);
- const int32 nStartX = max(CWorld::GetSectorIndexX(vecStartPos.x), 0);
- const int32 nStartY = max(CWorld::GetSectorIndexY(vecStartPos.y), 0);
- const int32 nEndX = min(CWorld::GetSectorIndexX(vecEndPos.x), NUMSECTORS_X - 1);
- const int32 nEndY = min(CWorld::GetSectorIndexY(vecEndPos.y), NUMSECTORS_Y - 1);
+ const int32 nStartX = Max(CWorld::GetSectorIndexX(vecStartPos.x), 0);
+ const int32 nStartY = Max(CWorld::GetSectorIndexY(vecStartPos.y), 0);
+ const int32 nEndX = Min(CWorld::GetSectorIndexX(vecEndPos.x), NUMSECTORS_X - 1);
+ const int32 nEndY = Min(CWorld::GetSectorIndexY(vecEndPos.y), NUMSECTORS_Y - 1);
for(int32 y = nStartY; y <= nEndY; y++) {
for(int32 x = nStartX; x <= nEndX; x++) {
CSector *pSector = CWorld::GetSector(x, y);
@@ -2144,7 +2144,7 @@ CWorld::TriggerExplosionSectorList(CPtrList &list, const CVector &position, floa
if(pEntity->bIsStatic) {
float fDamageMultiplier =
(fRadius - fMagnitude) * 2.0f / fRadius;
- float fDamage = 300.0f * min(fDamageMultiplier, 1.0f);
+ float fDamage = 300.0f * Min(fDamageMultiplier, 1.0f);
pObject->ObjectDamage(fDamage);
}
} else {
@@ -2153,18 +2153,18 @@ CWorld::TriggerExplosionSectorList(CPtrList &list, const CVector &position, floa
}
}
if(!pEntity->bIsStatic) {
- float fDamageMultiplier = min((fRadius - fMagnitude) * 2.0f / fRadius, 1.0f);
+ float fDamageMultiplier = Min((fRadius - fMagnitude) * 2.0f / fRadius, 1.0f);
CVector vecForceDir =
vecDistance * (fPower * pEntity->m_fMass * 0.00071429f * fDamageMultiplier /
- max(fMagnitude, 0.01f));
- vecForceDir.z = max(vecForceDir.z, 0.0f);
- if(pEntity == FindPlayerPed()) vecForceDir.z = min(vecForceDir.z, 1.0f);
+ Max(fMagnitude, 0.01f));
+ vecForceDir.z = Max(vecForceDir.z, 0.0f);
+ if(pEntity == FindPlayerPed()) vecForceDir.z = Min(vecForceDir.z, 1.0f);
pEntity->ApplyMoveForce(vecForceDir);
if(!pEntity->bPedPhysics) {
float fBoundRadius = pEntity->GetBoundRadius();
float fDistanceZ = position.z - pEntity->GetPosition().z;
float fPointZ = fBoundRadius;
- if(max(fDistanceZ, -fBoundRadius) < fBoundRadius) {
+ if(Max(fDistanceZ, -fBoundRadius) < fBoundRadius) {
if(fDistanceZ <= -fBoundRadius)
fPointZ = -fBoundRadius;
else
diff --git a/src/core/ZoneCull.cpp b/src/core/ZoneCull.cpp
index d17a33d4..7a221f39 100644
--- a/src/core/ZoneCull.cpp
+++ b/src/core/ZoneCull.cpp
@@ -289,7 +289,7 @@ CCullZones::FindAttributesForCoors(CVector coors, int32 *wantedLevel)
coors.z >= aAttributeZones[i].minz && coors.z <= aAttributeZones[i].maxz){
attribs |= aAttributeZones[i].attributes;
if(wantedLevel)
- *wantedLevel = max(*wantedLevel, aAttributeZones[i].wantedLevel);
+ *wantedLevel = Max(*wantedLevel, aAttributeZones[i].wantedLevel);
}
return attribs;
}
diff --git a/src/core/common.h b/src/core/common.h
index 454b848a..46b4d03a 100644
--- a/src/core/common.h
+++ b/src/core/common.h
@@ -12,7 +12,7 @@
#include <math.h>
#ifdef WITHWINDOWS
-#include <Windows.h>
+#include <windows.h>
#endif
#ifdef WITHD3D
@@ -42,12 +42,8 @@
#undef near
#endif
-#ifndef max
-#define max(a,b) ((a) > (b) ? (a) : (b))
-#endif
-#ifndef min
-#define min(a,b) ((a) < (b) ? (a) : (b))
-#endif
+#define Max(a,b) ((a) > (b) ? (a) : (b))
+#define Min(a,b) ((a) < (b) ? (a) : (b))
typedef uint8_t uint8;
typedef int8_t int8;
@@ -62,7 +58,7 @@ typedef int64_t int64;
typedef uint16_t wchar;
#ifndef nil
-#define nil nullptr
+#define nil NULL
#endif
#include "config.h"
@@ -276,7 +272,7 @@ class CTweakFunc : public CTweakVar
void (*m_pFunc)();
public:
CTweakFunc(void (*pFunc)(), const char *strName, const char *strPath) :
- m_pFunc(pFunc), m_pVarName(strName), m_pPath(strPath)
+ m_pPath(strPath), m_pVarName(strName), m_pFunc(pFunc)
{
CTweakVars::Add(this);
}
@@ -290,7 +286,7 @@ class CTweakBool : public CTweakVar
bool *m_pBoolVar;
public:
CTweakBool(bool *pBool, const char *strName, const char *strPath) :
- m_pBoolVar(pBool), m_pVarName(strName), m_pPath(strPath)
+ m_pPath(strPath), m_pVarName(strName), m_pBoolVar(pBool)
{
CTweakVars::Add(this);
}
@@ -306,9 +302,10 @@ class CTweakSwitch : public CTweakVar
const char **m_aStr;
void (*m_pFunc)();
public:
- CTweakSwitch(void *pInt, const char *strName, int32 nMin, int32 nMax, const char **aStr, void (*pFunc)(), const char *strPath) :
- m_pVarName(strName), m_pPath(strPath),
- m_aStr(aStr), m_pIntVar(pInt), m_nMin(nMin), m_nMax(nMax)
+ CTweakSwitch(void *pInt, const char *strName, int32 nMin, int32 nMax, const char **aStr,
+ void (*pFunc)(), const char *strPath)
+ : m_pPath(strPath), m_pVarName(strName), m_pIntVar(pInt), m_nMin(nMin), m_nMax(nMax),
+ m_aStr(aStr)
{
CTweakVars::Add(this);
}
@@ -316,22 +313,24 @@ public:
void AddDBG(const char *path);
};
-#define _TWEEKCLASS(name, type) \
-class name : public CTweakVar \
-{ \
-public: \
- const char *m_pPath, *m_pVarName; \
- type *m_pIntVar, m_nLoawerBound, m_nUpperBound, m_nStep; \
- \
- name(type *pInt, const char *strName, type nLower, type nUpper, type nStep, const char *strPath) : \
- m_pIntVar(pInt), m_nLoawerBound(nLower), m_nUpperBound(nUpper), m_nStep(nStep), \
- m_pVarName(strName), m_pPath(strPath) \
- { \
- CTweakVars::Add(this); \
- } \
- \
- void AddDBG(const char *path); \
-};
+#define _TWEEKCLASS(name, type) \
+ class name : public CTweakVar \
+ { \
+ public: \
+ const char *m_pPath, *m_pVarName; \
+ type *m_pIntVar, m_nLoawerBound, m_nUpperBound, m_nStep; \
+ \
+ name(type *pInt, const char *strName, type nLower, type nUpper, type nStep, \
+ const char *strPath) \
+ : m_pPath(strPath), m_pVarName(strName), m_pIntVar(pInt), \
+ m_nLoawerBound(nLower), m_nUpperBound(nUpper), m_nStep(nStep) \
+ \
+ { \
+ CTweakVars::Add(this); \
+ } \
+ \
+ void AddDBG(const char *path); \
+ };
_TWEEKCLASS(CTweakInt8, int8);
_TWEEKCLASS(CTweakUInt8, uint8);
diff --git a/src/core/main.cpp b/src/core/main.cpp
index d5d4065d..77daaa01 100644
--- a/src/core/main.cpp
+++ b/src/core/main.cpp
@@ -205,7 +205,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)
diff --git a/src/core/patcher.cpp b/src/core/patcher.cpp
index 19ca5f07..58f19767 100644
--- a/src/core/patcher.cpp
+++ b/src/core/patcher.cpp
@@ -4,7 +4,7 @@
#include <algorithm>
#include <vector>
-#include <Windows.h>
+#include <windows.h>
StaticPatcher *StaticPatcher::ms_head;
diff --git a/src/core/timebars.cpp b/src/core/timebars.cpp
index 5c2dbe3a..6b841a5c 100644
--- a/src/core/timebars.cpp
+++ b/src/core/timebars.cpp
@@ -102,14 +102,14 @@ void tbDisplay()
#ifndef FINAL
// Timers output (my own implementation)
for (uint32 i = 0; i < TimerBar.count; i++) {
- MaxTimes[i] = max(MaxTimes[i], TimerBar.Timers[i].endTime - TimerBar.Timers[i].startTime);
+ MaxTimes[i] = Max(MaxTimes[i], TimerBar.Timers[i].endTime - TimerBar.Timers[i].startTime);
sprintf(temp, "%s: %.2f", &TimerBar.Timers[i].name[0], MaxTimes[i]);
AsciiToUnicode(temp, wtemp);
CFont::PrintString(RsGlobal.maximumWidth * (4.0f / DEFAULT_SCREEN_WIDTH), RsGlobal.maximumHeight * ((8.0f * (i + 2)) / DEFAULT_SCREEN_HEIGHT), wtemp);
}
#ifdef FRAMETIME
- MaxFrameTime = max(MaxFrameTime, FrameEndTime - FrameInitTime);
+ MaxFrameTime = Max(MaxFrameTime, FrameEndTime - FrameInitTime);
sprintf(temp, "Frame Time: %.2f", MaxFrameTime);
AsciiToUnicode(temp, wtemp);