Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
Merge pull request #365 from Fire-Head/master
CWeaponEffects done, CGame done. restored some R* names
  • Loading branch information
aap committed Mar 29, 2020
2 parents 82dcc34 + a0b0775 commit 0cbdca632fae35923d585cd791d8d8b84c93103e
@@ -57,7 +57,7 @@ CGameLogic::SortOutStreamingAndMemory(const CVector &pos)
CStreaming::FlushRequestList(); CStreaming::FlushRequestList();
CStreaming::DeleteRwObjectsAfterDeath(pos); CStreaming::DeleteRwObjectsAfterDeath(pos);
CStreaming::RemoveUnusedModelsInLoadedList(); CStreaming::RemoveUnusedModelsInLoadedList();
CGame::DrasticTidyUpMemory(); CGame::DrasticTidyUpMemory(true);
CStreaming::LoadScene(pos); CStreaming::LoadScene(pos);
CTimer::Update(); CTimer::Update();
} }
@@ -14,7 +14,7 @@ CGangInfo::CGangInfo() :
m_Weapon2(WEAPONTYPE_UNARMED) m_Weapon2(WEAPONTYPE_UNARMED)
{} {}


void CGangs::Initialize(void) void CGangs::Initialise(void)
{ {
Gang[GANG_MAFIA].m_nVehicleMI = MI_MAFIA; Gang[GANG_MAFIA].m_nVehicleMI = MI_MAFIA;
Gang[GANG_TRIAD].m_nVehicleMI = MI_BELLYUP; Gang[GANG_TRIAD].m_nVehicleMI = MI_BELLYUP;
@@ -67,7 +67,7 @@ VALIDATESAVEBUF(*size);


void CGangs::LoadAllGangData(uint8 *buf, uint32 size) void CGangs::LoadAllGangData(uint8 *buf, uint32 size)
{ {
Initialize(); Initialise();


INITSAVEBUF INITSAVEBUF
// original: SkipSaveBuf(buf, SAVE_HEADER_SIZE); // original: SkipSaveBuf(buf, SAVE_HEADER_SIZE);
@@ -79,7 +79,7 @@ VALIDATESAVEBUF(size);
} }


STARTPATCHES STARTPATCHES
InjectHook(0x4C3FB0, CGangs::Initialize, PATCH_JUMP); InjectHook(0x4C3FB0, CGangs::Initialise, PATCH_JUMP);
InjectHook(0x4C4010, CGangs::SetGangVehicleModel, PATCH_JUMP); InjectHook(0x4C4010, CGangs::SetGangVehicleModel, PATCH_JUMP);
InjectHook(0x4C4030, CGangs::SetGangWeapons, PATCH_JUMP); InjectHook(0x4C4030, CGangs::SetGangWeapons, PATCH_JUMP);
InjectHook(0x4C4050, CGangs::SetGangPedModelOverride, PATCH_JUMP); InjectHook(0x4C4050, CGangs::SetGangPedModelOverride, PATCH_JUMP);
@@ -28,7 +28,7 @@ enum {
class CGangs class CGangs
{ {
public: public:
static void Initialize(void); static void Initialise(void);
static void SetGangVehicleModel(int16, int32); static void SetGangVehicleModel(int16, int32);
static void SetGangWeapons(int16, int32, int32); static void SetGangWeapons(int16, int32, int32);
static void SetGangPedModelOverride(int16, int8); static void SetGangPedModelOverride(int16, int8);
@@ -30,10 +30,14 @@ uint32 &CGarages::GarageToBeTidied = *(uint32 *)0x623570;
CGarage(&CGarages::Garages)[NUM_GARAGES] = *(CGarage(*)[NUM_GARAGES])*(uintptr*)0x72BCD0; CGarage(&CGarages::Garages)[NUM_GARAGES] = *(CGarage(*)[NUM_GARAGES])*(uintptr*)0x72BCD0;


WRAPPER void CGarages::Init(void) { EAXJMP(0x421C60); } WRAPPER void CGarages::Init(void) { EAXJMP(0x421C60); }
WRAPPER void CGarages::Shutdown(void) { EAXJMP(0x421E10); }

WRAPPER void CGarages::Update(void) { EAXJMP(0x421E40); } WRAPPER void CGarages::Update(void) { EAXJMP(0x421E40); }
WRAPPER void CGarages::Load(uint8* buf, uint32 size) { EAXJMP(0x428940); } WRAPPER void CGarages::Load(uint8* buf, uint32 size) { EAXJMP(0x428940); }
WRAPPER void CGarages::Save(uint8* buf, uint32 *size) { EAXJMP(0x4284e0); } WRAPPER void CGarages::Save(uint8* buf, uint32 *size) { EAXJMP(0x4284e0); }


WRAPPER void CGarages::SetAllDoorsBackToOriginalHeight(void) { EAXJMP(0x4283D0); }

bool bool
CGarages::IsModelIndexADoor(uint32 id) CGarages::IsModelIndexADoor(uint32 id)
{ {
@@ -146,6 +146,7 @@ class CGarages
static bool IsPointWithinAnyGarage(CVector&); static bool IsPointWithinAnyGarage(CVector&);
static void PlayerArrestedOrDied(); static void PlayerArrestedOrDied();
static void Init(void); static void Init(void);
static void Shutdown(void);
static void Update(void); static void Update(void);
static void Load(uint8 *buf, uint32 size); static void Load(uint8 *buf, uint32 size);
static void Save(uint8 *buf, uint32 *size); static void Save(uint8 *buf, uint32 *size);
@@ -167,4 +168,6 @@ class CGarages
static bool IsThisCarWithinGarageArea(int16, CEntity*); static bool IsThisCarWithinGarageArea(int16, CEntity*);


static int GetCarsCollectedIndexForGarageType(eGarageType type) { return type - GARAGE_COLLECTCARS_1; } static int GetCarsCollectedIndexForGarageType(eGarageType type) { return type - GARAGE_COLLECTCARS_1; }

static void SetAllDoorsBackToOriginalHeight();
}; };
@@ -9790,7 +9790,7 @@ void CTheScripts::UndoBuildingSwaps()
} }
} }


void CTheScripts::UndoEntityVisibilitySettings() void CTheScripts::UndoEntityInvisibilitySettings()
{ {
for (int i = 0; i < MAX_NUM_INVISIBILITY_SETTINGS; i++) { for (int i = 0; i < MAX_NUM_INVISIBILITY_SETTINGS; i++) {
if (InvisibilitySettingArray[i]) { if (InvisibilitySettingArray[i]) {
@@ -11628,7 +11628,7 @@ InjectHook(0x439040, &CTheScripts::Process, PATCH_JUMP);
InjectHook(0x439400, &CTheScripts::StartTestScript, PATCH_JUMP); InjectHook(0x439400, &CTheScripts::StartTestScript, PATCH_JUMP);
InjectHook(0x439410, &CTheScripts::IsPlayerOnAMission, PATCH_JUMP); InjectHook(0x439410, &CTheScripts::IsPlayerOnAMission, PATCH_JUMP);
InjectHook(0x44FD10, &CTheScripts::UndoBuildingSwaps, PATCH_JUMP); InjectHook(0x44FD10, &CTheScripts::UndoBuildingSwaps, PATCH_JUMP);
InjectHook(0x44FD60, &CTheScripts::UndoEntityVisibilitySettings, PATCH_JUMP); InjectHook(0x44FD60, &CTheScripts::UndoEntityInvisibilitySettings, PATCH_JUMP);
InjectHook(0x4534E0, &CTheScripts::ScriptDebugLine3D, PATCH_JUMP); InjectHook(0x4534E0, &CTheScripts::ScriptDebugLine3D, PATCH_JUMP);
InjectHook(0x453550, &CTheScripts::RenderTheScriptDebugLines, PATCH_JUMP); InjectHook(0x453550, &CTheScripts::RenderTheScriptDebugLines, PATCH_JUMP);
InjectHook(0x4535E0, &CTheScripts::SaveAllScripts, PATCH_JUMP); InjectHook(0x4535E0, &CTheScripts::SaveAllScripts, PATCH_JUMP);
@@ -281,7 +281,7 @@ class CTheScripts
static void ClearSpaceForMissionEntity(const CVector&, CEntity*); static void ClearSpaceForMissionEntity(const CVector&, CEntity*);


static void UndoBuildingSwaps(); static void UndoBuildingSwaps();
static void UndoEntityVisibilitySettings(); static void UndoEntityInvisibilitySettings();


static void ScriptDebugLine3D(float x1, float y1, float z1, float x2, float y2, float z2, uint32 col, uint32 col2); static void ScriptDebugLine3D(float x1, float y1, float z1, float x2, float y2, float z2, uint32 col, uint32 col2);
static void RenderTheScriptDebugLines(); static void RenderTheScriptDebugLines();
@@ -183,7 +183,7 @@ CCutsceneMgr::LoadCutsceneData(const char *szCutsceneName)
ms_pCutsceneDir->ReadDirFile("ANIM\\CUTS.DIR"); ms_pCutsceneDir->ReadDirFile("ANIM\\CUTS.DIR");


CStreaming::RemoveUnusedModelsInLoadedList(); CStreaming::RemoveUnusedModelsInLoadedList();
CGame::DrasticTidyUpMemory(); CGame::DrasticTidyUpMemory(true);


strcpy(ms_cutsceneName, szCutsceneName); strcpy(ms_cutsceneName, szCutsceneName);
file = CFileMgr::OpenFile("ANIM\\CUTS.IMG", "rb"); file = CFileMgr::OpenFile("ANIM\\CUTS.IMG", "rb");
@@ -374,8 +374,7 @@ CCutsceneMgr::DeleteCutsceneData(void)
DMAudio.ChangeMusicMode(MUSICMODE_GAME); DMAudio.ChangeMusicMode(MUSICMODE_GAME);
} }
CTimer::Stop(); CTimer::Stop();
//TheCamera.GetScreenFadeStatus() == 2; // what for?? CGame::DrasticTidyUpMemory(TheCamera.GetScreenFadeStatus() == 2);
CGame::DrasticTidyUpMemory();
CTimer::Update(); CTimer::Update();
} }


0 comments on commit 0cbdca6

Please sign in to comment.