summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorNikolay Korolev <nickvnuk@gmail.com>2020-03-22 17:47:14 +0100
committerNikolay Korolev <nickvnuk@gmail.com>2020-03-22 17:47:14 +0100
commit861506d048b7c4370f066e62233448979824bd68 (patch)
treecaa435843c73aab13174a3b63bfb6dd759a9df73 /src/core
parentmissing endlines (diff)
parentRemove all constexpr (diff)
downloadre3-861506d048b7c4370f066e62233448979824bd68.tar
re3-861506d048b7c4370f066e62233448979824bd68.tar.gz
re3-861506d048b7c4370f066e62233448979824bd68.tar.bz2
re3-861506d048b7c4370f066e62233448979824bd68.tar.lz
re3-861506d048b7c4370f066e62233448979824bd68.tar.xz
re3-861506d048b7c4370f066e62233448979824bd68.tar.zst
re3-861506d048b7c4370f066e62233448979824bd68.zip
Diffstat (limited to 'src/core')
-rw-r--r--src/core/Camera.cpp134
-rw-r--r--src/core/Fire.h2
-rw-r--r--src/core/Timer.cpp2
-rw-r--r--src/core/common.h1
-rw-r--r--src/core/config.h23
-rw-r--r--src/core/main.cpp2
6 files changed, 87 insertions, 77 deletions
diff --git a/src/core/Camera.cpp b/src/core/Camera.cpp
index 88c87c95..75e52c5f 100644
--- a/src/core/Camera.cpp
+++ b/src/core/Camera.cpp
@@ -416,19 +416,19 @@ CCam::Process_FollowPed(const CVector &CameraTarget, float TargetOrientation, fl
// BUG? is this ever used?
// The values seem to be roughly m_fPedZoomValueSmooth + 1.85
if(ResetStatics){
- if(TheCamera.PedZoomIndicator == 1.0) m_fRealGroundDist = 2.090556f;
- if(TheCamera.PedZoomIndicator == 2.0) m_fRealGroundDist = 3.34973f;
- if(TheCamera.PedZoomIndicator == 3.0) m_fRealGroundDist = 4.704914f;
- if(TheCamera.PedZoomIndicator == 4.0) m_fRealGroundDist = 2.090556f;
+ if(TheCamera.PedZoomIndicator == 1.0f) m_fRealGroundDist = 2.090556f;
+ if(TheCamera.PedZoomIndicator == 2.0f) m_fRealGroundDist = 3.34973f;
+ if(TheCamera.PedZoomIndicator == 3.0f) m_fRealGroundDist = 4.704914f;
+ if(TheCamera.PedZoomIndicator == 4.0f) m_fRealGroundDist = 2.090556f;
}
// And what is this? It's only used for collision and rotation it seems
float RealGroundDist;
- if(TheCamera.PedZoomIndicator == 1.0) RealGroundDist = 2.090556f;
- if(TheCamera.PedZoomIndicator == 2.0) RealGroundDist = 3.34973f;
- if(TheCamera.PedZoomIndicator == 3.0) RealGroundDist = 4.704914f;
- if(TheCamera.PedZoomIndicator == 4.0) RealGroundDist = 2.090556f;
+ if(TheCamera.PedZoomIndicator == 1.0f) RealGroundDist = 2.090556f;
+ if(TheCamera.PedZoomIndicator == 2.0f) RealGroundDist = 3.34973f;
+ if(TheCamera.PedZoomIndicator == 3.0f) RealGroundDist = 4.704914f;
+ if(TheCamera.PedZoomIndicator == 4.0f) RealGroundDist = 2.090556f;
if(m_fCloseInPedHeightOffset > 0.00001f)
- RealGroundDist = 1.7016;
+ RealGroundDist = 1.7016f;
bool Shooting = false;
@@ -1344,30 +1344,30 @@ CCamera::SetCamCutSceneOffSet(const CVector &pos)
void
CCamera::TakeControlWithSpline(short nSwitch)
{
- m_iModeToGoTo = CCam::MODE_FLYBY;
- m_bLookingAtPlayer = false;
- m_bLookingAtVector = false;
- m_bcutsceneFinished = false;
- m_iTypeOfSwitch = nSwitch;
- m_bStartInterScript = true;
-
+ m_iModeToGoTo = CCam::MODE_FLYBY;
+ m_bLookingAtPlayer = false;
+ m_bLookingAtVector = false;
+ m_bcutsceneFinished = false;
+ m_iTypeOfSwitch = nSwitch;
+ m_bStartInterScript = true;
+
//FindPlayerPed(); // unused
};
-void CCamera::SetCameraDirectlyInFrontForFollowPed_CamOnAString()
-{
- m_bCamDirectlyInFront = true;
- CPlayerPed *player = FindPlayerPed();
- if (player)
- m_PedOrientForBehindOrInFront = CGeneral::GetATanOfXY(player->GetForward().x, player->GetForward().y);
+void CCamera::SetCameraDirectlyInFrontForFollowPed_CamOnAString()
+{
+ m_bCamDirectlyInFront = true;
+ CPlayerPed *player = FindPlayerPed();
+ if (player)
+ m_PedOrientForBehindOrInFront = CGeneral::GetATanOfXY(player->GetForward().x, player->GetForward().y);
}
-void CCamera::SetCameraDirectlyBehindForFollowPed_CamOnAString()
-{
- m_bCamDirectlyBehind = true;
- CPlayerPed *player = FindPlayerPed();
- if (player)
- m_PedOrientForBehindOrInFront = CGeneral::GetATanOfXY(player->GetForward().x, player->GetForward().y);
+void CCamera::SetCameraDirectlyBehindForFollowPed_CamOnAString()
+{
+ m_bCamDirectlyBehind = true;
+ CPlayerPed *player = FindPlayerPed();
+ if (player)
+ m_PedOrientForBehindOrInFront = CGeneral::GetATanOfXY(player->GetForward().x, player->GetForward().y);
}
void
@@ -1382,80 +1382,80 @@ CCamera::SetWideScreenOff(void)
m_bWantsToSwitchWidescreenOff = m_WideScreenOn;
}
-void
-CCamera::SetNewPlayerWeaponMode(int16 mode, int16 minZoom, int16 maxZoom)
-{
- PlayerWeaponMode.Mode = mode;
- PlayerWeaponMode.MaxZoom = maxZoom;
- PlayerWeaponMode.MinZoom = minZoom;
- PlayerWeaponMode.Duration = 0.0f;
+void
+CCamera::SetNewPlayerWeaponMode(int16 mode, int16 minZoom, int16 maxZoom)
+{
+ PlayerWeaponMode.Mode = mode;
+ PlayerWeaponMode.MaxZoom = maxZoom;
+ PlayerWeaponMode.MinZoom = minZoom;
+ PlayerWeaponMode.Duration = 0.0f;
}
-void
-CCamera::UpdateAimingCoors(CVector const &coors)
-{
- m_cvecAimingTargetCoors = coors;
+void
+CCamera::UpdateAimingCoors(CVector const &coors)
+{
+ m_cvecAimingTargetCoors = coors;
}
void
CCamera::SetCamPositionForFixedMode(const CVector &Source, const CVector &UpOffSet)
{
- m_vecFixedModeSource = Source;
+ m_vecFixedModeSource = Source;
m_vecFixedModeUpOffSet = UpOffSet;
}
void
CCamera::SetRwCamera(RwCamera *cam)
{
- m_pRwCamera = cam;
- m_viewMatrix.Attach(&m_pRwCamera->viewMatrix, false);
+ m_pRwCamera = cam;
+ m_viewMatrix.Attach(&m_pRwCamera->viewMatrix, false);
CMBlur::MotionBlurOpen(m_pRwCamera);
}
uint32
CCamera::GetCutSceneFinishTime(void)
{
- int cam = ActiveCam;
- if (Cams[cam].Mode == CCam::MODE_FLYBY)
- return Cams[cam].m_uiFinishTime;
- cam = (cam + 1) % 2;
- if (Cams[cam].Mode == CCam::MODE_FLYBY)
- return Cams[cam].m_uiFinishTime;
-
+ int cam = ActiveCam;
+ if (Cams[cam].Mode == CCam::MODE_FLYBY)
+ return Cams[cam].m_uiFinishTime;
+ cam = (cam + 1) % 2;
+ if (Cams[cam].Mode == CCam::MODE_FLYBY)
+ return Cams[cam].m_uiFinishTime;
+
return 0;
}
void
CCamera::FinishCutscene(void)
{
- SetPercentAlongCutScene(100.0f);
- m_fPositionAlongSpline = 1.0f;
+ SetPercentAlongCutScene(100.0f);
+ m_fPositionAlongSpline = 1.0f;
m_bcutsceneFinished = true;
}
void
CCamera::SetZoomValueFollowPedScript(int16 mode)
-{
- switch (mode) {
- case 0: m_fPedZoomValueScript = 0.25f; break;
- case 1: m_fPedZoomValueScript = 1.5f; break;
- case 2: m_fPedZoomValueScript = 2.9f; break;
- default: m_fPedZoomValueScript = m_fPedZoomValueScript; break;
- }
-
+{
+ switch (mode) {
+ case 0: m_fPedZoomValueScript = 0.25f; break;
+ case 1: m_fPedZoomValueScript = 1.5f; break;
+ case 2: m_fPedZoomValueScript = 2.9f; break;
+ default: m_fPedZoomValueScript = m_fPedZoomValueScript; break;
+ }
+
m_bUseScriptZoomValuePed = true;
}
void
CCamera::SetZoomValueCamStringScript(int16 mode)
-{
- switch (mode) {
- case 0: m_fCarZoomValueScript = 0.05f; break;
- case 1: m_fCarZoomValueScript = 1.9f; break;
- case 2: m_fCarZoomValueScript = 3.9f; break;
- default: m_fCarZoomValueScript = m_fCarZoomValueScript; break;
- }
-
+{
+ switch (mode) {
+ case 0: m_fCarZoomValueScript = 0.05f; break;
+ case 1: m_fCarZoomValueScript = 1.9f; break;
+ case 2: m_fCarZoomValueScript = 3.9f; break;
+ default: m_fCarZoomValueScript = m_fCarZoomValueScript; break;
+ }
+
m_bUseScriptZoomValueCar = true;
}
diff --git a/src/core/Fire.h b/src/core/Fire.h
index 9d72179e..624bf608 100644
--- a/src/core/Fire.h
+++ b/src/core/Fire.h
@@ -28,8 +28,8 @@ class CFireManager
MAX_FIREMEN_ATTENDING = 2,
};
uint32 m_nTotalFires;
- CFire m_aFires[NUM_FIRES];
public:
+ CFire m_aFires[NUM_FIRES];
void StartFire(CEntity *entityOnFire, CEntity *culprit, float, uint32);
void StartFire(CVector, float, uint8);
void Update(void);
diff --git a/src/core/Timer.cpp b/src/core/Timer.cpp
index 8695f64b..bcf84560 100644
--- a/src/core/Timer.cpp
+++ b/src/core/Timer.cpp
@@ -103,7 +103,7 @@ void CTimer::Update(void)
{
m_snTimeInMilliseconds = m_snTimeInMilliseconds + upd;
m_snTimeInMillisecondsNonClipped = m_snTimeInMillisecondsNonClipped + upd;
- ms_fTimeStep = updInCyclesScaled / (double)_nCyclesPerMS / 20.0;
+ ms_fTimeStep = updInCyclesScaled / (double)_nCyclesPerMS / 20.0f;
}
}
else
diff --git a/src/core/common.h b/src/core/common.h
index 562a69b4..3127cb12 100644
--- a/src/core/common.h
+++ b/src/core/common.h
@@ -4,7 +4,6 @@
#define _USE_MATH_DEFINES
#pragma warning(disable: 4244) // int to float
#pragma warning(disable: 4800) // int to bool
-#pragma warning(disable: 4305) // double to float
#pragma warning(disable: 4838) // narrowing conversion
#pragma warning(disable: 4996) // POSIX names
diff --git a/src/core/config.h b/src/core/config.h
index c1f96eea..9235e744 100644
--- a/src/core/config.h
+++ b/src/core/config.h
@@ -3,8 +3,8 @@
enum Config {
NUMPLAYERS = 1,
- NUMCDIMAGES = 12, // gta3.img duplicates (not used on PC)
- MAX_CDIMAGES = 8, // additional cdimages
+ NUMCDIMAGES = 12, // gta3.img duplicates (not used on PC)
+ MAX_CDIMAGES = 8, // additional cdimages
MAX_CDCHANNELS = 5,
MODELINFOSIZE = 5500,
@@ -22,15 +22,15 @@ enum Config {
XTRACOMPSMODELSIZE = 2,
TWODFXSIZE = 2000,
- MAXVEHICLESLOADED = 50, // 70 on mobile
+ MAXVEHICLESLOADED = 50, // 70 on mobile
NUMOBJECTINFO = 168, // object.dat
// Pool sizes
NUMPTRNODES = 30000, // 26000 on PS2
NUMENTRYINFOS = 5400, // 3200 on PS2
- NUMPEDS = 140, // 90 on PS2
- NUMVEHICLES = 110, // 70 on PS2
+ NUMPEDS = 140, // 90 on PS2
+ NUMVEHICLES = 110, // 70 on PS2
NUMBUILDINGS = 5500, // 4915 on PS2
NUMTREADABLES = 1214,
NUMOBJECTS = 450,
@@ -94,6 +94,8 @@ enum Config {
NUM_GARAGES = 32,
NUM_PROJECTILES = 32,
+ NUM_WATERCANNONS = 3,
+
NUMPEDROUTES = 200,
NUMPHONES = 50,
NUMPEDGROUPS = 31,
@@ -102,7 +104,16 @@ enum Config {
NUMVISIBLEENTITIES = 2000,
NUMINVISIBLEENTITIES = 150,
- NUM_CONSOLEMESSAGES = 8
+ NUM_AUDIOENTITY_EVENTS = 4,
+ NUM_PED_COMMENTS_BANKS = 2,
+ NUM_PED_COMMENTS_SLOTS = 20,
+
+ NUM_SOUNDS_SAMPLES_BANKS = 2,
+ NUM_SOUNDS_SAMPLES_SLOTS = 27,
+ NUM_AUDIOENTITIES = 200,
+
+ NUM_AUDIO_REFLECTIONS = 5,
+ NUM_SCRIPT_MAX_ENTITIES = 40,
};
// We'll use this once we're ready to become independent of the game
diff --git a/src/core/main.cpp b/src/core/main.cpp
index 95ea345a..2a15e20e 100644
--- a/src/core/main.cpp
+++ b/src/core/main.cpp
@@ -217,7 +217,7 @@ Idle(void *arg)
RenderEffects();
if((TheCamera.m_BlurType == MBLUR_NONE || TheCamera.m_BlurType == MBLUR_NORMAL) &&
- TheCamera.m_ScreenReductionPercentage > 0.0)
+ TheCamera.m_ScreenReductionPercentage > 0.0f)
TheCamera.SetMotionBlurAlpha(150);
TheCamera.RenderMotionBlur();