summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2021-05-23 17:45:07 +0200
committerSergeanur <s.anureev@yandex.ua>2021-06-24 21:32:43 +0300
commit50058371efaf4c5713b7a608db0c7990ec3d78a6 (patch)
tree314722ae778432755c8ea0563a317df52fe130ee /src/core
parentce0a097392c5c6349ec9b5f83120dbc6a5c02230 (diff)
CEntity and C(Vu)Vector fixes and cleanup
Diffstat (limited to 'src/core')
-rw-r--r--src/core/Camera.cpp14
-rw-r--r--src/core/Camera.h6
-rw-r--r--src/core/References.cpp2
-rw-r--r--src/core/common.h6
4 files changed, 15 insertions, 13 deletions
diff --git a/src/core/Camera.cpp b/src/core/Camera.cpp
index fd2d5eed..5c86ca99 100644
--- a/src/core/Camera.cpp
+++ b/src/core/Camera.cpp
@@ -3675,16 +3675,18 @@ CCamera::IsSphereVisible(const CVector &center, float radius, const CMatrix *mat
bool
CCamera::IsSphereVisible(const CVector &center, float radius)
{
- CMatrix mat = m_cameraMatrix;
+#if GTA_VERSION < GTA3_PC_10 // not sure this condition is the right one
+ // Maybe this was a copy of the other function with m_cameraMatrix
+ return IsSphereVisible(center, radius, &m_cameraMatrix);
+#else
+ // ...and on PC they decided to call the other one with a default matrix.
+ CMatrix mat(m_cameraMatrix); // this matrix construction is stupid and gone in VC
return IsSphereVisible(center, radius, &mat);
+#endif
}
bool
-#ifdef GTA_PS2
-CCamera::IsBoxVisible(CVuVector *box, const CMatrix *mat)
-#else
-CCamera::IsBoxVisible(CVector *box, const CMatrix *mat)
-#endif
+CCamera::IsBoxVisible(CVUVECTOR *box, const CMatrix *mat)
{
int i;
int frustumTests[6] = { 0 };
diff --git a/src/core/Camera.h b/src/core/Camera.h
index d7293e20..5e9d33b3 100644
--- a/src/core/Camera.h
+++ b/src/core/Camera.h
@@ -641,11 +641,7 @@ public:
bool IsPointVisible(const CVector &center, const CMatrix *mat);
bool IsSphereVisible(const CVector &center, float radius, const CMatrix *mat);
bool IsSphereVisible(const CVector &center, float radius);
-#ifdef GTA_PS2
- bool IsBoxVisible(CVuVector *box, const CMatrix *mat);
-#else
- bool IsBoxVisible(CVector *box, const CMatrix *mat);
-#endif
+ bool IsBoxVisible(CVUVECTOR *box, const CMatrix *mat);
};
VALIDATE_SIZE(CCamera, 0xE9D8);
diff --git a/src/core/References.cpp b/src/core/References.cpp
index 6b0c868c..b7782099 100644
--- a/src/core/References.cpp
+++ b/src/core/References.cpp
@@ -39,9 +39,7 @@ CEntity::RegisterReference(CEntity **pent)
ref->pentity = pent;
ref->next = m_pFirstReference;
m_pFirstReference = ref;
- return;
}
- return;
}
// Clear all references to this entity
diff --git a/src/core/common.h b/src/core/common.h
index a8f19158..e5077611 100644
--- a/src/core/common.h
+++ b/src/core/common.h
@@ -216,6 +216,12 @@ inline uint32 ldb(uint32 p, uint32 s, uint32 w)
#include "maths.h"
#include "Vector.h"
+#ifdef GTA_PS2
+#include "VuVector.h"
+#define CVUVECTOR CVuVector
+#else
+#define CVUVECTOR CVector
+#endif
#include "Vector2D.h"
#include "Matrix.h"
#include "Rect.h"