summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/Camera.cpp9
-rw-r--r--src/core/Camera.h1
-rw-r--r--src/core/Messages.cpp5
-rw-r--r--src/core/Messages.h5
-rw-r--r--src/core/World.cpp2
-rw-r--r--src/core/World.h1
-rw-r--r--src/core/common.h1
7 files changed, 23 insertions, 1 deletions
diff --git a/src/core/Camera.cpp b/src/core/Camera.cpp
index c06ee48b..166928c1 100644
--- a/src/core/Camera.cpp
+++ b/src/core/Camera.cpp
@@ -41,6 +41,13 @@ CCamera::IsSphereVisible(const CVector &center, float radius, const CMatrix *mat
}
bool
+CCamera::IsSphereVisible(const CVector &center, float radius)
+{
+ CMatrix mat = m_cameraMatrix;
+ return IsSphereVisible(center, radius, &mat);
+}
+
+bool
CCamera::IsPointVisible(const CVector &center, const CMatrix *mat)
{
RwV3d c;
@@ -1290,7 +1297,7 @@ CCam::GetWeaponFirstPersonOn()
}
STARTPATCHES
- InjectHook(0x42C760, &CCamera::IsSphereVisible, PATCH_JUMP);
+ InjectHook(0x42C760, (bool (CCamera::*)(const CVector &center, float radius, const CMatrix *mat))&CCamera::IsSphereVisible, PATCH_JUMP);
InjectHook(0x46FD00, &CCamera::SetFadeColour, PATCH_JUMP);
InjectHook(0x46FD40, &CCamera::SetMotionBlur, PATCH_JUMP);
diff --git a/src/core/Camera.h b/src/core/Camera.h
index c0309b5f..10554601 100644
--- a/src/core/Camera.h
+++ b/src/core/Camera.h
@@ -445,6 +445,7 @@ int m_iModeObbeCamIsInForCar;
CVector &GetGameCamPosition(void) { return m_vecGameCamPos; }
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);
bool IsBoxVisible(RwV3d *box, const CMatrix *mat);
int GetLookDirection(void);
diff --git a/src/core/Messages.cpp b/src/core/Messages.cpp
index 7fc23593..c6f3bc1b 100644
--- a/src/core/Messages.cpp
+++ b/src/core/Messages.cpp
@@ -9,6 +9,11 @@ WRAPPER char CMessages::WideStringCompare(wchar* str1, wchar* str2, unsigned sho
WRAPPER void CMessages::InsertNumberInString(wchar* src, int n1, int n2, int n3, int n4, int n5, int n6, wchar* dst) { EAXJMP(0x52A1A0); }
WRAPPER void CMessages::InsertPlayerControlKeysInString(wchar* src) { EAXJMP(0x52A490); }
WRAPPER int CMessages::GetWideStringLength(wchar* src) { EAXJMP(0x529490); }
+WRAPPER void CMessages::AddBigMessage(wchar* key, uint32 time, uint16 pos) { EAXJMP(0x529EB0); }
+WRAPPER void CMessages::AddMessage(wchar* key, uint32 time, uint16 pos) { EAXJMP(0x529900); }
+WRAPPER void CMessages::AddMessageJumpQ(wchar* key, uint32 time, uint16 pos) { EAXJMP(0x529A10); }
+WRAPPER void CMessages::AddMessageSoon(wchar* key, uint32 time, uint16 pos) { EAXJMP(0x529AF0); }
+WRAPPER void CMessages::ClearMessages() { EAXJMP(0x529CE0); }
tPreviousBrief *CMessages::PreviousBriefs = (tPreviousBrief *)0x713C08;
tMessage *CMessages::BriefMessages = (tMessage *)0x8786E0;
diff --git a/src/core/Messages.h b/src/core/Messages.h
index 69cf117c..51c36212 100644
--- a/src/core/Messages.h
+++ b/src/core/Messages.h
@@ -41,4 +41,9 @@ public:
static void InsertNumberInString(wchar* src, int n1, int n2, int n3, int n4, int n5, int n6, wchar* dst);
static void InsertPlayerControlKeysInString(wchar* src);
static int GetWideStringLength(wchar *src);
+ static void AddBigMessage(wchar* key, uint32 time, uint16 pos);
+ static void AddMessage(wchar* key, uint32 time, uint16 pos);
+ static void AddMessageJumpQ(wchar* key, uint32 time, uint16 pos);
+ static void AddMessageSoon(wchar* key, uint32 time, uint16 pos);
+ static void ClearMessages();
};
diff --git a/src/core/World.cpp b/src/core/World.cpp
index a31f87a7..2b2ddd06 100644
--- a/src/core/World.cpp
+++ b/src/core/World.cpp
@@ -26,6 +26,8 @@ bool &CWorld::bSecondShift = *(bool*)0x95CD54;
bool &CWorld::bForceProcessControl = *(bool*)0x95CD6C;
bool &CWorld::bProcessCutsceneOnly = *(bool*)0x95CD8B;
+WRAPPER void CWorld::RemoveReferencesToDeletedObject(CEntity*) { EAXJMP(0x4B3BF0); }
+
void
CWorld::Add(CEntity *ent)
{
diff --git a/src/core/World.h b/src/core/World.h
index d6063d70..a08a8cb9 100644
--- a/src/core/World.h
+++ b/src/core/World.h
@@ -99,6 +99,7 @@ public:
static float FindGroundZForCoord(float x, float y);
static float FindGroundZFor3DCoord(float x, float y, float z, bool *found);
static float FindRoofZFor3DCoord(float x, float y, float z, bool *found);
+ static void RemoveReferencesToDeletedObject(CEntity*);
static float GetSectorX(float f) { return ((f - WORLD_MIN_X)/SECTOR_SIZE_X); }
static float GetSectorY(float f) { return ((f - WORLD_MIN_Y)/SECTOR_SIZE_Y); }
diff --git a/src/core/common.h b/src/core/common.h
index 4b7bcb0a..fd961dd7 100644
--- a/src/core/common.h
+++ b/src/core/common.h
@@ -178,3 +178,4 @@ void re3_assert(const char *expr, const char *filename, unsigned int lineno, con
#define max(a, b) (((a) > (b)) ? (a) : (b))
#define min(a, b) (((a) < (b)) ? (a) : (b))
+#define ABS(a) (((a) < 0) ? (-a) : (a))