From b77a9ce9550d0326c8bd69fdc1474af4f3a1d268 Mon Sep 17 00:00:00 2001 From: Nikolay Korolev Date: Sun, 14 Jul 2019 14:49:27 +0300 Subject: RunningScript 2. So far with bugs (cops not caring, errors in arithmetical opcodes) --- src/core/Camera.cpp | 9 ++++++++- src/core/Camera.h | 1 + src/core/Messages.cpp | 5 +++++ src/core/Messages.h | 5 +++++ 4 files changed, 19 insertions(+), 1 deletion(-) (limited to 'src/core') 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 @@ -40,6 +40,13 @@ CCamera::IsSphereVisible(const CVector ¢er, float radius, const CMatrix *mat return true; } +bool +CCamera::IsSphereVisible(const CVector ¢er, float radius) +{ + CMatrix mat = m_cameraMatrix; + return IsSphereVisible(center, radius, &mat); +} + bool CCamera::IsPointVisible(const CVector ¢er, const CMatrix *mat) { @@ -1290,7 +1297,7 @@ CCam::GetWeaponFirstPersonOn() } STARTPATCHES - InjectHook(0x42C760, &CCamera::IsSphereVisible, PATCH_JUMP); + InjectHook(0x42C760, (bool (CCamera::*)(const CVector ¢er, 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 ¢er, const CMatrix *mat); bool IsSphereVisible(const CVector ¢er, float radius, const CMatrix *mat); + bool IsSphereVisible(const CVector ¢er, 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(); }; -- cgit v1.2.3