summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/Camera.cpp11
-rw-r--r--src/core/Camera.h4
-rw-r--r--src/core/Messages.cpp6
-rw-r--r--src/core/Messages.h6
-rw-r--r--src/core/World.cpp18
-rw-r--r--src/core/World.h1
-rw-r--r--src/core/common.h1
7 files changed, 34 insertions, 13 deletions
diff --git a/src/core/Camera.cpp b/src/core/Camera.cpp
index c06ee48b..e35198d8 100644
--- a/src/core/Camera.cpp
+++ b/src/core/Camera.cpp
@@ -23,7 +23,7 @@ WRAPPER void CCamera::DrawBordersForWideScreen(void) { EAXJMP(0x46B430); }
WRAPPER void CCamera::CalculateDerivedValues(void) { EAXJMP(0x46EEA0); }
WRAPPER void CCamera::Restore(void) { EAXJMP(0x46F990); }
WRAPPER void CCamera::SetWidescreenOff(void) { EAXJMP(0x46FF10); }
-WRAPPER void CCamera::CamShake(float) { EAXJMP(0x46B100); }
+WRAPPER void CamShakeNoPos(CCamera*, float) { EAXJMP(0x46B100); }
bool
CCamera::IsSphereVisible(const CVector &center, float radius, const CMatrix *mat)
@@ -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..a88bf83a 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);
@@ -465,7 +466,6 @@ int m_iModeObbeCamIsInForCar;
void DrawBordersForWideScreen(void);
void Restore(void);
void SetWidescreenOff(void);
- void CamShake(float);
void dtor(void) { this->CCamera::~CCamera(); }
};
@@ -478,3 +478,5 @@ static_assert(offsetof(CCamera, m_BlurBlue) == 0x9C, "CCamera: error");
static_assert(offsetof(CCamera, Cams) == 0x1A4, "CCamera: error");
static_assert(sizeof(CCamera) == 0xE9D8, "CCamera: wrong size");
extern CCamera &TheCamera;
+
+void CamShakeNoPos(CCamera*, float);
diff --git a/src/core/Messages.cpp b/src/core/Messages.cpp
index aedcb0b9..c6f3bc1b 100644
--- a/src/core/Messages.cpp
+++ b/src/core/Messages.cpp
@@ -9,7 +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::AddMessage(wchar*, uint32, uint16) { EAXJMP(0x529900); }
+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 e1f4ced1..51c36212 100644
--- a/src/core/Messages.h
+++ b/src/core/Messages.h
@@ -41,5 +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 AddMessage(wchar*, uint32, uint16);
+ 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 a9ec1f2a..829a64d4 100644
--- a/src/core/World.cpp
+++ b/src/core/World.cpp
@@ -28,6 +28,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)
{
@@ -605,12 +607,12 @@ CWorld::FindObjectsInRange(CVector &centre, float distance, bool ignoreZ, short
minY = 0;
int maxX = GetSectorIndexX(centre.x + distance);
- if (maxX >= 100)
- maxX = 100;
+ if (maxX >= NUMSECTORS_X)
+ maxX = NUMSECTORS_X;
int maxY = GetSectorIndexY(centre.y + distance);
- if (maxY >= 100)
- maxY = 100;
+ if (maxY >= NUMSECTORS_Y)
+ maxY = NUMSECTORS_Y;
AdvanceCurrentScanCode();
@@ -656,12 +658,12 @@ CWorld::TestSphereAgainstWorld(CVector centre, float distance, CEntity* entityTo
minY = 0;
int maxX = GetSectorIndexX(centre.x + distance);
- if (maxX >= 100)
- maxX = 100;
+ if (maxX >= NUMSECTORS_X)
+ maxX = NUMSECTORS_X;
int maxY = GetSectorIndexY(centre.y + distance);
- if (maxY >= 100)
- maxY = 100;
+ if (maxY >= NUMSECTORS_Y)
+ maxY = NUMSECTORS_Y;
AdvanceCurrentScanCode();
diff --git a/src/core/World.h b/src/core/World.h
index a8650d93..fd9d6fc3 100644
--- a/src/core/World.h
+++ b/src/core/World.h
@@ -102,6 +102,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))