Merge pull request #460 from Sergeanur/Standalone

Standalone
This commit is contained in:
Sergeanur 2020-04-17 18:08:26 +03:00 committed by GitHub
commit 1c74d111e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
229 changed files with 3065 additions and 6583 deletions

View File

@ -10,38 +10,17 @@ install:
- cmd: >- - cmd: >-
git submodule update --init --recursive git submodule update --init --recursive
premake-vs2019.cmd copy premake5.exe "librw/premake5.exe"
cd "librw" && premake5 vs2019 && msbuild "build/librw.sln" /property:Configuration=%CONFIGURATION% /property:Platform="win-x86-d3d9"
cd "%APPVEYOR_BUILD_FOLDER%" && premake5 vs2019
build: build:
project: build/re3.sln project: build/re3.sln
verbosity: minimal verbosity: minimal
after_build:
# downloading latest release of UAL to make release with UAL and ASI.
- ps: >-
$releases = "https://github.com/ThirteenAG/Ultimate-ASI-Loader/releases"
$name = "Ultimate-ASI-Loader.zip"
$latestRelease = Invoke-WebRequest $releases/latest -Headers @{"Accept"="application/json"}
$json = $latestRelease.Content | ConvertFrom-Json
$latestVersion = $json.tag_name
$url = "$releases/download/$latestVersion/$name"
Start-FileDownload $url -FileName 'C:\Ultimate-ASI-Loader.zip'
7z e c:\Ultimate-ASI-Loader.zip -oc:\Projects\re3\bin\${env:CONFIGURATION}
cd "bin\${env:CONFIGURATION}"
copy re3.dll re3.asi
7z u "RE3_${env:CONFIGURATION}+UAL.zip" re3.asi dinput8.dll
Get-ChildItem .\*.zip | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name }
artifacts: artifacts:
- path: bin/%CONFIGURATION%/re3.dll - path: bin/%CONFIGURATION%/re3.exe
name: re3.dll name: re3.exe
- path: bin/%CONFIGURATION%/re3.pdb - path: bin/%CONFIGURATION%/re3.pdb
name: re3.pdb name: re3.pdb

View File

@ -1,7 +1,7 @@
Librw = os.getenv("LIBRW") Librw = os.getenv("LIBRW")
workspace "re3" workspace "re3"
configurations { "Debug", "Release", "ReleaseFH", "DebugRW", "ReleaseRW", "DebugLIBRW" } configurations { "Debug", "Release", "ReleaseFH", "DebugRW", "ReleaseRW" }
location "build" location "build"
files { "src/*.*" } files { "src/*.*" }
@ -51,18 +51,18 @@ workspace "re3"
libdirs { "dxsdk/lib" } libdirs { "dxsdk/lib" }
libdirs { "milessdk/lib" } libdirs { "milessdk/lib" }
filter "configurations:*LIBRW" filter "configurations:Debug or Release"
files { "src/fakerw/*.*" } files { "src/fakerw/*.*" }
includedirs { "src/fakerw" } includedirs { "src/fakerw" }
includedirs { Librw } includedirs { "librw" }
libdirs { path.join(Librw, "lib/win-x86-d3d9/Debug") } includedirs { "librw/src" }
libdirs { path.join("librw", "lib/win-x86-d3d9/%{cfg.buildcfg}") }
links { "rw", "d3d9" } links { "rw", "d3d9" }
filter {}
filter "configurations:not *LIBRW" filter "configurations:DebugRW or ReleaseRW"
includedirs { "rwsdk/include/d3d8" }
filter "configurations:DebugRW or configurations:ReleaseRW"
defines { "RWLIBS" } defines { "RWLIBS" }
includedirs { "rwsdk/include/d3d8" }
libdirs { "rwsdk/lib/d3d8/release" } libdirs { "rwsdk/lib/d3d8/release" }
links { "rwcore", "rpworld", "rpmatfx", "rpskin", "rphanim", "rtbmp" } links { "rwcore", "rpworld", "rpmatfx", "rpskin", "rphanim", "rtbmp" }
filter {} filter {}
@ -95,49 +95,43 @@ workspace "re3"
end end
project "re3" project "re3"
kind "SharedLib" kind "WindowedApp"
language "C++" language "C++"
targetname "re3" targetname "re3"
targetdir "bin/%{cfg.buildcfg}" targetdir "bin/%{cfg.buildcfg}"
targetextension ".dll" targetextension ".exe"
characterset ("MBCS") characterset ("MBCS")
linkoptions "/SAFESEH:NO" linkoptions "/SAFESEH:NO"
filter "configurations:Debug" filter "configurations:Debug"
defines { "DEBUG" } defines { "DEBUG", "LIBRW", "RW_D3D9" }
staticruntime "on" staticruntime "off"
symbols "Full" symbols "Full"
setpaths("$(GTA_III_RE_DIR)/", "gta3.exe", "plugins/") setpaths("$(GTA_III_RE_DIR)/", "re3.exe", "")
filter "configurations:Release" filter "configurations:Release"
defines { "NDEBUG" } defines { "NDEBUG", "LIBRW", "RW_D3D9" }
optimize "On" optimize "On"
staticruntime "on" staticruntime "off"
symbols "Full" symbols "Full"
setpaths("$(GTA_III_RE_DIR)/", "gta3.exe", "plugins/") setpaths("$(GTA_III_RE_DIR)/", "re3.exe", "")
filter "configurations:ReleaseFH" filter "configurations:ReleaseFH"
defines { "NDEBUG" } defines { "NDEBUG" }
symbols "Full" symbols "Full"
optimize "off" optimize "off"
staticruntime "on" staticruntime "on"
targetextension ".asi" setpaths("$(GTA_III_RE_DIR)/", "re3.exe", "")
setpaths("$(GTA_III_RE_DIR)/", "gta3.exe", "scripts/")
filter "configurations:DebugRW" filter "configurations:DebugRW"
defines { "DEBUG" } defines { "DEBUG" }
staticruntime "on" staticruntime "on"
symbols "On" symbols "On"
setpaths("$(GTA_III_RE_DIR)/", "gta3.exe", "plugins/") setpaths("$(GTA_III_RE_DIR)/", "re3.exe", "")
filter "configurations:ReleaseRW" filter "configurations:ReleaseRW"
defines { "NDEBUG" } defines { "NDEBUG" }
optimize "On" optimize "On"
staticruntime "on" staticruntime "on"
setpaths("$(GTA_III_RE_DIR)/", "gta3.exe", "plugins/") setpaths("$(GTA_III_RE_DIR)/", "re3.exe", "")
filter "configurations:DebugLIBRW"
defines { "DEBUG", "LIBRW", "RW_D3D9" }
symbols "On"
setpaths("$(GTA_III_RE_DIR)/", "gta3.exe", "plugins/")

View File

@ -1,5 +1,5 @@
#include "common.h" #include "common.h"
#include "patcher.h"
#include "General.h" #include "General.h"
#include "ModelInfo.h" #include "ModelInfo.h"
#include "AnimManager.h" #include "AnimManager.h"
@ -148,15 +148,3 @@ CAnimBlendAssocGroup::CreateAssociations(const char *blockName, RpClump *clump,
} }
numAssociations = numAssocs; numAssociations = numAssocs;
} }
STARTPATCHES
InjectHook(0x4012D0, &CAnimBlendAssocGroup::DestroyAssociations, PATCH_JUMP);
InjectHook(0x4013D0, (CAnimBlendAssociation *(CAnimBlendAssocGroup::*)(uint32))&CAnimBlendAssocGroup::GetAnimation, PATCH_JUMP);
InjectHook(0x401300, (CAnimBlendAssociation *(CAnimBlendAssocGroup::*)(const char*))&CAnimBlendAssocGroup::GetAnimation, PATCH_JUMP);
InjectHook(0x401420, (CAnimBlendAssociation *(CAnimBlendAssocGroup::*)(uint32))&CAnimBlendAssocGroup::CopyAnimation, PATCH_JUMP);
InjectHook(0x4013E0, (CAnimBlendAssociation *(CAnimBlendAssocGroup::*)(const char*))&CAnimBlendAssocGroup::CopyAnimation, PATCH_JUMP);
InjectHook(0x401130, (void (CAnimBlendAssocGroup::*)(const char*))&CAnimBlendAssocGroup::CreateAssociations, PATCH_JUMP);
InjectHook(0x401220, (void (CAnimBlendAssocGroup::*)(const char*, RpClump*, const char**, int))&CAnimBlendAssocGroup::CreateAssociations, PATCH_JUMP);
ENDPATCHES

View File

@ -1,5 +1,5 @@
#include "common.h" #include "common.h"
#include "patcher.h"
#include "AnimBlendHierarchy.h" #include "AnimBlendHierarchy.h"
#include "AnimBlendClumpData.h" #include "AnimBlendClumpData.h"
#include "RpAnimBlend.h" #include "RpAnimBlend.h"
@ -202,33 +202,3 @@ CAnimBlendAssociation::UpdateBlend(float timeDelta)
return true; return true;
} }
#include <new>
class CAnimBlendAssociation_ : public CAnimBlendAssociation
{
public:
CAnimBlendAssociation *ctor1(void) { return ::new (this) CAnimBlendAssociation(); }
CAnimBlendAssociation *ctor2(CAnimBlendAssociation &other) { return ::new (this) CAnimBlendAssociation(other); }
void dtor(void) { this->CAnimBlendAssociation::~CAnimBlendAssociation(); }
};
STARTPATCHES
InjectHook(0x4016A0, &CAnimBlendAssociation::AllocateAnimBlendNodeArray, PATCH_JUMP);
InjectHook(0x4016F0, &CAnimBlendAssociation::FreeAnimBlendNodeArray, PATCH_JUMP);
InjectHook(0x4017B0, &CAnimBlendAssociation::GetNode, PATCH_JUMP);
InjectHook(0x401560, (void (CAnimBlendAssociation::*)(RpClump*, CAnimBlendHierarchy*))&CAnimBlendAssociation::Init, PATCH_JUMP);
InjectHook(0x401620, (void (CAnimBlendAssociation::*)(CAnimBlendAssociation&))&CAnimBlendAssociation::Init, PATCH_JUMP);
InjectHook(0x4017E0, &CAnimBlendAssociation::SetBlend, PATCH_JUMP);
InjectHook(0x401820, &CAnimBlendAssociation::SetFinishCallback, PATCH_JUMP);
InjectHook(0x401800, &CAnimBlendAssociation::SetDeleteCallback, PATCH_JUMP);
InjectHook(0x401700, &CAnimBlendAssociation::SetCurrentTime, PATCH_JUMP);
InjectHook(0x401780, &CAnimBlendAssociation::SyncAnimation, PATCH_JUMP);
InjectHook(0x4017D0, &CAnimBlendAssociation::Start, PATCH_JUMP);
InjectHook(0x4031F0, &CAnimBlendAssociation::UpdateTime, PATCH_JUMP);
InjectHook(0x4032B0, &CAnimBlendAssociation::UpdateBlend, PATCH_JUMP);
InjectHook(0x401460, &CAnimBlendAssociation_::ctor1, PATCH_JUMP);
InjectHook(0x4014C0, &CAnimBlendAssociation_::ctor2, PATCH_JUMP);
InjectHook(0x401520, &CAnimBlendAssociation_::dtor, PATCH_JUMP);
ENDPATCHES

View File

@ -1,5 +1,5 @@
#include "common.h" #include "common.h"
#include "patcher.h"
#include "AnimBlendClumpData.h" #include "AnimBlendClumpData.h"
#include "RwHelper.h" #include "RwHelper.h"
@ -35,20 +35,3 @@ CAnimBlendClumpData::ForAllFrames(void (*cb)(AnimBlendFrameData*, void*), void *
for(i = 0; i < numFrames; i++) for(i = 0; i < numFrames; i++)
cb(&frames[i], arg); cb(&frames[i], arg);
} }
#include <new>
class CAnimBlendClumpData_ : public CAnimBlendClumpData
{
public:
CAnimBlendClumpData *ctor(void) { return ::new (this) CAnimBlendClumpData(); }
void dtor(void) { this->CAnimBlendClumpData::~CAnimBlendClumpData(); }
};
STARTPATCHES
InjectHook(0x401880, &CAnimBlendClumpData_::ctor, PATCH_JUMP);
InjectHook(0x4018B0, &CAnimBlendClumpData_::dtor, PATCH_JUMP);
InjectHook(0x4018F0, &CAnimBlendClumpData::SetNumberOfFrames, PATCH_JUMP);
InjectHook(0x401930, &CAnimBlendClumpData::ForAllFrames, PATCH_JUMP);
ENDPATCHES

View File

@ -1,5 +1,5 @@
#include "common.h" #include "common.h"
#include "patcher.h"
#include "AnimBlendSequence.h" #include "AnimBlendSequence.h"
#include "AnimBlendHierarchy.h" #include "AnimBlendHierarchy.h"
@ -72,13 +72,3 @@ CAnimBlendHierarchy::RemoveUncompressedData(void)
// useless // useless
compressed = 1; compressed = 1;
} }
STARTPATCHES
InjectHook(0x4019A0, &CAnimBlendHierarchy::Shutdown, PATCH_JUMP);
InjectHook(0x4019C0, &CAnimBlendHierarchy::SetName, PATCH_JUMP);
InjectHook(0x4019E0, &CAnimBlendHierarchy::CalcTotalTime, PATCH_JUMP);
InjectHook(0x401A80, &CAnimBlendHierarchy::RemoveQuaternionFlips, PATCH_JUMP);
InjectHook(0x401AB0, &CAnimBlendHierarchy::RemoveAnimSequences, PATCH_JUMP);
InjectHook(0x401AD0, &CAnimBlendHierarchy::Uncompress, PATCH_JUMP);
InjectHook(0x401B00, &CAnimBlendHierarchy::RemoveUncompressedData, PATCH_JUMP);
ENDPATCHES

View File

@ -1,5 +1,5 @@
#include "common.h" #include "common.h"
#include "patcher.h"
#include "AnimBlendAssociation.h" #include "AnimBlendAssociation.h"
#include "AnimBlendNode.h" #include "AnimBlendNode.h"
@ -158,13 +158,3 @@ CAnimBlendNode::GetEndTranslation(CVector &trans, float weight)
trans = kf->translation * blend; trans = kf->translation * blend;
} }
} }
STARTPATCHES
InjectHook(0x401B10, &CAnimBlendNode::Init, PATCH_JUMP);
InjectHook(0x401B30, &CAnimBlendNode::Update, PATCH_JUMP);
InjectHook(0x401DC0, &CAnimBlendNode::NextKeyFrame, PATCH_JUMP);
InjectHook(0x4021B0, &CAnimBlendNode::FindKeyFrame, PATCH_JUMP);
InjectHook(0x401E70, &CAnimBlendNode::CalcDeltas, PATCH_JUMP);
InjectHook(0x401FE0, &CAnimBlendNode::GetCurrentTranslation, PATCH_JUMP);
InjectHook(0x402110, &CAnimBlendNode::GetEndTranslation, PATCH_JUMP);
ENDPATCHES

View File

@ -1,5 +1,5 @@
#include "common.h" #include "common.h"
#include "patcher.h"
#include "AnimBlendSequence.h" #include "AnimBlendSequence.h"
CAnimBlendSequence::CAnimBlendSequence(void) CAnimBlendSequence::CAnimBlendSequence(void)
@ -60,9 +60,3 @@ CAnimBlendSequence::RemoveQuaternionFlips(void)
last = frame->rotation; last = frame->rotation;
} }
} }
STARTPATCHES
InjectHook(0x402330, &CAnimBlendSequence::SetName, PATCH_JUMP);
InjectHook(0x402350, &CAnimBlendSequence::SetNumFrames, PATCH_JUMP);
InjectHook(0x4023A0, &CAnimBlendSequence::RemoveQuaternionFlips, PATCH_JUMP);
ENDPATCHES

View File

@ -1,5 +1,5 @@
#include "common.h" #include "common.h"
#include "patcher.h"
#include "General.h" #include "General.h"
#include "ModelInfo.h" #include "ModelInfo.h"
#include "ModelIndices.h" #include "ModelIndices.h"
@ -909,23 +909,3 @@ CAnimManager::RemoveLastAnimFile(void)
for(i = 0; i < ms_aAnimBlocks[ms_numAnimBlocks].numAnims; i++) for(i = 0; i < ms_aAnimBlocks[ms_numAnimBlocks].numAnims; i++)
ms_aAnimations[ms_aAnimBlocks[ms_numAnimBlocks].firstIndex + i].RemoveAnimSequences(); ms_aAnimations[ms_aAnimBlocks[ms_numAnimBlocks].firstIndex + i].RemoveAnimSequences();
} }
STARTPATCHES
InjectHook(0x403380, CAnimManager::Initialise, PATCH_JUMP);
InjectHook(0x4033B0, CAnimManager::Shutdown, PATCH_JUMP);
InjectHook(0x403410, CAnimManager::UncompressAnimation, PATCH_JUMP);
InjectHook(0x4034A0, CAnimManager::GetAnimationBlock, PATCH_JUMP);
InjectHook(0x4034F0, (CAnimBlendHierarchy *(*)(const char*, CAnimBlock*))CAnimManager::GetAnimation, PATCH_JUMP);
InjectHook(0x4035B0, CAnimManager::GetAnimGroupName, PATCH_JUMP);
InjectHook(0x4035C0, CAnimManager::CreateAnimAssociation, PATCH_JUMP);
InjectHook(0x4035E0, (CAnimBlendAssociation *(*)(AssocGroupId, AnimationId))CAnimManager::GetAnimAssociation, PATCH_JUMP);
InjectHook(0x403600, (CAnimBlendAssociation *(*)(AssocGroupId, const char*))CAnimManager::GetAnimAssociation, PATCH_JUMP);
InjectHook(0x403620, CAnimManager::AddAnimation, PATCH_JUMP);
InjectHook(0x4036A0, CAnimManager::AddAnimationAndSync, PATCH_JUMP);
InjectHook(0x403710, CAnimManager::BlendAnimation, PATCH_JUMP);
InjectHook(0x4038F0, CAnimManager::LoadAnimFiles, PATCH_JUMP);
InjectHook(0x403A10, (void (*)(const char *))CAnimManager::LoadAnimFile, PATCH_JUMP);
InjectHook(0x403A40, (void (*)(int, bool))CAnimManager::LoadAnimFile, PATCH_JUMP);
InjectHook(0x404320, CAnimManager::RemoveLastAnimFile, PATCH_JUMP);
ENDPATCHES

View File

@ -1,6 +1,6 @@
#define WITHWINDOWS // just for VK_SPACE #define WITHWINDOWS // just for VK_SPACE
#include "common.h" #include "common.h"
#include "patcher.h"
#include "General.h" #include "General.h"
#include "CutsceneMgr.h" #include "CutsceneMgr.h"
#include "Directory.h" #include "Directory.h"
@ -423,19 +423,3 @@ CCutsceneMgr::Update(void)
bool CCutsceneMgr::HasCutsceneFinished(void) { return TheCamera.GetPositionAlongSpline() == 1.0f; } bool CCutsceneMgr::HasCutsceneFinished(void) { return TheCamera.GetPositionAlongSpline() == 1.0f; }
STARTPATCHES
InjectHook(0x4045D0, &CCutsceneMgr::Initialise, PATCH_JUMP);
InjectHook(0x404630, &CCutsceneMgr::Shutdown, PATCH_JUMP);
InjectHook(0x404650, &CCutsceneMgr::LoadCutsceneData, PATCH_JUMP);
InjectHook(0x405140, &CCutsceneMgr::FinishCutscene, PATCH_JUMP);
InjectHook(0x404D80, &CCutsceneMgr::SetHeadAnim, PATCH_JUMP);
InjectHook(0x404DC0, &CCutsceneMgr::SetupCutsceneToStart, PATCH_JUMP);
InjectHook(0x404D20, &CCutsceneMgr::SetCutsceneAnim, PATCH_JUMP);
InjectHook(0x404CD0, &CCutsceneMgr::AddCutsceneHead, PATCH_JUMP);
InjectHook(0x404BE0, &CCutsceneMgr::CreateCutsceneObject, PATCH_JUMP);
InjectHook(0x4048E0, &CCutsceneMgr::DeleteCutsceneData, PATCH_JUMP);
InjectHook(0x404EE0, &CCutsceneMgr::Update, PATCH_JUMP);
InjectHook(0x4051B0, &CCutsceneMgr::GetCutsceneTimeInMilleseconds, PATCH_JUMP);
InjectHook(0x4051F0, &CCutsceneMgr::HasCutsceneFinished, PATCH_JUMP);
InjectHook(0x404B40, &CalculateBoundingSphereRadiusCB, PATCH_JUMP);
ENDPATCHES

View File

@ -28,6 +28,7 @@ public:
static void StartCutsceneProcessing() { ms_cutsceneProcessing = true; } static void StartCutsceneProcessing() { ms_cutsceneProcessing = true; }
static bool IsRunning(void) { return ms_running; } static bool IsRunning(void) { return ms_running; }
static bool HasLoaded(void) { return ms_loaded; }
static bool IsCutsceneProcessing(void) { return ms_cutsceneProcessing; } static bool IsCutsceneProcessing(void) { return ms_cutsceneProcessing; }
static bool UseLodMultiplier(void) { return ms_useLodMultiplier; } static bool UseLodMultiplier(void) { return ms_useLodMultiplier; }
static CCutsceneObject* GetCutsceneObject(int id) { return ms_pCutsceneObjects[id]; } static CCutsceneObject* GetCutsceneObject(int id) { return ms_pCutsceneObjects[id]; }

View File

@ -1,5 +1,5 @@
#include "common.h" #include "common.h"
#include "patcher.h"
#include "NodeName.h" #include "NodeName.h"
#include "VisibilityPlugins.h" #include "VisibilityPlugins.h"
#include "AnimBlendClumpData.h" #include "AnimBlendClumpData.h"
@ -220,9 +220,3 @@ FrameUpdateCallBackWith3dVelocityExtraction(AnimBlendFrameData *frame, void *arg
} }
RwMatrixUpdate(mat); RwMatrixUpdate(mat);
} }
STARTPATCHES
InjectHook(0x4025F0, FrameUpdateCallBack, PATCH_JUMP);
InjectHook(0x4028B0, FrameUpdateCallBackWithVelocityExtraction, PATCH_JUMP);
InjectHook(0x402D40, FrameUpdateCallBackWith3dVelocityExtraction, PATCH_JUMP);
ENDPATCHES

View File

@ -1,5 +1,5 @@
#include "common.h" #include "common.h"
#include "patcher.h"
#include "General.h" #include "General.h"
#include "NodeName.h" #include "NodeName.h"
#include "VisibilityPlugins.h" #include "VisibilityPlugins.h"
@ -8,7 +8,7 @@
#include "AnimBlendAssociation.h" #include "AnimBlendAssociation.h"
#include "RpAnimBlend.h" #include "RpAnimBlend.h"
RwInt32 &ClumpOffset = *(RwInt32*)0x8F1B84; RwInt32 ClumpOffset;
enum enum
{ {
@ -378,26 +378,3 @@ RpAnimBlendClumpUpdateAnimations(RpClump *clump, float timeDelta)
} }
RwFrameUpdateObjects(RpClumpGetFrame(clump)); RwFrameUpdateObjects(RpClumpGetFrame(clump));
} }
STARTPATCHES
InjectHook(0x4052D0, RpAnimBlendPluginAttach, PATCH_JUMP);
InjectHook(0x4052A0, RpAnimBlendAllocateData, PATCH_JUMP);
InjectHook(0x405780, (CAnimBlendAssociation *(*)(CAnimBlendAssociation*))RpAnimBlendGetNextAssociation, PATCH_JUMP);
InjectHook(0x4057A0, (CAnimBlendAssociation *(*)(CAnimBlendAssociation*,uint32))RpAnimBlendGetNextAssociation, PATCH_JUMP);
InjectHook(0x405520, RpAnimBlendClumpSetBlendDeltas, PATCH_JUMP);
InjectHook(0x405560, RpAnimBlendClumpRemoveAllAssociations, PATCH_JUMP);
InjectHook(0x405570, RpAnimBlendClumpRemoveAssociations, PATCH_JUMP);
InjectHook(0x405480, RpAnimBlendClumpInit, PATCH_JUMP);
InjectHook(0x405500, RpAnimBlendClumpIsInitialized, PATCH_JUMP);
InjectHook(0x4055C0, RpAnimBlendClumpGetAssociation, PATCH_JUMP);
InjectHook(0x4055F0, RpAnimBlendClumpGetMainAssociation, PATCH_JUMP);
InjectHook(0x405680, RpAnimBlendClumpGetMainPartialAssociation, PATCH_JUMP);
InjectHook(0x4056D0, RpAnimBlendClumpGetMainAssociation_N, PATCH_JUMP);
InjectHook(0x405710, RpAnimBlendClumpGetMainPartialAssociation_N, PATCH_JUMP);
InjectHook(0x405750, (CAnimBlendAssociation *(*)(RpClump*, uint32))RpAnimBlendClumpGetFirstAssociation, PATCH_JUMP);
InjectHook(0x4031B0, (CAnimBlendAssociation *(*)(RpClump*))RpAnimBlendClumpGetFirstAssociation, PATCH_JUMP);
InjectHook(0x405460, RpAnimBlendClumpFillFrameArray, PATCH_JUMP);
InjectHook(0x4024B0, RpAnimBlendClumpUpdateAnimations, PATCH_JUMP);
ENDPATCHES

View File

@ -11,7 +11,7 @@ struct AnimBlendFrameUpdateData
CAnimBlendNode *nodes[16]; CAnimBlendNode *nodes[16];
}; };
extern RwInt32 &ClumpOffset; extern RwInt32 ClumpOffset;
#define RPANIMBLENDCLUMPDATA(o) (RWPLUGINOFFSET(CAnimBlendClumpData*, o, ClumpOffset)) #define RPANIMBLENDCLUMPDATA(o) (RWPLUGINOFFSET(CAnimBlendClumpData*, o, ClumpOffset))
bool RpAnimBlendPluginAttach(void); bool RpAnimBlendPluginAttach(void);

View File

@ -1,5 +1,5 @@
#include "common.h" #include "common.h"
#include "patcher.h"
#include "DMAudio.h" #include "DMAudio.h"
#include "Entity.h" #include "Entity.h"
#include "AudioCollision.h" #include "AudioCollision.h"
@ -406,14 +406,3 @@ cAudioManager::ReportCollision(CEntity *entity1, CEntity *entity2, uint8 surface
m_sCollisionManager.AddCollisionToRequestedQueue(); m_sCollisionManager.AddCollisionToRequestedQueue();
} }
} }
STARTPATCHES
InjectHook(0x5685E0, &cAudioCollisionManager::AddCollisionToRequestedQueue, PATCH_JUMP);
InjectHook(0x569060, &cAudioManager::GetCollisionOneShotRatio, PATCH_JUMP);
InjectHook(0x5693B0, &cAudioManager::GetCollisionRatio, PATCH_JUMP);
InjectHook(0x568410, &cAudioManager::ReportCollision, PATCH_JUMP);
InjectHook(0x5686D0, &cAudioManager::ServiceCollisions, PATCH_JUMP);
InjectHook(0x568E20, &cAudioManager::SetLoopingCollisionRequestedSfxFreqAndGetVol, PATCH_JUMP);
InjectHook(0x568D30, &cAudioManager::SetUpLoopingCollisionSound, PATCH_JUMP);
InjectHook(0x5689D0, &cAudioManager::SetUpOneShotCollisionSound, PATCH_JUMP);
ENDPATCHES

View File

@ -1,5 +1,5 @@
#include "common.h" #include "common.h"
#include "patcher.h"
#include "audio_enums.h" #include "audio_enums.h"
#include "AudioManager.h" #include "AudioManager.h"
@ -40,18 +40,18 @@
#include "sampman.h" #include "sampman.h"
cAudioManager AudioManager; cAudioManager AudioManager;
uint32 gPornNextTime; // = *(uint32*)0x6508A0; uint32 gPornNextTime;
uint32 gSawMillNextTime; // = *(uint32*)0x6508A4; uint32 gSawMillNextTime;
uint32 gShopNextTime; // = *(uint32*)0x6508A8; uint32 gShopNextTime;
uint32 gAirportNextTime; // = *(uint32*)0x6508AC; uint32 gAirportNextTime;
uint32 gCinemaNextTime; //= *(uint32*)0x6508B0; uint32 gCinemaNextTime;
uint32 gDocksNextTime; // = *(uint32*)0x6508B4; uint32 gDocksNextTime;
uint32 gHomeNextTime; // = *(uint32*)0x6508B8; uint32 gHomeNextTime;
uint32 gCellNextTime; // = *(uint32*)0x6508BC; uint32 gCellNextTime;
uint32 gNextCryTime; // = *(uint32*)0x6508C0; uint32 gNextCryTime;
uint8 gJumboVolOffsetPercentage; // = *(uint8 *)0x6508ED; uint8 gJumboVolOffsetPercentage;
bool bPlayerJustEnteredCar; // = *(bool *)0x6508C4; bool bPlayerJustEnteredCar;
bool g_bMissionAudioLoadFailed; // = *(bool *)0x95CD8E; bool g_bMissionAudioLoadFailed;
const int channels = ARRAY_SIZE(cAudioManager::m_asActiveSamples); const int channels = ARRAY_SIZE(cAudioManager::m_asActiveSamples);
const int policeChannel = channels + 1; const int policeChannel = channels + 1;
@ -10147,217 +10147,3 @@ cAudioManager::ComputeEmittingVolume(uint8 emittingVolume, float intensity, floa
quatIntensity; quatIntensity;
return emittingVolume; return emittingVolume;
} }
// STARTPATCHES
// InjectHook(0x57B210, &cAudioManager::AddDetailsToRequestedOrderList, PATCH_JUMP);
// InjectHook(0x56AD30, &cAudioManager::AddPlayerCarSample, PATCH_JUMP);
// InjectHook(0x57B300, &cAudioManager::AddReflectionsToRequestedQueue, PATCH_JUMP);
// InjectHook(0x57B8D0, &cAudioManager::AddReleasingSounds, PATCH_JUMP);
// InjectHook(0x57B070, &cAudioManager::AddSampleToRequestedQueue, PATCH_JUMP);
// InjectHook(0x5697A0, &cAudioManager::CalculateDistance, PATCH_JUMP);
// InjectHook(0x57AA10, &cAudioManager::CheckForAnAudioFileOnCD, PATCH_JUMP);
// InjectHook(0x57C160, &cAudioManager::ClearActiveSamples, PATCH_JUMP);
// InjectHook(0x5796A0, &cAudioManager::ClearMissionAudio, PATCH_JUMP);
// InjectHook(0x57C120, &cAudioManager::ClearRequestedQueue, PATCH_JUMP);
// InjectHook(0x57AE00, &cAudioManager::ComputeDopplerEffectedFrequency, PATCH_JUMP);
// InjectHook(0x57AD20, &cAudioManager::ComputePan, PATCH_JUMP);
// InjectHook(0x57ABB0, &cAudioManager::ComputeVolume, PATCH_JUMP);
// InjectHook(0x57A310, &cAudioManager::CreateEntity, PATCH_JUMP);
// InjectHook(0x57A830, &cAudioManager::DestroyAllGameCreatedEntities, PATCH_JUMP);
// InjectHook(0x57A400, &cAudioManager::DestroyEntity, PATCH_JUMP);
// InjectHook(0x57C290, &cAudioManager::GenerateIntegerRandomNumberTable, PATCH_JUMP);
// InjectHook(0x57A8C0, &cAudioManager::Get3DProviderName, PATCH_JUMP);
// InjectHook(0x571110, &cAudioManager::GetArmyTalkSfx, PATCH_JUMP);
// InjectHook(0x573AB0, &cAudioManager::GetBlackBusinessFemaleTalkSfx, PATCH_JUMP);
// InjectHook(0x572050, &cAudioManager::GetBlackCasualFemaleTalkSfx, PATCH_JUMP);
// InjectHook(0x574380, &cAudioManager::GetBlackConstructionWorkerTalkSfx, PATCH_JUMP);
// InjectHook(0x571D80, &cAudioManager::GetBlackCriminalTalkSfx, PATCH_JUMP);
// InjectHook(0x5735E0, &cAudioManager::GetBlackDockerMaleTalkSfx, PATCH_JUMP);
// InjectHook(0x5724D0, &cAudioManager::GetBlackFatFemaleTalkSfx, PATCH_JUMP);
// InjectHook(0x5726C0, &cAudioManager::GetBlackFatMaleTalkSfx, PATCH_JUMP);
// InjectHook(0x5728B0, &cAudioManager::GetBlackFemaleProstituteTalkSfx, PATCH_JUMP);
// InjectHook(0x572C20, &cAudioManager::GetBlackProjectFemaleOldTalkSfx, PATCH_JUMP);
// InjectHook(0x572D20, &cAudioManager::GetBlackProjectFemaleYoungTalkSfx, PATCH_JUMP);
// InjectHook(0x572AF0, &cAudioManager::GetBlackProjectMaleTalkSfx, PATCH_JUMP);
// InjectHook(0x5739C0, &cAudioManager::GetBlackWorkerMaleTalkSfx, PATCH_JUMP);
// InjectHook(0x574FF0, &cAudioManager::GetBomberTalkSfx, PATCH_JUMP);
// InjectHook(0x5712C0, &cAudioManager::GetBusinessMaleOldTalkSfx, PATCH_JUMP);
// InjectHook(0x5713E0, &cAudioManager::GetBusinessMaleYoungTalkSfx, PATCH_JUMP);
// InjectHook(0x572040, &cAudioManager::GetCasualMaleOldTalkSfx, PATCH_JUMP);
// InjectHook(0x574FE0, &cAudioManager::GetCatatalinaTalkSfx, PATCH_JUMP);
// InjectHook(0x57AA30, &cAudioManager::GetCDAudioDriveLetter, PATCH_JUMP);
// InjectHook(0x573010, &cAudioManager::GetChinatownFemaleOldTalkSfx, PATCH_JUMP);
// InjectHook(0x5730F0, &cAudioManager::GetChinatownFemaleYoungTalkSfx, PATCH_JUMP);
// InjectHook(0x572E10, &cAudioManager::GetChinatownMaleOldTalkSfx, PATCH_JUMP);
// InjectHook(0x572F10, &cAudioManager::GetChinatownMaleYoungTalkSfx, PATCH_JUMP);
// InjectHook(0x575120, &cAudioManager::GetChunkyTalkSfx, PATCH_JUMP);
// InjectHook(0x571B00, &cAudioManager::GetColumbianTalkSfx, PATCH_JUMP);
// InjectHook(0x570EA0, &cAudioManager::GetCopTalkSfx, PATCH_JUMP);
// InjectHook(0x57A8F0, &cAudioManager::GetCurrent3DProviderIndex, PATCH_JUMP);
// InjectHook(0x571770, &cAudioManager::GetDiabloTalkSfx, PATCH_JUMP);
// InjectHook(0x569750, &cAudioManager::GetDistanceSquared, PATCH_JUMP);
// InjectHook(0x574DA0, &cAudioManager::GetEightTalkSfx, PATCH_JUMP);
// InjectHook(0x574040, &cAudioManager::GetFanFemaleTalkSfx, PATCH_JUMP);
// InjectHook(0x573F60, &cAudioManager::GetFanMaleTalkSfx, PATCH_JUMP);
// InjectHook(0x571040, &cAudioManager::GetFBITalkSfx, PATCH_JUMP);
// InjectHook(0x572280, &cAudioManager::GetFemaleNo3TalkSfx, PATCH_JUMP);
// InjectHook(0x5712B0, &cAudioManager::GetFiremanTalkSfx, PATCH_JUMP);
// InjectHook(0x574E50, &cAudioManager::GetFrankieTalkSfx, PATCH_JUMP);
// InjectHook(0x575510, &cAudioManager::GetGenericFemaleTalkSfx, PATCH_JUMP);
// InjectHook(0x575460, &cAudioManager::GetGenericMaleTalkSfx, PATCH_JUMP);
// InjectHook(0x571C30, &cAudioManager::GetHoodTalkSfx, PATCH_JUMP);
// InjectHook(0x5741F0, &cAudioManager::GetHospitalFemaleTalkSfx, PATCH_JUMP);
// InjectHook(0x574120, &cAudioManager::GetHospitalMaleTalkSfx, PATCH_JUMP);
// InjectHook(0x56F410, &cAudioManager::GetJumboTaxiFreq, PATCH_JUMP);
// InjectHook(0x573310, &cAudioManager::GetLittleItalyFemaleOldTalkSfx, PATCH_JUMP);
// InjectHook(0x573400, &cAudioManager::GetLittleItalyFemaleYoungTalkSfx, PATCH_JUMP);
// InjectHook(0x5731E0, &cAudioManager::GetLittleItalyMaleTalkSfx, PATCH_JUMP);
// InjectHook(0x571510, &cAudioManager::GetMafiaTalkSfx, PATCH_JUMP);
// InjectHook(0x571F40, &cAudioManager::GetMaleNo2TalkSfx, PATCH_JUMP);
// InjectHook(0x5711C0, &cAudioManager::GetMedicTalkSfx, PATCH_JUMP);
// InjectHook(0x5795D0, &cAudioManager::GetMissionAudioLoadingStatus, PATCH_JUMP);
// InjectHook(0x574F00, &cAudioManager::GetMistyTalkSfx, PATCH_JUMP);
// InjectHook(0x575340, &cAudioManager::GetNormalMaleTalkSfx, PATCH_JUMP);
// InjectHook(0x57A8A0, &cAudioManager::GetNum3DProvidersAvailable, PATCH_JUMP);
// InjectHook(0x574FD0, &cAudioManager::GetOJGTalkSfx, PATCH_JUMP);
// InjectHook(0x570960, &cAudioManager::GetPedCommentSfx, PATCH_JUMP);
// InjectHook(0x570DB0, &cAudioManager::GetPhrase, PATCH_JUMP);
// InjectHook(0x56BF80, &cAudioManager::GetVehicleDriveWheelSkidValue, PATCH_JUMP);
// InjectHook(0x56C120, &cAudioManager::GetVehicleNonDriveWheelSkidValue, PATCH_JUMP);
// InjectHook(0x575240, &cAudioManager::GetPimpTalkSfx, PATCH_JUMP);
// InjectHook(0x570E00, &cAudioManager::GetPlayerTalkSfx, PATCH_JUMP);
// InjectHook(0x5737E0, &cAudioManager::GetScumFemaleTalkSfx, PATCH_JUMP);
// InjectHook(0x5736D0, &cAudioManager::GetScumMaleTalkSfx, PATCH_JUMP);
// InjectHook(0x575060, &cAudioManager::GetSecurityGuardTalkSfx, PATCH_JUMP);
// InjectHook(0x574480, &cAudioManager::GetShopperFemaleTalkSfx, PATCH_JUMP);
// InjectHook(0x574790, &cAudioManager::GetSpecialCharacterTalkSfx, PATCH_JUMP);
// InjectHook(0x573E90, &cAudioManager::GetStewardFemaleTalkSfx, PATCH_JUMP);
// InjectHook(0x573DC0, &cAudioManager::GetStewardMaleTalkSfx, PATCH_JUMP);
// InjectHook(0x574690, &cAudioManager::GetStudentFemaleTalkSfx, PATCH_JUMP);
// InjectHook(0x574590, &cAudioManager::GetStudentMaleTalkSfx, PATCH_JUMP);
// InjectHook(0x573CD0, &cAudioManager::GetSupermodelFemaleTalkSfx, PATCH_JUMP);
// InjectHook(0x573BD0, &cAudioManager::GetSupermodelMaleTalkSfx, PATCH_JUMP);
// InjectHook(0x570F80, &cAudioManager::GetSwatTalkSfx, PATCH_JUMP);
// InjectHook(0x575190, &cAudioManager::GetTaxiDriverTalkSfx, PATCH_JUMP);
// InjectHook(0x571650, &cAudioManager::GetTriadTalkSfx, PATCH_JUMP);
// InjectHook(0x5723A0, &cAudioManager::GetWhiteBusinessFemaleTalkSfx, PATCH_JUMP);
// InjectHook(0x572170, &cAudioManager::GetWhiteCasualFemaleTalkSfx, PATCH_JUMP);
// InjectHook(0x574290, &cAudioManager::GetWhiteConstructionWorkerTalkSfx, PATCH_JUMP);
// InjectHook(0x571E60, &cAudioManager::GetWhiteCriminalTalkSfx, PATCH_JUMP);
// InjectHook(0x5734F0, &cAudioManager::GetWhiteDockerMaleTalkSfx, PATCH_JUMP);
// InjectHook(0x5727B0, &cAudioManager::GetWhiteFatFemaleTalkSfx, PATCH_JUMP);
// InjectHook(0x5725D0, &cAudioManager::GetWhiteFatMaleTalkSfx, PATCH_JUMP);
// InjectHook(0x5729D0, &cAudioManager::GetWhiteFemaleProstituteTalkSfx, PATCH_JUMP);
// InjectHook(0x5738D0, &cAudioManager::GetWhiteWorkerMaleTalkSfx, PATCH_JUMP);
// InjectHook(0x5718D0, &cAudioManager::GetYakuzaTalkSfx, PATCH_JUMP);
// InjectHook(0x5719E0, &cAudioManager::GetYardieTalkSfx, PATCH_JUMP);
// InjectHook(0x56CAB0, &cAudioManager::HasAirBrakes, PATCH_JUMP);
// InjectHook(0x57A0E0, &cAudioManager::Initialise, PATCH_JUMP);
// InjectHook(0x57B030, &cAudioManager::InterrogateAudioEntities, PATCH_JUMP);
// InjectHook(0x57AA50, &cAudioManager::IsAudioInitialised, PATCH_JUMP);
// InjectHook(0x579650, &cAudioManager::IsMissionAudioSampleFinished, PATCH_JUMP);
// InjectHook(0x57A9C0, &cAudioManager::IsMP3RadioChannelAvailable, PATCH_JUMP);
// InjectHook(0x579520, &cAudioManager::MissionScriptAudioUsesPoliceChannel, PATCH_JUMP);
// InjectHook(0x56AD10, &cAudioManager::PlayerJustGotInCar, PATCH_JUMP);
// InjectHook(0x56AD20, &cAudioManager::PlayerJustLeftCar, PATCH_JUMP);
// InjectHook(0x579620, &cAudioManager::PlayLoadedMissionAudio, PATCH_JUMP);
// InjectHook(0x57A500, &cAudioManager::PlayOneShot, PATCH_JUMP);
// InjectHook(0x569420, &cAudioManager::PostInitialiseGameSpecificSetup, PATCH_JUMP);
// InjectHook(0x569640, &cAudioManager::PostTerminateGameSpecificShutdown, PATCH_JUMP);
// InjectHook(0x569400, &cAudioManager::PreInitialiseGameSpecificSetup, PATCH_JUMP);
// InjectHook(0x579550, &cAudioManager::PreloadMissionAudio, PATCH_JUMP);
// InjectHook(0x569570, &cAudioManager::PreTerminateGameSpecificShutdown, PATCH_JUMP);
// InjectHook(0x57BA60, &cAudioManager::ProcessActiveQueues, PATCH_JUMP);
// InjectHook(0x56C940, &cAudioManager::ProcessAirBrakes, PATCH_JUMP);
// InjectHook(0x577B30, &cAudioManager::ProcessAirportScriptObject, PATCH_JUMP);
// InjectHook(0x56DE80, &cAudioManager::ProcessBoatEngine, PATCH_JUMP);
// InjectHook(0x56E500, &cAudioManager::ProcessBoatMovingOverWater, PATCH_JUMP);
// InjectHook(0x5790D0, &cAudioManager::ProcessBridge, PATCH_JUMP);
// InjectHook(0x579250, &cAudioManager::ProcessBridgeMotor, PATCH_JUMP);
// InjectHook(0x579310, &cAudioManager::ProcessBridgeOneShots, PATCH_JUMP);
// InjectHook(0x579170, &cAudioManager::ProcessBridgeWarning, PATCH_JUMP);
// InjectHook(0x56CC20, &cAudioManager::ProcessCarBombTick, PATCH_JUMP);
// InjectHook(0x577CA0, &cAudioManager::ProcessCinemaScriptObject, PATCH_JUMP);
// InjectHook(0x577E50, &cAudioManager::ProcessDocksScriptObject, PATCH_JUMP);
// InjectHook(0x56CAF0, &cAudioManager::ProcessEngineDamage, PATCH_JUMP);
// InjectHook(0x569870, &cAudioManager::ProcessEntity, PATCH_JUMP);
// InjectHook(0x575AC0, &cAudioManager::ProcessExplosions, PATCH_JUMP);
// InjectHook(0x578FD0, &cAudioManager::ProcessFireHydrant, PATCH_JUMP);
// InjectHook(0x5785E0, &cAudioManager::ProcessFrontEnd, PATCH_JUMP);
// InjectHook(0x56E6A0, &cAudioManager::ProcessHelicopter, PATCH_JUMP);
// InjectHook(0x577FE0, &cAudioManager::ProcessHomeScriptObject, PATCH_JUMP);
// InjectHook(0x56E8F0, &cAudioManager::ProcessJumbo, PATCH_JUMP);
// InjectHook(0x56EA40, &cAudioManager::ProcessJumboAccel, PATCH_JUMP);
// InjectHook(0x56EE40, &cAudioManager::ProcessJumboDecel, PATCH_JUMP);
// InjectHook(0x56ECF0, &cAudioManager::ProcessJumboFlying, PATCH_JUMP);
// InjectHook(0x56ED10, &cAudioManager::ProcessJumboLanding, PATCH_JUMP);
// InjectHook(0x56EC00, &cAudioManager::ProcessJumboTakeOff, PATCH_JUMP);
// InjectHook(0x56EA10, &cAudioManager::ProcessJumboTaxi, PATCH_JUMP);
// InjectHook(0x5777E0, &cAudioManager::ProcessLaunderetteScriptObject, PATCH_JUMP);
// InjectHook(0x576770, &cAudioManager::ProcessLoopingScriptObject, PATCH_JUMP);
// InjectHook(0x5796E0, &cAudioManager::ProcessMissionAudio, PATCH_JUMP);
// InjectHook(0x56A050, &cAudioManager::ProcessModelCarEngine, PATCH_JUMP);
// InjectHook(0x5760C0, &cAudioManager::ProcessOneShotScriptObject, PATCH_JUMP);
// InjectHook(0x56F450, &cAudioManager::ProcessPed, PATCH_JUMP);
// InjectHook(0x56F4D0, &cAudioManager::ProcessPedHeadphones, PATCH_JUMP);
// InjectHook(0x56F650, &cAudioManager::ProcessPedOneShots, PATCH_JUMP);
// InjectHook(0x5699C0, &cAudioManager::ProcessPhysical, PATCH_JUMP);
// InjectHook(0x56E860, &cAudioManager::ProcessPlane, PATCH_JUMP);
// InjectHook(0x56B0D0, &cAudioManager::ProcessPlayersVehicleEngine, PATCH_JUMP);
// InjectHook(0x578190, &cAudioManager::ProcessPoliceCellBeatingScriptObject, PATCH_JUMP);
// InjectHook(0x577280, &cAudioManager::ProcessPornCinema, PATCH_JUMP);
// InjectHook(0x578A80, &cAudioManager::ProcessProjectiles, PATCH_JUMP);
// InjectHook(0x569CC0, &cAudioManager::ProcessRainOnVehicle, PATCH_JUMP);
// InjectHook(0x569700, &cAudioManager::ProcessReverb, PATCH_JUMP);
// InjectHook(0x569E50, &cAudioManager::ProcessReverseGear, PATCH_JUMP);
// InjectHook(0x577630, &cAudioManager::ProcessSawMillScriptObject, PATCH_JUMP);
// InjectHook(0x576070, &cAudioManager::ProcessScriptObject, PATCH_JUMP);
// InjectHook(0x577970, &cAudioManager::ProcessShopScriptObject, PATCH_JUMP);
// InjectHook(0x5697D0, &cAudioManager::ProcessSpecial, PATCH_JUMP);
// InjectHook(0x56DBF0, &cAudioManager::ProcessTrainNoise, PATCH_JUMP);
// InjectHook(0x569A00, &cAudioManager::ProcessVehicle, PATCH_JUMP);
// InjectHook(0x56C770, &cAudioManager::ProcessVehicleDoors, PATCH_JUMP);
// InjectHook(0x56C200, &cAudioManager::ProcessVehicleHorn, PATCH_JUMP);
// InjectHook(0x56C640, &cAudioManager::ProcessVehicleReverseWarning, PATCH_JUMP);
// InjectHook(0x56A230, &cAudioManager::ProcessVehicleRoadNoise, PATCH_JUMP);
// InjectHook(0x56C420, &cAudioManager::ProcessVehicleSirenOrAlarm, PATCH_JUMP);
// InjectHook(0x56BCB0, &cAudioManager::ProcessVehicleSkidding, PATCH_JUMP);
// InjectHook(0x575F30, &cAudioManager::ProcessWaterCannon, PATCH_JUMP);
// InjectHook(0x578370, &cAudioManager::ProcessWeather, PATCH_JUMP);
// InjectHook(0x56A440, &cAudioManager::ProcessWetRoadNoise, PATCH_JUMP);
// InjectHook(0x577530, &cAudioManager::ProcessWorkShopScriptObject, PATCH_JUMP);
// InjectHook(0x57AF90, &cAudioManager::RandomDisplacement, PATCH_JUMP);
// InjectHook(0x57A9F0, &cAudioManager::ReacquireDigitalHandle, PATCH_JUMP);
// InjectHook(0x57A9E0, &cAudioManager::ReleaseDigitalHandle, PATCH_JUMP);
// InjectHook(0x569650, &cAudioManager::ResetAudioLogicTimers, PATCH_JUMP);
// InjectHook(0x57A7B0, &cAudioManager::ResetTimers, PATCH_JUMP);
// InjectHook(0x57A2A0, &cAudioManager::Service, PATCH_JUMP);
// InjectHook(0x57AA60, &cAudioManager::ServiceSoundEffects, PATCH_JUMP);
// InjectHook(0x57A910, &cAudioManager::SetCurrent3DProvider, PATCH_JUMP);
// InjectHook(0x57AA00, &cAudioManager::SetDynamicAcousticModelingStatus, PATCH_JUMP);
// InjectHook(0x57A770, &cAudioManager::SetEffectsFadeVolume, PATCH_JUMP);
// InjectHook(0x57A730, &cAudioManager::SetEffectsMasterVolume, PATCH_JUMP);
// InjectHook(0x57A4C0, &cAudioManager::SetEntityStatus, PATCH_JUMP);
// InjectHook(0x5795F0, &cAudioManager::SetMissionAudioLocation, PATCH_JUMP);
// InjectHook(0x57A790, &cAudioManager::SetMusicFadeVolume, PATCH_JUMP);
// InjectHook(0x57A750, &cAudioManager::SetMusicMasterVolume, PATCH_JUMP);
// InjectHook(0x57A9A0, &cAudioManager::SetSpeakerConfig, PATCH_JUMP);
// InjectHook(0x56F230, &cAudioManager::SetupJumboFlySound, PATCH_JUMP);
// InjectHook(0x56F310, &cAudioManager::SetupJumboRumbleSound, PATCH_JUMP);
// InjectHook(0x56EF20, &cAudioManager::SetupJumboTaxiSound, PATCH_JUMP);
// InjectHook(0x56F070, &cAudioManager::SetupJumboWhineSound, PATCH_JUMP);
// InjectHook(0x570690, &cAudioManager::SetupPedComments, PATCH_JUMP);
// InjectHook(0x57A150, &cAudioManager::Terminate, PATCH_JUMP);
// InjectHook(0x57AC60, &cAudioManager::TranslateEntity, PATCH_JUMP);
// InjectHook(0x56AC80, &cAudioManager::UpdateGasPedalAudio, PATCH_JUMP);
// InjectHook(0x57B470, &cAudioManager::UpdateReflections, PATCH_JUMP);
// InjectHook(0x56C600, &cAudioManager::UsesReverseWarning, PATCH_JUMP);
// InjectHook(0x56C3C0, &cAudioManager::UsesSiren, PATCH_JUMP);
// InjectHook(0x56C3F0, &cAudioManager::UsesSirenSwitching, PATCH_JUMP);
// InjectHook(0x57C2B0, &cAudioManager::AdjustSamplesVolume, PATCH_JUMP);
// InjectHook(0x57C320, &cAudioManager::ComputeEmittingVolume, PATCH_JUMP);
// InjectHook(0x5755C0, &cPedComments::Add, PATCH_JUMP);
// InjectHook(0x575730, &cPedComments::Process, PATCH_JUMP);
// ENDPATCHES

View File

@ -1,5 +1,5 @@
#include "common.h" #include "common.h"
#include "patcher.h"
#include "AudioScriptObject.h" #include "AudioScriptObject.h"
#include "Pools.h" #include "Pools.h"
#include "DMAudio.h" #include "DMAudio.h"
@ -86,10 +86,3 @@ PlayOneShotScriptObject(uint8 id, CVector const &pos)
audioScriptObject->AudioEntity = AEHANDLE_NONE; audioScriptObject->AudioEntity = AEHANDLE_NONE;
DMAudio.CreateOneShotScriptObject(audioScriptObject); DMAudio.CreateOneShotScriptObject(audioScriptObject);
} }
STARTPATCHES
InjectHook(0x57C430, &cAudioScriptObject::Reset, PATCH_JUMP);
InjectHook(0x57C5F0, &PlayOneShotScriptObject, PATCH_JUMP);
InjectHook(0x57C560, &cAudioScriptObject::LoadAllAudioScriptObjects, PATCH_JUMP);
InjectHook(0x57c460, &cAudioScriptObject::SaveAllAudioScriptObjects, PATCH_JUMP);
ENDPATCHES

View File

@ -1,12 +1,12 @@
#include "common.h" #include "common.h"
#include "patcher.h"
#include "DMAudio.h" #include "DMAudio.h"
#include "MusicManager.h" #include "MusicManager.h"
#include "AudioManager.h" #include "AudioManager.h"
#include "AudioScriptObject.h" #include "AudioScriptObject.h"
#include "sampman.h" #include "sampman.h"
cDMAudio &DMAudio = *(cDMAudio*)0x95CDBE; cDMAudio DMAudio;
void void
cDMAudio::Initialise(void) cDMAudio::Initialise(void)
@ -318,57 +318,3 @@ cDMAudio::SetRadioChannel(int8 radio, int32 pos)
{ {
MusicManager.SetRadioChannelByScript(radio, pos); MusicManager.SetRadioChannelByScript(radio, pos);
} }
STARTPATCHES
InjectHook(0x57C760, &cDMAudio::Initialise, PATCH_JUMP);
InjectHook(0x57C780, &cDMAudio::Terminate, PATCH_JUMP);
InjectHook(0x57C7A0, &cDMAudio::Service, PATCH_JUMP);
InjectHook(0x57C7C0, &cDMAudio::CreateEntity, PATCH_JUMP);
InjectHook(0x57C7F0, &cDMAudio::DestroyEntity, PATCH_JUMP);
InjectHook(0x57C810, &cDMAudio::SetEntityStatus, PATCH_JUMP);
InjectHook(0x57C840, &cDMAudio::PlayOneShot, PATCH_JUMP);
InjectHook(0x57C870, &cDMAudio::DestroyAllGameCreatedEntities, PATCH_JUMP);
InjectHook(0x57C890, &cDMAudio::SetEffectsMasterVolume, PATCH_JUMP);
InjectHook(0x57C8C0, &cDMAudio::SetMusicMasterVolume, PATCH_JUMP);
InjectHook(0x57C8F0, &cDMAudio::SetEffectsFadeVol, PATCH_JUMP);
InjectHook(0x57C920, &cDMAudio::SetMusicFadeVol, PATCH_JUMP);
InjectHook(0x57C950, &cDMAudio::GetNum3DProvidersAvailable, PATCH_JUMP);
InjectHook(0x57C970, &cDMAudio::Get3DProviderName, PATCH_JUMP);
InjectHook(0x57C990, &cDMAudio::GetCurrent3DProviderIndex, PATCH_JUMP);
InjectHook(0x57C9B0, &cDMAudio::SetCurrent3DProvider, PATCH_JUMP);
InjectHook(0x57C9D0, &cDMAudio::SetSpeakerConfig, PATCH_JUMP);
InjectHook(0x57C9F0, &cDMAudio::IsMP3RadioChannelAvailable, PATCH_JUMP);
InjectHook(0x57CA10, &cDMAudio::ReleaseDigitalHandle, PATCH_JUMP);
InjectHook(0x57CA30, &cDMAudio::ReacquireDigitalHandle, PATCH_JUMP);
InjectHook(0x57CA50, &cDMAudio::SetDynamicAcousticModelingStatus, PATCH_JUMP);
InjectHook(0x57CA70, &cDMAudio::CheckForAnAudioFileOnCD, PATCH_JUMP);
InjectHook(0x57CA90, &cDMAudio::GetCDAudioDriveLetter, PATCH_JUMP);
InjectHook(0x57CAB0, &cDMAudio::IsAudioInitialised, PATCH_JUMP);
InjectHook(0x57CAD0, &cDMAudio::ReportCrime, PATCH_JUMP);
InjectHook(0x57CB00, &cDMAudio::CreateLoopingScriptObject, PATCH_JUMP);
InjectHook(0x57CB40, &cDMAudio::DestroyLoopingScriptObject, PATCH_JUMP);
InjectHook(0x57CB60, &cDMAudio::CreateOneShotScriptObject, PATCH_JUMP);
InjectHook(0x57CBB0, &cDMAudio::PlaySuspectLastSeen, PATCH_JUMP);
InjectHook(0x57CBE0, &cDMAudio::ReportCollision, PATCH_JUMP);
InjectHook(0x57CC20, &cDMAudio::PlayFrontEndSound, PATCH_JUMP);
InjectHook(0x57CC60, &cDMAudio::PlayRadioAnnouncement, PATCH_JUMP);
InjectHook(0x57CC80, &cDMAudio::PlayFrontEndTrack, PATCH_JUMP);
InjectHook(0x57CCB0, &cDMAudio::StopFrontEndTrack, PATCH_JUMP);
InjectHook(0x57CCD0, &cDMAudio::ResetTimers, PATCH_JUMP);
InjectHook(0x57CCF0, &cDMAudio::ChangeMusicMode, PATCH_JUMP);
InjectHook(0x57CD10, &cDMAudio::PreloadCutSceneMusic, PATCH_JUMP);
InjectHook(0x57CD30, &cDMAudio::PlayPreloadedCutSceneMusic, PATCH_JUMP);
InjectHook(0x57CD50, &cDMAudio::StopCutSceneMusic, PATCH_JUMP);
InjectHook(0x57CD70, &cDMAudio::PreloadMissionAudio, PATCH_JUMP);
InjectHook(0x57CD90, &cDMAudio::GetMissionAudioLoadingStatus, PATCH_JUMP);
InjectHook(0x57CDB0, &cDMAudio::SetMissionAudioLocation, PATCH_JUMP);
InjectHook(0x57CDE0, &cDMAudio::PlayLoadedMissionAudio, PATCH_JUMP);
InjectHook(0x57CE00, &cDMAudio::IsMissionAudioSampleFinished, PATCH_JUMP);
InjectHook(0x57CE20, &cDMAudio::ClearMissionAudio, PATCH_JUMP);
InjectHook(0x57CE40, &cDMAudio::GetRadioInCar, PATCH_JUMP);
InjectHook(0x57CE60, &cDMAudio::SetRadioInCar, PATCH_JUMP);
InjectHook(0x57CE80, &cDMAudio::SetRadioChannel, PATCH_JUMP);
//InjectHook(0x57CEB0, `global constructor keyed to'dmaudio.cpp, PATCH_JUMP);
//InjectHook(0x57CED0, cDMAudio::~cDMAudio, PATCH_JUMP);
ENDPATCHES

View File

@ -256,4 +256,4 @@ public:
void SetRadioInCar(uint32 radio); void SetRadioInCar(uint32 radio);
void SetRadioChannel(int8 radio, int32 pos); void SetRadioChannel(int8 radio, int32 pos);
}; };
extern cDMAudio &DMAudio; extern cDMAudio DMAudio;

View File

@ -13,7 +13,7 @@
#include "Timer.h" #include "Timer.h"
#include "World.h" #include "World.h"
#include "sampman.h" #include "sampman.h"
#include "patcher.h"
cMusicManager MusicManager; cMusicManager MusicManager;
int32 gNumRetunePresses; int32 gNumRetunePresses;
@ -904,34 +904,3 @@ cMusicManager::ChangeRadioChannel()
} }
return true; return true;
} }
STARTPATCHES
InjectHook(0x57E4B0, &cMusicManager::PlayerInCar, PATCH_JUMP);
InjectHook(0x57E6D0, &cMusicManager::DisplayRadioStationName, PATCH_JUMP);
InjectHook(0x57CF70, &cMusicManager::Initialise, PATCH_JUMP);
InjectHook(0x57D140, &cMusicManager::Terminate, PATCH_JUMP);
InjectHook(0x57D1D0, &cMusicManager::GetRadioInCar, PATCH_JUMP);
InjectHook(0x57D2C0, &cMusicManager::SetRadioInCar, PATCH_JUMP);
InjectHook(0x57D180, &cMusicManager::SetRadioChannelByScript, PATCH_JUMP);
InjectHook(0x57CF30, &cMusicManager::ResetMusicAfterReload, PATCH_JUMP);
InjectHook(0x57E6A0, &cMusicManager::UsesPoliceRadio, PATCH_JUMP);
InjectHook(0x57D310, &cMusicManager::ChangeMusicMode, PATCH_JUMP);
InjectHook(0x57D420, &cMusicManager::ResetTimers, PATCH_JUMP);
InjectHook(0x57D440, &cMusicManager::Service, PATCH_JUMP);
InjectHook(0x57D530, &cMusicManager::ServiceFrontEndMode, PATCH_JUMP);
InjectHook(0x57E3D0, &cMusicManager::StopFrontEndTrack, PATCH_JUMP);
InjectHook(0x57E430, &cMusicManager::PlayAnnouncement, PATCH_JUMP);
InjectHook(0x57E2E0, &cMusicManager::PlayFrontEndTrack, PATCH_JUMP);
InjectHook(0x57E210, &cMusicManager::PreloadCutSceneMusic, PATCH_JUMP);
InjectHook(0x57E290, &cMusicManager::PlayPreloadedCutSceneMusic, PATCH_JUMP);
InjectHook(0x57E2B0, &cMusicManager::StopCutSceneMusic, PATCH_JUMP);
InjectHook(0x57E450, &cMusicManager::GetTrackStartPos, PATCH_JUMP);
InjectHook(0x57D690, &cMusicManager::ServiceGameMode, PATCH_JUMP);
InjectHook(0x57DCB0, &cMusicManager::ServiceAmbience, PATCH_JUMP);
InjectHook(0x57DEA0, &cMusicManager::ComputeAmbienceVol, PATCH_JUMP);
InjectHook(0x57E100, &cMusicManager::ServiceTrack, PATCH_JUMP);
InjectHook(0x57DFC0, &cMusicManager::ServiceAnnouncement, PATCH_JUMP);
InjectHook(0x57E530, &cMusicManager::GetCarTuning, PATCH_JUMP);
InjectHook(0x57E5A0, &cMusicManager::GetNextCarTuning, PATCH_JUMP);
InjectHook(0x57E130, &cMusicManager::ChangeRadioChannel, PATCH_JUMP);
ENDPATCHES

View File

@ -1,5 +1,5 @@
#include "common.h" #include "common.h"
#include "patcher.h"
#include "DMAudio.h" #include "DMAudio.h"
#include "AudioManager.h" #include "AudioManager.h"
#include "AudioSamples.h" #include "AudioSamples.h"
@ -21,14 +21,14 @@ struct tPoliceRadioZone {
int32 field_12; int32 field_12;
}; };
tPoliceRadioZone (&ZoneSfx)[NUMAUDIOZONES] = *(tPoliceRadioZone(*)[NUMAUDIOZONES])*(uintptr*)0x880240; tPoliceRadioZone ZoneSfx[NUMAUDIOZONES];
char *SubZo2Label = (char*)0x6E9918; char SubZo2Label[8];
char *SubZo3Label = (char*)0x6E9870; char SubZo3Label[8];
int32 &g_nMissionAudioSfx = *(int32*)0x60ED84; int32 g_nMissionAudioSfx = TOTAL_AUDIO_SAMPLES;
int8 &g_nMissionAudioPlayingStatus = *(int8*)0x60ED88; int8 g_nMissionAudioPlayingStatus = 2;
uint8 &gSpecialSuspectLastSeenReport = *(uint8*)0x95CD4D; uint8 gSpecialSuspectLastSeenReport;
uint32 (&gMinTimeToNextReport)[NUM_CRIME_TYPES] = *(uint32(*)[NUM_CRIME_TYPES])*(uintptr*)0x8E2828; uint32 gMinTimeToNextReport[NUM_CRIME_TYPES];
void void
cAudioManager::InitialisePoliceRadioZones() cAudioManager::InitialisePoliceRadioZones()
@ -774,19 +774,3 @@ cAudioManager::AgeCrimes()
} }
} }
} }
STARTPATCHES
InjectHook(0x580AF0, &cAudioManager::AgeCrimes, PATCH_JUMP);
InjectHook(0x57F060, &cAudioManager::DoPoliceRadioCrackle, PATCH_JUMP);
InjectHook(0x57F050, &cAudioManager::GetMissionScriptPoliceAudioPlayingStatus, PATCH_JUMP);
InjectHook(0x57EEC0, &cAudioManager::InitialisePoliceRadio, PATCH_JUMP);
InjectHook(0x57EAC0, &cAudioManager::InitialisePoliceRadioZones, PATCH_JUMP);
InjectHook(0x580500, &cAudioManager::PlaySuspectLastSeen, PATCH_JUMP);
InjectHook(0x5803D0, &cAudioManager::ReportCrime, PATCH_JUMP);
InjectHook(0x57EFF0, &cAudioManager::ResetPoliceRadio, PATCH_JUMP);
InjectHook(0x57F110, &cAudioManager::ServicePoliceRadio, PATCH_JUMP);
InjectHook(0x57F1B0, &cAudioManager::ServicePoliceRadioChannel, PATCH_JUMP);
InjectHook(0x57F020, &cAudioManager::SetMissionScriptPoliceAudio, PATCH_JUMP);
InjectHook(0x57F5B0, &cAudioManager::SetupCrimeReport, PATCH_JUMP);
InjectHook(0x57FCC0, &cAudioManager::SetupSuspectLastSeenReport, PATCH_JUMP);
ENDPATCHES

View File

@ -13,7 +13,7 @@
#include "MusicManager.h" #include "MusicManager.h"
#include "Frontend.h" #include "Frontend.h"
#include "Timer.h" #include "Timer.h"
#include "patcher.h"
#pragma comment( lib, "mss32.lib" ) #pragma comment( lib, "mss32.lib" )
@ -2236,66 +2236,3 @@ cSampleManager::InitialiseSampleBanks(void)
return true; return true;
} }
STARTPATCHES
//InjectHook(0x565500, cSampleManager::cSampleManager, PATCH_JUMP);
//InjectHook(0x565510, cSampleManager::~cSampleManager, PATCH_JUMP);
InjectHook(0x565520, comp, PATCH_JUMP);
InjectHook(0x565540, add_providers, PATCH_JUMP);
InjectHook(0x565680, release_existing, PATCH_JUMP);
InjectHook(0x5656F0, set_new_provider, PATCH_JUMP);
InjectHook(0x565900, &cSampleManager::SetSpeakerConfig, PATCH_JUMP);
InjectHook(0x565970, &cSampleManager::GetMaximumSupportedChannels, PATCH_JUMP);
InjectHook(0x565990, &cSampleManager::GetCurrent3DProviderIndex, PATCH_JUMP);
InjectHook(0x5659A0, &cSampleManager::SetCurrent3DProvider, PATCH_JUMP);
InjectHook(0x565A10, _ResolveLink, PATCH_JUMP);
InjectHook(0x565B40, _FindMP3s, PATCH_JUMP);
InjectHook(0x566380, _DeleteMP3Entries, PATCH_JUMP);
InjectHook(0x566400, _GetMP3EntryByIndex, PATCH_JUMP);
InjectHook(0x566490, &cSampleManager::IsMP3RadioChannelAvailable, PATCH_JUMP);
InjectHook(0x5664B0, &cSampleManager::ReleaseDigitalHandle, PATCH_JUMP);
InjectHook(0x5664F0, &cSampleManager::ReacquireDigitalHandle, PATCH_JUMP);
InjectHook(0x566530, &cSampleManager::Initialise, PATCH_JUMP);
InjectHook(0x566DC0, &cSampleManager::Terminate, PATCH_JUMP);
InjectHook(0x566EA0, &cSampleManager::CheckForAnAudioFileOnCD, PATCH_JUMP);
InjectHook(0x566F20, &cSampleManager::GetCDAudioDriveLetter, PATCH_JUMP);
InjectHook(0x566F50, &cSampleManager::UpdateEffectsVolume, PATCH_JUMP);
InjectHook(0x567010, &cSampleManager::SetEffectsMasterVolume, PATCH_JUMP);
InjectHook(0x567020, &cSampleManager::SetMusicMasterVolume, PATCH_JUMP);
InjectHook(0x567030, &cSampleManager::SetEffectsFadeVolume, PATCH_JUMP);
InjectHook(0x567040, &cSampleManager::SetMusicFadeVolume, PATCH_JUMP);
InjectHook(0x567050, &cSampleManager::LoadSampleBank, PATCH_JUMP);
InjectHook(0x567110, &cSampleManager::UnloadSampleBank, PATCH_JUMP);
InjectHook(0x567130, &cSampleManager::IsSampleBankLoaded, PATCH_JUMP);
InjectHook(0x567150, &cSampleManager::IsPedCommentLoaded, PATCH_JUMP);
InjectHook(0x5671A0, &cSampleManager::LoadPedComment, PATCH_JUMP);
InjectHook(0x5672A0, &cSampleManager::GetSampleBaseFrequency, PATCH_JUMP);
InjectHook(0x5672C0, &cSampleManager::GetSampleLoopStartOffset, PATCH_JUMP);
InjectHook(0x5672E0, &cSampleManager::GetSampleLoopEndOffset, PATCH_JUMP);
InjectHook(0x567300, &cSampleManager::GetSampleLength, PATCH_JUMP);
InjectHook(0x567320, &cSampleManager::UpdateReverb, PATCH_JUMP);
InjectHook(0x567630, &cSampleManager::SetChannelReverbFlag, PATCH_JUMP);
InjectHook(0x5676A0, &cSampleManager::InitialiseChannel, PATCH_JUMP);
InjectHook(0x567820, &cSampleManager::SetChannelEmittingVolume, PATCH_JUMP);
InjectHook(0x567890, &cSampleManager::SetChannel3DPosition, PATCH_JUMP);
InjectHook(0x5678D0, &cSampleManager::SetChannel3DDistances, PATCH_JUMP);
InjectHook(0x567900, &cSampleManager::SetChannelVolume, PATCH_JUMP);
InjectHook(0x567980, &cSampleManager::SetChannelPan, PATCH_JUMP);
InjectHook(0x5679D0, &cSampleManager::SetChannelFrequency, PATCH_JUMP);
InjectHook(0x567A30, &cSampleManager::SetChannelLoopPoints, PATCH_JUMP);
InjectHook(0x567AA0, &cSampleManager::SetChannelLoopCount, PATCH_JUMP);
InjectHook(0x567B00, &cSampleManager::GetChannelUsedFlag, PATCH_JUMP);
InjectHook(0x567B80, &cSampleManager::StartChannel, PATCH_JUMP);
InjectHook(0x567BE0, &cSampleManager::StopChannel, PATCH_JUMP);
InjectHook(0x567C50, &cSampleManager::PreloadStreamedFile, PATCH_JUMP);
InjectHook(0x567D30, &cSampleManager::PauseStream, PATCH_JUMP);
InjectHook(0x567D60, &cSampleManager::StartPreloadedStreamedFile, PATCH_JUMP);
InjectHook(0x567D80, &cSampleManager::StartStreamedFile, PATCH_JUMP);
InjectHook(0x5680E0, &cSampleManager::StopStreamedFile, PATCH_JUMP);
InjectHook(0x568130, &cSampleManager::GetStreamedFilePosition, PATCH_JUMP);
InjectHook(0x5681D0, &cSampleManager::SetStreamedVolumeAndPan, PATCH_JUMP);
InjectHook(0x568270, &cSampleManager::GetStreamedFileLength, PATCH_JUMP);
InjectHook(0x568290, &cSampleManager::IsStreamPlaying, PATCH_JUMP);
InjectHook(0x5682D0, &cSampleManager::InitialiseSampleBanks, PATCH_JUMP);
//InjectHook(0x5683F0, `global constructor keyed to'sampman.cpp, PATCH_JUMP);
ENDPATCHES

View File

@ -1,5 +1,5 @@
#include "common.h" #include "common.h"
#include "patcher.h"
#include "AutoPilot.h" #include "AutoPilot.h"
#include "CarCtrl.h" #include "CarCtrl.h"

View File

@ -1,5 +1,5 @@
#include "common.h" #include "common.h"
#include "patcher.h"
#include "Bridge.h" #include "Bridge.h"
#include "Pools.h" #include "Pools.h"
#include "ModelIndices.h" #include "ModelIndices.h"
@ -144,11 +144,3 @@ bool CBridge::ThisIsABridgeObjectMovingUp(int index)
return State == STATE_LIFT_PART_ABOUT_TO_MOVE_UP || State == STATE_LIFT_PART_MOVING_UP; return State == STATE_LIFT_PART_ABOUT_TO_MOVE_UP || State == STATE_LIFT_PART_MOVING_UP;
} }
STARTPATCHES
InjectHook(0x413A30, &CBridge::Init, PATCH_JUMP);
InjectHook(0x413AC0, &CBridge::Update, PATCH_JUMP);
InjectHook(0x413D10, &CBridge::ShouldLightsBeFlashing, PATCH_JUMP);
InjectHook(0x413D20, &CBridge::FindBridgeEntities, PATCH_JUMP);
InjectHook(0x413DE0, &CBridge::ThisIsABridgeObjectMovingUp, PATCH_JUMP);
ENDPATCHES

View File

@ -1,5 +1,5 @@
#include "common.h" #include "common.h"
#include "patcher.h"
#include "CarAI.h" #include "CarAI.h"
#include "Accident.h" #include "Accident.h"
@ -33,7 +33,6 @@ float CCarAI::FindSwitchDistanceFar(CVehicle* pVehicle)
void CCarAI::UpdateCarAI(CVehicle* pVehicle) void CCarAI::UpdateCarAI(CVehicle* pVehicle)
{ {
//((void(*)(CVehicle*))(0x413E50))(pVehicle);
//return; //return;
if (pVehicle->bIsLawEnforcer){ if (pVehicle->bIsLawEnforcer){
if (pVehicle->AutoPilot.m_nCarMission == MISSION_BLOCKCAR_FARAWAY || if (pVehicle->AutoPilot.m_nCarMission == MISSION_BLOCKCAR_FARAWAY ||
@ -637,6 +636,3 @@ void CCarAI::MakeWayForCarWithSiren(CVehicle *pVehicle)
} }
} }
} }
STARTPATCHES
ENDPATCHES

View File

@ -1,5 +1,5 @@
#include "common.h" #include "common.h"
#include "patcher.h"
#include "CarCtrl.h" #include "CarCtrl.h"
#include "Accident.h" #include "Accident.h"
@ -67,25 +67,25 @@
#define MIN_ANGLE_TO_APPLY_HANDBRAKE 0.7f #define MIN_ANGLE_TO_APPLY_HANDBRAKE 0.7f
#define MIN_SPEED_TO_APPLY_HANDBRAKE 0.3f #define MIN_SPEED_TO_APPLY_HANDBRAKE 0.3f
int &CCarCtrl::NumLawEnforcerCars = *(int*)0x8F1B38; int CCarCtrl::NumLawEnforcerCars;
int &CCarCtrl::NumAmbulancesOnDuty = *(int*)0x885BB0; int CCarCtrl::NumAmbulancesOnDuty;
int &CCarCtrl::NumFiretrucksOnDuty = *(int*)0x9411F0; int CCarCtrl::NumFiretrucksOnDuty;
bool &CCarCtrl::bCarsGeneratedAroundCamera = *(bool*)0x95CD8A; bool CCarCtrl::bCarsGeneratedAroundCamera;
float& CCarCtrl::CarDensityMultiplier = *(float*)0x5EC8B4; float CCarCtrl::CarDensityMultiplier = 1.0f;
int32 &CCarCtrl::NumMissionCars = *(int32*)0x8F1B54; int32 CCarCtrl::NumMissionCars;
int32 &CCarCtrl::NumRandomCars = *(int32*)0x943118; int32 CCarCtrl::NumRandomCars;
int32 &CCarCtrl::NumParkedCars = *(int32*)0x8F29E0; int32 CCarCtrl::NumParkedCars;
int32 &CCarCtrl::NumPermanentCars = *(int32*)0x8F29F0; int32 CCarCtrl::NumPermanentCars;
int8 &CCarCtrl::CountDownToCarsAtStart = *(int8*)0x95CD63; int8 CCarCtrl::CountDownToCarsAtStart;
int32 &CCarCtrl::MaxNumberOfCarsInUse = *(int32*)0x5EC8B8; int32 CCarCtrl::MaxNumberOfCarsInUse = 12;
uint32 &CCarCtrl::LastTimeLawEnforcerCreated = *(uint32*)0x8F5FF0; uint32 CCarCtrl::LastTimeLawEnforcerCreated;
uint32 &CCarCtrl::LastTimeFireTruckCreated = *(uint32*)0x880F5C; uint32 CCarCtrl::LastTimeFireTruckCreated;
uint32 &CCarCtrl::LastTimeAmbulanceCreated = *(uint32*)0x941450; uint32 CCarCtrl::LastTimeAmbulanceCreated;
int32 (&CCarCtrl::TotalNumOfCarsOfRating)[TOTAL_CUSTOM_CLASSES] = *(int32(*)[TOTAL_CUSTOM_CLASSES])*(uintptr*)0x8F1A60; int32 CCarCtrl::TotalNumOfCarsOfRating[TOTAL_CUSTOM_CLASSES];
int32 (&CCarCtrl::NextCarOfRating)[TOTAL_CUSTOM_CLASSES] = *(int32(*)[TOTAL_CUSTOM_CLASSES])*(uintptr*)0x9412AC; int32 CCarCtrl::NextCarOfRating[TOTAL_CUSTOM_CLASSES];
int32 (&CCarCtrl::CarArrays)[TOTAL_CUSTOM_CLASSES][MAX_CAR_MODELS_IN_ARRAY] = *(int32(*)[TOTAL_CUSTOM_CLASSES][MAX_CAR_MODELS_IN_ARRAY])*(uintptr*)0x6EB860; int32 CCarCtrl::CarArrays[TOTAL_CUSTOM_CLASSES][MAX_CAR_MODELS_IN_ARRAY];
CVehicle* (&apCarsToKeep)[MAX_CARS_TO_KEEP] = *(CVehicle*(*)[MAX_CARS_TO_KEEP])*(uintptr*)0x70D830; CVehicle* apCarsToKeep[MAX_CARS_TO_KEEP];
uint32 (&aCarsToKeepTime)[MAX_CARS_TO_KEEP] = *(uint32(*)[MAX_CARS_TO_KEEP])*(uintptr*)0x87F9A8; uint32 aCarsToKeepTime[MAX_CARS_TO_KEEP];
void void
CCarCtrl::GenerateRandomCars() CCarCtrl::GenerateRandomCars()
@ -2736,20 +2736,3 @@ bool CCarCtrl::MapCouldMoveInThisArea(float x, float y)
return x > -342.0f && x < -219.0f && return x > -342.0f && x < -219.0f &&
y > -677.0f && y < -580.0f; y > -677.0f && y < -580.0f;
} }
STARTPATCHES
InjectHook(0x416580, &CCarCtrl::GenerateRandomCars, PATCH_JUMP);
InjectHook(0x417EC0, &CCarCtrl::ChooseModel, PATCH_JUMP);
InjectHook(0x418320, &CCarCtrl::RemoveDistantCars, PATCH_JUMP);
InjectHook(0x418430, &CCarCtrl::PossiblyRemoveVehicle, PATCH_JUMP);
InjectHook(0x41D280, &CCarCtrl::Init, PATCH_JUMP);
InjectHook(0x41D3B0, &CCarCtrl::ReInit, PATCH_JUMP);
InjectHook(0x41E250, &CCarCtrl::SteerAIBoatWithPhysics, PATCH_JUMP);
InjectHook(0x41F6E0, &CCarCtrl::RegisterVehicleOfInterest, PATCH_JUMP);
InjectHook(0x41F780, &CCarCtrl::IsThisVehicleInteresting, PATCH_JUMP);
InjectHook(0x41F7A0, &CCarCtrl::RemoveFromInterestingVehicleList, PATCH_JUMP);
InjectHook(0x41F7D0, &CCarCtrl::ClearInterestingVehicleList, PATCH_JUMP);
InjectHook(0x41F7F0, &CCarCtrl::SwitchVehicleToRealPhysics, PATCH_JUMP);
InjectHook(0x41F820, &CCarCtrl::JoinCarWithRoadSystem, PATCH_JUMP);
InjectHook(0x41FA00, &CCarCtrl::JoinCarWithRoadSystemGotoCoors, PATCH_JUMP);
ENDPATCHES

View File

@ -120,23 +120,23 @@ public:
return angle; return angle;
} }
static int32 &NumLawEnforcerCars; static int32 NumLawEnforcerCars;
static int32 &NumAmbulancesOnDuty; static int32 NumAmbulancesOnDuty;
static int32 &NumFiretrucksOnDuty; static int32 NumFiretrucksOnDuty;
static int32 &NumRandomCars; static int32 NumRandomCars;
static int32 &NumMissionCars; static int32 NumMissionCars;
static int32 &NumParkedCars; static int32 NumParkedCars;
static int32 &NumPermanentCars; static int32 NumPermanentCars;
static bool &bCarsGeneratedAroundCamera; static bool bCarsGeneratedAroundCamera;
static float &CarDensityMultiplier; static float CarDensityMultiplier;
static int8 &CountDownToCarsAtStart; static int8 CountDownToCarsAtStart;
static int32 &MaxNumberOfCarsInUse; static int32 MaxNumberOfCarsInUse;
static uint32 &LastTimeLawEnforcerCreated; static uint32 LastTimeLawEnforcerCreated;
static uint32 &LastTimeFireTruckCreated; static uint32 LastTimeFireTruckCreated;
static uint32 &LastTimeAmbulanceCreated; static uint32 LastTimeAmbulanceCreated;
static int32 (&TotalNumOfCarsOfRating)[TOTAL_CUSTOM_CLASSES]; static int32 TotalNumOfCarsOfRating[TOTAL_CUSTOM_CLASSES];
static int32 (&NextCarOfRating)[TOTAL_CUSTOM_CLASSES]; static int32 NextCarOfRating[TOTAL_CUSTOM_CLASSES];
static int32 (&CarArrays)[TOTAL_CUSTOM_CLASSES][MAX_CAR_MODELS_IN_ARRAY]; static int32 CarArrays[TOTAL_CUSTOM_CLASSES][MAX_CAR_MODELS_IN_ARRAY];
}; };
extern CVehicle* (&apCarsToKeep)[MAX_CARS_TO_KEEP]; extern CVehicle* apCarsToKeep[MAX_CARS_TO_KEEP];

View File

@ -1,5 +1,5 @@
#include "common.h" #include "common.h"
#include "patcher.h"
#include "Curves.h" #include "Curves.h"
float CCurves::CalcSpeedScaleFactor(CVector* pPoint1, CVector* pPoint2, float dir1X, float dir1Y, float dir2X, float dir2Y) float CCurves::CalcSpeedScaleFactor(CVector* pPoint1, CVector* pPoint2, float dir1X, float dir1Y, float dir2X, float dir2Y)

View File

@ -1,5 +1,5 @@
#include "common.h" #include "common.h"
#include "patcher.h"
#include "main.h" #include "main.h"
#include "Darkel.h" #include "Darkel.h"
#include "PlayerPed.h" #include "PlayerPed.h"
@ -371,19 +371,3 @@ CDarkel::Update()
DMAudio.PlayFrontEndSound(SOUND_RAMPAGE_PASSED, 0); DMAudio.PlayFrontEndSound(SOUND_RAMPAGE_PASSED, 0);
} }
} }
STARTPATCHES
InjectHook(0x421380, CDarkel::CalcFade, PATCH_JUMP);
InjectHook(0x420650, CDarkel::Init, PATCH_JUMP);
InjectHook(0x420660, CDarkel::Update, PATCH_JUMP);
InjectHook(0x420E60, CDarkel::FrenzyOnGoing, PATCH_JUMP);
InjectHook(0x420E50, CDarkel::ReadStatus, PATCH_JUMP);
InjectHook(0x420E70, CDarkel::ResetOnPlayerDeath, PATCH_JUMP);
InjectHook(0x4210E0, CDarkel::StartFrenzy, PATCH_JUMP);
InjectHook(0x421370, CDarkel::QueryModelsKilledByPlayer, PATCH_JUMP);
InjectHook(0x421060, CDarkel::RegisterKillNotByPlayer, PATCH_JUMP);
InjectHook(0x421310, CDarkel::ResetModelsKilledByPlayer, PATCH_JUMP);
InjectHook(0x420920, CDarkel::DrawMessages, PATCH_JUMP);
InjectHook(0x421070, CDarkel::RegisterCarBlownUpByPlayer, PATCH_JUMP);
InjectHook(0x420F60, CDarkel::RegisterKillByPlayer, PATCH_JUMP);
ENDPATCHES

View File

@ -1,5 +1,5 @@
#include "common.h" #include "common.h"
#include "patcher.h"
#include "GameLogic.h" #include "GameLogic.h"
#include "Clock.h" #include "Clock.h"
#include "Stats.h" #include "Stats.h"
@ -20,7 +20,7 @@
#include "Script.h" #include "Script.h"
#include "Garages.h" #include "Garages.h"
uint8 CGameLogic::ActivePlayers; // 0x95CD5E uint8 CGameLogic::ActivePlayers;
void void
CGameLogic::InitAtStartOfGame() CGameLogic::InitAtStartOfGame()
@ -284,11 +284,3 @@ CGameLogic::RestorePlayerStuffDuringResurrection(CPlayerPed *pPlayerPed, CVector
CWorld::Remove(pPlayerPed); CWorld::Remove(pPlayerPed);
CWorld::Add(pPlayerPed); CWorld::Add(pPlayerPed);
} }
STARTPATCHES
InjectHook(0x4213F0, &CGameLogic::InitAtStartOfGame, PATCH_JUMP);
InjectHook(0x421C00, &CGameLogic::PassTime, PATCH_JUMP);
InjectHook(0x421A20, &CGameLogic::SortOutStreamingAndMemory, PATCH_JUMP);
InjectHook(0x421400, &CGameLogic::Update, PATCH_JUMP);
InjectHook(0x421A60, &CGameLogic::RestorePlayerStuffDuringResurrection, PATCH_JUMP);
ENDPATCHES

View File

@ -1,5 +1,5 @@
#include "common.h" #include "common.h"
#include "patcher.h"
#include "Garages.h" #include "Garages.h"
#include "main.h" #include "main.h"
@ -2357,10 +2357,3 @@ CGarages::IsModelIndexADoor(uint32 id)
id == MI_CRUSHERBODY || id == MI_CRUSHERBODY ||
id == MI_CRUSHERLID; id == MI_CRUSHERLID;
} }
STARTPATCHES
InjectHook(0x427AB0, CGarages::IsPointInAGarageCameraZone, PATCH_JUMP); // CCamera::CamControl
InjectHook(0x427BC0, CGarages::CameraShouldBeOutside, PATCH_JUMP); // CCamera::CamControl
InjectHook(0x428940, CGarages::Load, PATCH_JUMP); // GenericLoad
ENDPATCHES

View File

@ -1,5 +1,5 @@
#include "common.h" #include "common.h"
#include "patcher.h"
#include "DMAudio.h" #include "DMAudio.h"
#include "Hud.h" #include "Hud.h"
@ -153,18 +153,3 @@ void COnscreenTimerEntry::ProcessForDisplayCounter() {
uint32 counter = *CTheScripts::GetPointerToScriptVariable(m_nCounterOffset); uint32 counter = *CTheScripts::GetPointerToScriptVariable(m_nCounterOffset);
sprintf(m_bCounterBuffer, "%d", counter); sprintf(m_bCounterBuffer, "%d", counter);
} }
STARTPATCHES
InjectHook(0x429160, &COnscreenTimerEntry::Process, PATCH_JUMP);
InjectHook(0x429110, &COnscreenTimerEntry::ProcessForDisplay, PATCH_JUMP);
InjectHook(0x429080, &COnscreenTimerEntry::ProcessForDisplayClock, PATCH_JUMP);
InjectHook(0x4290F0, &COnscreenTimerEntry::ProcessForDisplayCounter, PATCH_JUMP);
InjectHook(0x429220, &COnscreenTimer::Init, PATCH_JUMP);
InjectHook(0x429320, &COnscreenTimer::Process, PATCH_JUMP);
InjectHook(0x4292E0, &COnscreenTimer::ProcessForDisplay, PATCH_JUMP);
InjectHook(0x429450, &COnscreenTimer::ClearCounter, PATCH_JUMP);
InjectHook(0x429410, &COnscreenTimer::ClearClock, PATCH_JUMP);
InjectHook(0x4293B0, &COnscreenTimer::AddCounter, PATCH_JUMP);
InjectHook(0x429350, &COnscreenTimer::AddClock, PATCH_JUMP);
ENDPATCHES

View File

@ -1,5 +1,5 @@
#include "common.h" #include "common.h"
#include "patcher.h"
#include "General.h" #include "General.h"
#include "FileMgr.h" // only needed for empty function #include "FileMgr.h" // only needed for empty function
#include "Camera.h" #include "Camera.h"
@ -12,7 +12,7 @@ bool gbShowPedPaths;
bool gbShowCarPaths; bool gbShowCarPaths;
bool gbShowCarPathsLinks; bool gbShowCarPathsLinks;
CPathFind &ThePaths = *(CPathFind*)0x8F6754; CPathFind ThePaths;
#define MAX_DIST INT16_MAX-1 #define MAX_DIST INT16_MAX-1
#define MIN_PED_ROUTE_DISTANCE 23.8f #define MIN_PED_ROUTE_DISTANCE 23.8f
@ -21,11 +21,11 @@ CPathFind &ThePaths = *(CPathFind*)0x8F6754;
// 1 UseInRoadBlock // 1 UseInRoadBlock
// 2 east/west road(?) // 2 east/west road(?)
CPathInfoForObject *&InfoForTileCars = *(CPathInfoForObject**)0x8F1A8C; CPathInfoForObject *InfoForTileCars;
CPathInfoForObject *&InfoForTilePeds = *(CPathInfoForObject**)0x8F1AE4; CPathInfoForObject *InfoForTilePeds;
// unused // unused
CTempDetachedNode *&DetachedNodesCars = *(CTempDetachedNode**)0x8E2824; CTempDetachedNode *DetachedNodesCars;
CTempDetachedNode *&DetachedNodesPeds = *(CTempDetachedNode**)0x8E28A0; CTempDetachedNode *DetachedNodesPeds;
bool bool
CPedPath::CalcPedRoute(int8 pathType, CVector position, CVector destination, CVector *pointPoses, int16 *pointsFound, int16 maxPoints) CPedPath::CalcPedRoute(int8 pathType, CVector position, CVector destination, CVector *pointPoses, int16 *pointsFound, int16 maxPoints)
@ -1766,48 +1766,3 @@ CPathFind::DisplayPathData(void)
} }
} }
} }
STARTPATCHES
InjectHook(0x42E680, &CPedPath::CalcPedRoute, PATCH_JUMP);
InjectHook(0x42F100, &CPedPath::AddNodeToPathList, PATCH_JUMP);
InjectHook(0x42F140, &CPedPath::RemoveNodeFromList, PATCH_JUMP);
InjectHook(0x42F160, &CPedPath::AddNodeToList, PATCH_JUMP);
InjectHook(0x42F1A0, &CPedPath::AddBlockade, PATCH_JUMP);
InjectHook(0x42F420, &CPedPath::AddBlockadeSectorList, PATCH_JUMP);
InjectHook(0x4294A0, &CPathFind::Init, PATCH_JUMP);
InjectHook(0x42D580, &CPathFind::AllocatePathFindInfoMem, PATCH_JUMP);
InjectHook(0x429540, &CPathFind::RegisterMapObject, PATCH_JUMP);
InjectHook(0x42D7E0, &CPathFind::StoreNodeInfoPed, PATCH_JUMP);
InjectHook(0x42D690, &CPathFind::StoreNodeInfoCar, PATCH_JUMP);
InjectHook(0x429610, &CPathFind::PreparePathData, PATCH_JUMP);
InjectHook(0x42B810, &CPathFind::CountFloodFillGroups, PATCH_JUMP);
InjectHook(0x429C20, &CPathFind::PreparePathDataForType, PATCH_JUMP);
InjectHook(0x42C990, &CPathFind::CalcRoadDensity, PATCH_JUMP);
InjectHook(0x42E1B0, &CPathFind::TestForPedTrafficLight, PATCH_JUMP);
InjectHook(0x42E340, &CPathFind::TestCrossesRoad, PATCH_JUMP);
InjectHook(0x42CBE0, &CPathFind::AddNodeToList, PATCH_JUMP);
InjectHook(0x42CBB0, &CPathFind::RemoveNodeFromList, PATCH_JUMP);
InjectHook(0x42B790, &CPathFind::RemoveBadStartNode, PATCH_JUMP);
InjectHook(0x42E3B0, &CPathFind::SetLinksBridgeLights, PATCH_JUMP);
InjectHook(0x42DED0, &CPathFind::SwitchOffNodeAndNeighbours, PATCH_JUMP);
InjectHook(0x42D960, &CPathFind::SwitchRoadsOffInArea, PATCH_JUMP);
InjectHook(0x42DA50, &CPathFind::SwitchPedRoadsOffInArea, PATCH_JUMP);
InjectHook(0x42DB50, &CPathFind::SwitchRoadsInAngledArea, PATCH_JUMP);
InjectHook(0x42E140, &CPathFind::MarkRoadsBetweenLevelsNodeAndNeighbours, PATCH_JUMP);
InjectHook(0x42DF50, &CPathFind::MarkRoadsBetweenLevelsInArea, PATCH_JUMP);
InjectHook(0x42E040, &CPathFind::PedMarkRoadsBetweenLevelsInArea, PATCH_JUMP);
InjectHook(0x42CC30, &CPathFind::FindNodeClosestToCoors, PATCH_JUMP);
InjectHook(0x42CDC0, &CPathFind::FindNodeClosestToCoorsFavourDirection, PATCH_JUMP);
InjectHook(0x42CFC0, &CPathFind::FindNodeOrientationForCarPlacement, PATCH_JUMP);
InjectHook(0x42D060, &CPathFind::FindNodeOrientationForCarPlacementFacingDestination, PATCH_JUMP);
InjectHook(0x42BF10, &CPathFind::NewGenerateCarCreationCoors, PATCH_JUMP);
InjectHook(0x42C1E0, &CPathFind::GeneratePedCreationCoors, PATCH_JUMP);
InjectHook(0x42D2A0, &CPathFind::FindRoadObjectClosestToCoors, PATCH_JUMP);
InjectHook(0x42B9F0, &CPathFind::FindNextNodeWandering, PATCH_JUMP);
InjectHook(0x42B040, &CPathFind::DoPathSearch, PATCH_JUMP);
InjectHook(0x42C8C0, &CPathFind::TestCoorsCloseness, PATCH_JUMP);
InjectHook(0x42E450, &CPathFind::Save, PATCH_JUMP);
InjectHook(0x42E550, &CPathFind::Load, PATCH_JUMP);
ENDPATCHES

View File

@ -138,8 +138,8 @@ struct CPathInfoForObject
int8 numRightLanes; int8 numRightLanes;
uint8 crossing : 1; uint8 crossing : 1;
}; };
extern CPathInfoForObject *&InfoForTileCars; extern CPathInfoForObject *InfoForTileCars;
extern CPathInfoForObject *&InfoForTilePeds; extern CPathInfoForObject *InfoForTilePeds;
struct CTempNode struct CTempNode
{ {
@ -234,7 +234,7 @@ public:
}; };
static_assert(sizeof(CPathFind) == 0x49bf4, "CPathFind: error"); static_assert(sizeof(CPathFind) == 0x49bf4, "CPathFind: error");
extern CPathFind &ThePaths; extern CPathFind ThePaths;
extern bool gbShowPedPaths; extern bool gbShowPedPaths;
extern bool gbShowCarPaths; extern bool gbShowCarPaths;

View File

@ -1,5 +1,5 @@
#include "common.h" #include "common.h"
#include "patcher.h"
#include "Phones.h" #include "Phones.h"
#include "Pools.h" #include "Pools.h"
#include "ModelIndices.h" #include "ModelIndices.h"
@ -13,13 +13,13 @@
#include "RpAnimBlend.h" #include "RpAnimBlend.h"
#include "AnimBlendAssociation.h" #include "AnimBlendAssociation.h"
CPhoneInfo &gPhoneInfo = *(CPhoneInfo*)0x732A20; CPhoneInfo gPhoneInfo;
bool &CPhoneInfo::bDisplayingPhoneMessage = *(bool*)0x6283AC; // is phone picked up bool CPhoneInfo::bDisplayingPhoneMessage; // is phone picked up
uint32 &CPhoneInfo::PhoneEnableControlsTimer = *(uint32*)0x6283A8; uint32 CPhoneInfo::PhoneEnableControlsTimer;
CPhone *&CPhoneInfo::pPhoneDisplayingMessages = *(CPhone**)0x6283B0; CPhone *CPhoneInfo::pPhoneDisplayingMessages;
bool &CPhoneInfo::bPickingUpPhone = *(bool*)0x6283B4; bool CPhoneInfo::bPickingUpPhone;
CPed *&CPhoneInfo::pCallBackPed = *(CPed**)0x6283B8; // ped who picking up the phone (reset after pickup cb) CPed *CPhoneInfo::pCallBackPed; // ped who picking up the phone (reset after pickup cb)
/* /*
Entering phonebooth cutscene, showing messages and triggering these things Entering phonebooth cutscene, showing messages and triggering these things
@ -377,20 +377,3 @@ PhonePickUpCB(CAnimBlendAssociation *assoc, void *arg)
CPhoneInfo::pCallBackPed = nil; CPhoneInfo::pCallBackPed = nil;
} }
STARTPATCHES
InjectHook(0x42F720, &CPhoneInfo::FindNearestFreePhone, PATCH_JUMP);
InjectHook(0x42FD50, &CPhoneInfo::PhoneAtThisPosition, PATCH_JUMP);
InjectHook(0x42FFF0, &CPhoneInfo::HasMessageBeenDisplayed, PATCH_JUMP);
InjectHook(0x430030, &CPhoneInfo::IsMessageBeingDisplayed, PATCH_JUMP);
InjectHook(0x430120, &CPhoneInfo::Load, PATCH_JUMP);
InjectHook(0x42FF90, &CPhoneInfo::SetPhoneMessage_JustOnce, PATCH_JUMP);
InjectHook(0x42FF30, &CPhoneInfo::SetPhoneMessage_Repeatedly, PATCH_JUMP);
InjectHook(0x430060, &CPhoneInfo::Save, PATCH_JUMP);
InjectHook(0x42F710, &CPhoneInfo::Shutdown, PATCH_JUMP);
InjectHook(0x42F640, &CPhoneInfo::Initialise, PATCH_JUMP);
InjectHook(0x42FDB0, &CPhoneInfo::GrabPhone, PATCH_JUMP);
InjectHook(0x42F7A0, &CPhoneInfo::Update, PATCH_JUMP);
InjectHook(0x42F570, &PhonePutDownCB, PATCH_JUMP);
InjectHook(0x42F470, &PhonePickUpCB, PATCH_JUMP);
ENDPATCHES

View File

@ -36,11 +36,11 @@ static_assert(sizeof(CPhone) == 0x34, "CPhone: error");
class CPhoneInfo { class CPhoneInfo {
public: public:
static bool &bDisplayingPhoneMessage; static bool bDisplayingPhoneMessage;
static uint32 &PhoneEnableControlsTimer; static uint32 PhoneEnableControlsTimer;
static CPhone *&pPhoneDisplayingMessages; static CPhone *pPhoneDisplayingMessages;
static bool &bPickingUpPhone; static bool bPickingUpPhone;
static CPed *&pCallBackPed; static CPed *pCallBackPed;
int32 m_nMax; int32 m_nMax;
int32 m_nScriptPhonesMax; int32 m_nScriptPhonesMax;
@ -63,7 +63,7 @@ public:
void Update(void); void Update(void);
}; };
extern CPhoneInfo &gPhoneInfo; extern CPhoneInfo gPhoneInfo;
void PhonePutDownCB(CAnimBlendAssociation *assoc, void *arg); void PhonePutDownCB(CAnimBlendAssociation *assoc, void *arg);
void PhonePickUpCB(CAnimBlendAssociation *assoc, void *arg); void PhonePickUpCB(CAnimBlendAssociation *assoc, void *arg);

View File

@ -1,5 +1,5 @@
#include "common.h" #include "common.h"
#include "patcher.h"
#include "main.h" #include "main.h"
#include "Camera.h" #include "Camera.h"
@ -31,16 +31,16 @@
#include "WaterLevel.h" #include "WaterLevel.h"
#include "World.h" #include "World.h"
CPickup(&CPickups::aPickUps)[NUMPICKUPS] = *(CPickup(*)[NUMPICKUPS])*(uintptr*)0x878C98; CPickup CPickups::aPickUps[NUMPICKUPS];
int16 CPickups::NumMessages;// = *(int16*)0x95CC98; int16 CPickups::NumMessages;
int32 CPickups::aPickUpsCollected[NUMCOLLECTEDPICKUPS];// = *(int32(*)[NUMCOLLECTEDPICKUPS])*(uintptr*)0x87C538; int32 CPickups::aPickUpsCollected[NUMCOLLECTEDPICKUPS];
int16 CPickups::CollectedPickUpIndex;// = *(int16*)0x95CC8A; int16 CPickups::CollectedPickUpIndex;
// unused // unused
bool &CPickups::bPickUpcamActivated = *(bool*)0x95CD71; bool CPickups::bPickUpcamActivated;
CVehicle *&CPickups::pPlayerVehicle = *(CVehicle**)0x8F29E8; CVehicle *CPickups::pPlayerVehicle;
CVector &CPickups::StaticCamCoors = *(CVector*)0x9404C8; CVector CPickups::StaticCamCoors;
uint32 &CPickups::StaticCamStartTime = *(uint32*)0x8E289C; uint32 CPickups::StaticCamStartTime;
tPickupMessage CPickups::aMessages[NUMPICKUPMESSAGES]; tPickupMessage CPickups::aMessages[NUMPICKUPMESSAGES];
@ -1406,47 +1406,3 @@ CPacManPickups::ResetPowerPillsCarriedByPlayer()
FindPlayerVehicle()->m_fForceMultiplier = 1.0f; FindPlayerVehicle()->m_fForceMultiplier = 1.0f;
} }
} }
STARTPATCHES
InjectHook(0x430220, CPickups::Init, PATCH_JUMP);
InjectHook(0x4303D0, CPickups::Update, PATCH_JUMP);
InjectHook(0x432440, CPickups::RenderPickUpText, PATCH_JUMP);
InjectHook(0x431C30, CPickups::DoCollectableEffects, PATCH_JUMP);
InjectHook(0x431F40, CPickups::DoMoneyEffects, PATCH_JUMP);
InjectHook(0x4321C0, CPickups::DoMineEffects, PATCH_JUMP);
InjectHook(0x431520, CPickups::DoPickUpEffects, PATCH_JUMP);
InjectHook(0x4304B0, CPickups::GenerateNewOne, PATCH_JUMP);
InjectHook(0x430660, CPickups::GenerateNewOne_WeaponType, PATCH_JUMP);
InjectHook(0x4307A0, CPickups::RemovePickUp, PATCH_JUMP);
InjectHook(0x430800, CPickups::RemoveAllFloatingPickups, PATCH_JUMP);
InjectHook(0x433D60, CPickups::AddToCollectedPickupsArray, PATCH_JUMP);
InjectHook(0x430770, CPickups::IsPickUpPickedUp, PATCH_JUMP);
InjectHook(0x430690, CPickups::ModelForWeapon, PATCH_JUMP);
InjectHook(0x4306F0, CPickups::WeaponForModel, PATCH_JUMP);
InjectHook(0x431510, CPickups::FindColourIndexForWeaponMI, PATCH_JUMP);/**/
InjectHook(0x433DF0, CPickups::GetActualPickupIndex, PATCH_JUMP);
InjectHook(0x433DB0, CPickups::GetNewUniquePickupIndex, PATCH_JUMP);
InjectHook(0x433B60, CPickups::PassTime, PATCH_JUMP);
InjectHook(0x4339F0, CPickups::GivePlayerGoodiesWithPickUpMI, PATCH_JUMP);
InjectHook(0x433F60, CPickups::Load, PATCH_JUMP);
InjectHook(0x433E40, CPickups::Save, PATCH_JUMP);
InjectHook(0x433BA0, &CPickup::GiveUsAPickUpObject, PATCH_JUMP);
InjectHook(0x430860, &CPickup::Update, PATCH_JUMP);
InjectHook(0x4331B0, &CPacManPickup::Update, PATCH_JUMP);
InjectHook(0x432760, CPacManPickups::Init, PATCH_JUMP);
InjectHook(0x432800, CPacManPickups::Update, PATCH_JUMP);
InjectHook(0x432AE0, CPacManPickups::GeneratePMPickUps, PATCH_JUMP);
InjectHook(0x432D50, CPacManPickups::GeneratePMPickUpsForRace, PATCH_JUMP);
InjectHook(0x432F20, CPacManPickups::GenerateOnePMPickUp, PATCH_JUMP);
InjectHook(0x432F60, CPacManPickups::Render, PATCH_JUMP);
InjectHook(0x433150, CPacManPickups::ClearPMPickUps, PATCH_JUMP);
InjectHook(0x433340, CPacManPickups::StartPacManRace, PATCH_JUMP);
InjectHook(0x433360, CPacManPickups::StartPacManRecord, PATCH_JUMP);
InjectHook(0x4333A0, CPacManPickups::QueryPowerPillsEatenInRace, PATCH_JUMP);
InjectHook(0x4333B0, CPacManPickups::ResetPowerPillsEatenInRace, PATCH_JUMP);
InjectHook(0x4333C0, CPacManPickups::CleanUpPacManStuff, PATCH_JUMP);
InjectHook(0x4333D0, CPacManPickups::StartPacManScramble, PATCH_JUMP);
InjectHook(0x4333F0, CPacManPickups::QueryPowerPillsCarriedByPlayer, PATCH_JUMP);
InjectHook(0x433410, CPacManPickups::ResetPowerPillsCarriedByPlayer, PATCH_JUMP);
ENDPATCHES

View File

@ -89,13 +89,13 @@ public:
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);
static CPickup(&aPickUps)[NUMPICKUPS]; static CPickup aPickUps[NUMPICKUPS];
// unused // unused
static bool &bPickUpcamActivated; static bool bPickUpcamActivated;
static CVehicle *&pPlayerVehicle; static CVehicle *pPlayerVehicle;
static CVector &StaticCamCoors; static CVector StaticCamCoors;
static uint32 &StaticCamStartTime; static uint32 StaticCamStartTime;
}; };
extern uint16 AmmoForWeapon[20]; extern uint16 AmmoForWeapon[20];

View File

@ -1,5 +1,5 @@
#include "common.h" #include "common.h"
#include "patcher.h"
#include "Record.h" #include "Record.h"
#include "FileMgr.h" #include "FileMgr.h"
@ -10,11 +10,11 @@
#include "VehicleModelInfo.h" #include "VehicleModelInfo.h"
#include "World.h" #include "World.h"
uint16 &CRecordDataForGame::RecordingState = *(uint16*)0x95CC24; uint16 CRecordDataForGame::RecordingState;
uint8*& CRecordDataForGame::pDataBuffer = *(uint8**)0x8F1B70; uint8* CRecordDataForGame::pDataBuffer;
uint8*& CRecordDataForGame::pDataBufferPointer = *(uint8**)0x8F1AB0; uint8* CRecordDataForGame::pDataBufferPointer;
int& CRecordDataForGame::FId = *(int*)0x885BA4; int CRecordDataForGame::FId;
tGameBuffer& CRecordDataForGame::pDataBufferForFrame = *(tGameBuffer*)0x72CED0; tGameBuffer CRecordDataForGame::pDataBufferForFrame;
#define MEMORY_FOR_GAME_RECORD (150000) #define MEMORY_FOR_GAME_RECORD (150000)
@ -176,15 +176,15 @@ uint16 CRecordDataForGame::CalcGameChecksum(void)
return checksum ^ checksum >> 16; return checksum ^ checksum >> 16;
} }
uint8& CRecordDataForChase::Status = *(uint8*)0x95CDCE; uint8 CRecordDataForChase::Status;
int& CRecordDataForChase::PositionChanges = *(int*)0x8F59C8; int CRecordDataForChase::PositionChanges;
uint8& CRecordDataForChase::CurrentCar = *(uint8*)0x95CDC9; uint8 CRecordDataForChase::CurrentCar;
CAutomobile* (&CRecordDataForChase::pChaseCars)[NUM_CHASE_CARS] = *(CAutomobile * (*)[NUM_CHASE_CARS])*(uintptr*)0x6F46A8; CAutomobile* CRecordDataForChase::pChaseCars[NUM_CHASE_CARS];
uint32& CRecordDataForChase::AnimStartTime = *(uint32*)0x8F1AEC; uint32 CRecordDataForChase::AnimStartTime;
float& CRecordDataForChase::AnimTime = *(float*)0x880F88; float CRecordDataForChase::AnimTime;
CCarStateEachFrame* (&CRecordDataForChase::pBaseMemForCar)[NUM_CHASE_CARS] = *(CCarStateEachFrame * (*)[NUM_CHASE_CARS])*(uintptr*)0x70EA18; CCarStateEachFrame* CRecordDataForChase::pBaseMemForCar[NUM_CHASE_CARS];
float& CRecordDataForChase::TimeMultiplier = *(float*)0x8E2A94; float CRecordDataForChase::TimeMultiplier;
int& CRecordDataForChase::FId2 = *(int*)0x8E2C18; int CRecordDataForChase::FId2;
#define CHASE_SCENE_LENGTH_IN_SECONDS (80) #define CHASE_SCENE_LENGTH_IN_SECONDS (80)
#define CHASE_SCENE_FRAMES_PER_SECOND (15) // skipping every second frame #define CHASE_SCENE_FRAMES_PER_SECOND (15) // skipping every second frame

View File

@ -23,7 +23,7 @@ public:
CVector pos; CVector pos;
}; };
extern char* gString; extern char gString[256];;
class CRecordDataForChase class CRecordDataForChase
{ {
@ -37,15 +37,15 @@ class CRecordDataForChase
STATE_PLAYBACK = 3, STATE_PLAYBACK = 3,
STATE_PLAYBACK_BEFORE_RECORDING = 4 STATE_PLAYBACK_BEFORE_RECORDING = 4
}; };
static uint8 &Status; static uint8 Status;
static int &PositionChanges; static int PositionChanges;
static uint8 &CurrentCar; static uint8 CurrentCar;
static CAutomobile*(&pChaseCars)[NUM_CHASE_CARS]; static CAutomobile*pChaseCars[NUM_CHASE_CARS];
static float &AnimTime; static float AnimTime;
static uint32 &AnimStartTime; static uint32 AnimStartTime;
static CCarStateEachFrame* (&pBaseMemForCar)[NUM_CHASE_CARS]; static CCarStateEachFrame* pBaseMemForCar[NUM_CHASE_CARS];
static float &TimeMultiplier; static float TimeMultiplier;
static int &FId2; static int FId2;
public: public:
static bool IsRecording(void) { return Status == STATE_RECORD; } static bool IsRecording(void) { return Status == STATE_RECORD; }
@ -86,11 +86,11 @@ class CRecordDataForGame
STATE_RECORD = 1, STATE_RECORD = 1,
STATE_PLAYBACK = 2, STATE_PLAYBACK = 2,
}; };
static uint16& RecordingState; static uint16 RecordingState;
static uint8* &pDataBuffer; static uint8* pDataBuffer;
static uint8* &pDataBufferPointer; static uint8* pDataBufferPointer;
static int &FId; static int FId;
static tGameBuffer &pDataBufferForFrame; static tGameBuffer pDataBufferForFrame;
public: public:
static bool IsRecording() { return RecordingState == STATE_RECORD; } static bool IsRecording() { return RecordingState == STATE_RECORD; }

View File

@ -1,5 +1,5 @@
#include "common.h" #include "common.h"
#include "patcher.h"
#include "Automobile.h" #include "Automobile.h"
#include "CarCtrl.h" #include "CarCtrl.h"
#include "Camera.h" #include "Camera.h"
@ -49,8 +49,3 @@ CRemote::TakeRemoteControlledCarFromPlayer(void)
CWorld::Players[CWorld::PlayerInFocus].m_bInRemoteMode = true; CWorld::Players[CWorld::PlayerInFocus].m_bInRemoteMode = true;
CWorld::Players[CWorld::PlayerInFocus].m_pRemoteVehicle->bRemoveFromWorld = true; CWorld::Players[CWorld::PlayerInFocus].m_pRemoteVehicle->bRemoveFromWorld = true;
} }
STARTPATCHES
InjectHook(0x435C30, &CRemote::GivePlayerRemoteControlledCar, PATCH_JUMP);
InjectHook(0x435DA0, &CRemote::TakeRemoteControlledCarFromPlayer, PATCH_JUMP);
ENDPATCHES

View File

@ -1,5 +1,5 @@
#include "common.h" #include "common.h"
#include "patcher.h"
#include "AnimBlendAssociation.h" #include "AnimBlendAssociation.h"
#include "Boat.h" #include "Boat.h"
#include "SpecialFX.h" #include "SpecialFX.h"
@ -39,71 +39,70 @@
#include "Camera.h" #include "Camera.h"
#include "Radar.h" #include "Radar.h"
uint8 &CReplay::Mode = *(uint8*)0x95CD5B; uint8 CReplay::Mode;
CAddressInReplayBuffer &CReplay::Record = *(CAddressInReplayBuffer*)0x942F7C; CAddressInReplayBuffer CReplay::Record;
CAddressInReplayBuffer &CReplay::Playback = *(CAddressInReplayBuffer*)0x8F5F48; CAddressInReplayBuffer CReplay::Playback;
uint8 *&CReplay::pBuf0 = *(uint8**)0x8E2C64; uint8 *CReplay::pBuf0;
CAutomobile *&CReplay::pBuf1 = *(CAutomobile**)0x8E2C68; CAutomobile *CReplay::pBuf1;
uint8 *&CReplay::pBuf2 = *(uint8**)0x8E2C6C; uint8 *CReplay::pBuf2;
CPlayerPed *&CReplay::pBuf3 = *(CPlayerPed**)0x8E2C70; CPlayerPed *CReplay::pBuf3;
uint8 *&CReplay::pBuf4 = *(uint8**)0x8E2C74; uint8 *CReplay::pBuf4;
CCutsceneHead *&CReplay::pBuf5 = *(CCutsceneHead**)0x8E2C78; CCutsceneHead *CReplay::pBuf5;
uint8 *&CReplay::pBuf6 = *(uint8**)0x8E2C80; uint8 *CReplay::pBuf6;
CPtrNode *&CReplay::pBuf7 = *(CPtrNode**)0x8E2C84; CPtrNode *CReplay::pBuf7;
uint8 *&CReplay::pBuf8 = *(uint8**)0x8E2C54; uint8 *CReplay::pBuf8;
CEntryInfoNode *&CReplay::pBuf9 = *(CEntryInfoNode**)0x8E2C58; CEntryInfoNode *CReplay::pBuf9;
uint8 *&CReplay::pBuf10 = *(uint8**)0x8F2C28; uint8 *CReplay::pBuf10;
CDummyPed *&CReplay::pBuf11 = *(CDummyPed**)0x8F2C2C; CDummyPed *CReplay::pBuf11;
uint8 *&CReplay::pRadarBlips = *(uint8**)0x8F29F8; uint8 *CReplay::pRadarBlips;
uint8 *&CReplay::pStoredCam = *(uint8**)0x8F2C34; uint8 *CReplay::pStoredCam;
uint8 *&CReplay::pWorld1 = *(uint8**)0x8E29C4; uint8 *CReplay::pWorld1;
CReference *&CReplay::pEmptyReferences = *(CReference**)0x8F256C; CReference *CReplay::pEmptyReferences;
CStoredDetailedAnimationState *&CReplay::pPedAnims = *(CStoredDetailedAnimationState**)0x8F6260; CStoredDetailedAnimationState *CReplay::pPedAnims;
uint8 *&CReplay::pPickups = *(uint8**)0x8F1A48; uint8 *CReplay::pPickups;
uint8 *&CReplay::pReferences = *(uint8**)0x880FAC; uint8 *CReplay::pReferences;
uint8(&CReplay::BufferStatus)[NUM_REPLAYBUFFERS] = *(uint8(*)[NUM_REPLAYBUFFERS])*(uintptr*)0x8804D8; uint8 CReplay::BufferStatus[NUM_REPLAYBUFFERS];
uint8(&CReplay::Buffers)[NUM_REPLAYBUFFERS][REPLAYBUFFERSIZE] = *(uint8(*)[NUM_REPLAYBUFFERS][REPLAYBUFFERSIZE])*(uintptr*)0x779958; uint8 CReplay::Buffers[NUM_REPLAYBUFFERS][REPLAYBUFFERSIZE];
bool &CReplay::bPlayingBackFromFile = *(bool*)0x95CD58; bool CReplay::bPlayingBackFromFile;
bool &CReplay::bReplayEnabled = *(bool*)0x617CAC; bool CReplay::bReplayEnabled = true;
uint32 &CReplay::SlowMotion = *(uint32*)0x9414D4; uint32 CReplay::SlowMotion;
uint32 &CReplay::FramesActiveLookAroundCam = *(uint32*)0x880F84; uint32 CReplay::FramesActiveLookAroundCam;
bool &CReplay::bDoLoadSceneWhenDone = *(bool*)0x95CD76; bool CReplay::bDoLoadSceneWhenDone;
CPtrList &CReplay::WorldPtrList = *(CPtrList*)0x880F90; CPtrList CReplay::WorldPtrList;
CPtrList &CReplay::BigBuildingPtrList = *(CPtrList*)0x941284; CPtrList CReplay::BigBuildingPtrList;
CWanted &CReplay::PlayerWanted = *(CWanted*)0x8F6278; CWanted CReplay::PlayerWanted;
CPlayerInfo &CReplay::PlayerInfo = *(CPlayerInfo*)0x8F5840; CPlayerInfo CReplay::PlayerInfo;
uint32 &CReplay::Time1 = *(uint32*)0x8F29DC; uint32 CReplay::Time1;
uint32 &CReplay::Time2 = *(uint32*)0x8F29D0; uint32 CReplay::Time2;
uint32 &CReplay::Time3 = *(uint32*)0x8F29D4; uint32 CReplay::Time3;
uint32 &CReplay::Time4 = *(uint32*)0x8F29C8; uint32 CReplay::Time4;
uint32 &CReplay::Frame = *(uint32*)0x8F2554; uint32 CReplay::Frame;
uint8 &CReplay::ClockHours = *(uint8*)0x95CDC5; uint8 CReplay::ClockHours;
uint8 &CReplay::ClockMinutes = *(uint8*)0x95CDA2; uint8 CReplay::ClockMinutes;
uint16 &CReplay::OldWeatherType = *(uint16*)0x95CCEA; uint16 CReplay::OldWeatherType;
uint16 &CReplay::NewWeatherType = *(uint16*)0x95CC6E; uint16 CReplay::NewWeatherType;
float &CReplay::WeatherInterpolationValue = *(float*)0x8F1A28; float CReplay::WeatherInterpolationValue;
float &CReplay::TimeStepNonClipped = *(float*)0x8F5FF4; float CReplay::TimeStepNonClipped;
float &CReplay::TimeStep = *(float*)0x8F2C24; float CReplay::TimeStep;
float &CReplay::TimeScale = *(float*)0x880E20; float CReplay::TimeScale;
float &CReplay::CameraFixedX = *(float*)0x943054; float CReplay::CameraFixedX;
float &CReplay::CameraFixedY = *(float*)0x943058; float CReplay::CameraFixedY;
float &CReplay::CameraFixedZ = *(float*)0x94305C; float CReplay::CameraFixedZ;
int32 &CReplay::OldRadioStation = *(int32*)0x94151C; int32 CReplay::OldRadioStation;
int8 &CReplay::CameraMode = *(int8*)0x95CD5F; int8 CReplay::CameraMode;
bool &CReplay::bAllowLookAroundCam = *(bool*)0x95CDCD; bool CReplay::bAllowLookAroundCam;
float &CReplay::LoadSceneX = *(float*)0x880F9C; float CReplay::LoadSceneX;
float &CReplay::LoadSceneY = *(float*)0x880F98; float CReplay::LoadSceneY;
float &CReplay::LoadSceneZ = *(float*)0x880F94; float CReplay::LoadSceneZ;
float &CReplay::CameraFocusX = *(float*)0x942F5C; float CReplay::CameraFocusX;
float &CReplay::CameraFocusY = *(float*)0x942F74; float CReplay::CameraFocusY;
float &CReplay::CameraFocusZ = *(float*)0x942F58; float CReplay::CameraFocusZ;
bool &CReplay::bPlayerInRCBuggy = *(bool*)0x95CDC3; bool CReplay::bPlayerInRCBuggy;
float &CReplay::fDistanceLookAroundCam = *(float*)0x885B44; float CReplay::fDistanceLookAroundCam;
float &CReplay::fBetaAngleLookAroundCam = *(float*)0x94072C; float CReplay::fBetaAngleLookAroundCam;
float &CReplay::fAlphaAngleLookAroundCam = *(float*)0x8F2A0C; float CReplay::fAlphaAngleLookAroundCam;
static void(*(&CBArray)[30])(CAnimBlendAssociation*, void*) = *(void(*(*)[30])(CAnimBlendAssociation*, void*))*(uintptr*)0x61052C; static void(*CBArray[])(CAnimBlendAssociation*, void*) =
static void(*CBArray_RE3[])(CAnimBlendAssociation*, void*) =
{ {
nil, &CPed::PedGetupCB, &CPed::PedStaggerCB, &CPed::PedEvadeCB, &CPed::FinishDieAnimCB, nil, &CPed::PedGetupCB, &CPed::PedStaggerCB, &CPed::PedEvadeCB, &CPed::FinishDieAnimCB,
&CPed::FinishedWaitCB, &CPed::FinishLaunchCB, &CPed::FinishHitHeadCB, &CPed::PedAnimGetInCB, &CPed::PedAnimDoorOpenCB, &CPed::FinishedWaitCB, &CPed::FinishLaunchCB, &CPed::FinishHitHeadCB, &CPed::PedAnimGetInCB, &CPed::PedAnimDoorOpenCB,
@ -119,16 +118,13 @@ static uint8 FindCBFunctionID(void(*f)(CAnimBlendAssociation*, void*))
if (CBArray[i] == f) if (CBArray[i] == f)
return i; return i;
} }
for (int i = 0; i < sizeof(CBArray_RE3) / sizeof(*CBArray_RE3); i++) {
if (CBArray_RE3[i] == f)
return i;
}
return 0; return 0;
} }
static void(*FindCBFunction(uint8 id))(CAnimBlendAssociation*, void*) static void(*FindCBFunction(uint8 id))(CAnimBlendAssociation*, void*)
{ {
return CBArray_RE3[id]; return CBArray[id];
} }
static void ApplyPanelDamageToCar(uint32 panels, CAutomobile* vehicle, bool flying) static void ApplyPanelDamageToCar(uint32 panels, CAutomobile* vehicle, bool flying)
@ -1087,7 +1083,7 @@ void CReplay::TriggerPlayback(uint8 cam_mode, float cam_x, float cam_y, float ca
Playback.m_bSlot = first; Playback.m_bSlot = first;
Playback.m_nOffset = 0; Playback.m_nOffset = 0;
Playback.m_pBase = Buffers[first]; Playback.m_pBase = Buffers[first];
CObject::DeleteAllTempObjectInArea(CVector(0.0f, 0.0f, 0.0f), 1000000.0f); CObject::DeleteAllTempObjectsInArea(CVector(0.0f, 0.0f, 0.0f), 1000000.0f);
StoreStuffInMem(); StoreStuffInMem();
EmptyPedsAndVehiclePools(); EmptyPedsAndVehiclePools();
SlowMotion = 1; SlowMotion = 1;
@ -1574,16 +1570,3 @@ void CReplay::Display()
if (Mode == MODE_PLAYBACK) if (Mode == MODE_PLAYBACK)
CFont::PrintString(SCREEN_SCALE_X(63.5f), SCREEN_SCALE_Y(30.0f), TheText.Get("REPLAY")); CFont::PrintString(SCREEN_SCALE_X(63.5f), SCREEN_SCALE_Y(30.0f), TheText.Get("REPLAY"));
} }
STARTPATCHES
InjectHook(0x592FE0, &CReplay::Init, PATCH_JUMP);
InjectHook(0x593150, &CReplay::DisableReplays, PATCH_JUMP);
InjectHook(0x593160, &CReplay::EnableReplays, PATCH_JUMP);
InjectHook(0x593170, &CReplay::Update, PATCH_JUMP);
InjectHook(0x595B20, &CReplay::FinishPlayback, PATCH_JUMP);
InjectHook(0x595BD0, &CReplay::EmptyReplayBuffer, PATCH_JUMP);
InjectHook(0x595EE0, &CReplay::Display, PATCH_JUMP);
InjectHook(0x596030, &CReplay::TriggerPlayback, PATCH_JUMP);
InjectHook(0x597560, &CReplay::StreamAllNecessaryCarsAndPeds, PATCH_JUMP);
InjectHook(0x597680, &CReplay::ShouldStandardCameraBeProcessed, PATCH_JUMP);
ENDPATCHES

View File

@ -205,68 +205,68 @@ class CReplay
static_assert(sizeof(tVehicleUpdatePacket) == 48, "tVehicleUpdatePacket: error"); static_assert(sizeof(tVehicleUpdatePacket) == 48, "tVehicleUpdatePacket: error");
private: private:
static uint8 &Mode; static uint8 Mode;
static CAddressInReplayBuffer &Record; static CAddressInReplayBuffer Record;
static CAddressInReplayBuffer &Playback; static CAddressInReplayBuffer Playback;
static uint8 *&pBuf0; static uint8 *pBuf0;
static CAutomobile *&pBuf1; static CAutomobile *pBuf1;
static uint8 *&pBuf2; static uint8 *pBuf2;
static CPlayerPed *&pBuf3; static CPlayerPed *pBuf3;
static uint8 *&pBuf4; static uint8 *pBuf4;
static CCutsceneHead *&pBuf5; static CCutsceneHead *pBuf5;
static uint8 *&pBuf6; static uint8 *pBuf6;
static CPtrNode *&pBuf7; static CPtrNode *pBuf7;
static uint8 *&pBuf8; static uint8 *pBuf8;
static CEntryInfoNode *&pBuf9; static CEntryInfoNode *pBuf9;
static uint8 *&pBuf10; static uint8 *pBuf10;
static CDummyPed *&pBuf11; static CDummyPed *pBuf11;
static uint8 *&pRadarBlips; static uint8 *pRadarBlips;
static uint8 *&pStoredCam; static uint8 *pStoredCam;
static uint8 *&pWorld1; static uint8 *pWorld1;
static CReference *&pEmptyReferences; static CReference *pEmptyReferences;
static CStoredDetailedAnimationState *&pPedAnims; static CStoredDetailedAnimationState *pPedAnims;
static uint8 *&pPickups; static uint8 *pPickups;
static uint8 *&pReferences; static uint8 *pReferences;
static uint8 (&BufferStatus)[NUM_REPLAYBUFFERS]; static uint8 BufferStatus[NUM_REPLAYBUFFERS];
static uint8 (&Buffers)[NUM_REPLAYBUFFERS][REPLAYBUFFERSIZE]; static uint8 Buffers[NUM_REPLAYBUFFERS][REPLAYBUFFERSIZE];
static bool &bPlayingBackFromFile; static bool bPlayingBackFromFile;
static bool &bReplayEnabled; static bool bReplayEnabled;
static uint32 &SlowMotion; static uint32 SlowMotion;
static uint32 &FramesActiveLookAroundCam; static uint32 FramesActiveLookAroundCam;
static bool &bDoLoadSceneWhenDone; static bool bDoLoadSceneWhenDone;
static CPtrList &WorldPtrList; static CPtrList WorldPtrList;
static CPtrList &BigBuildingPtrList; static CPtrList BigBuildingPtrList;
static CWanted &PlayerWanted; static CWanted PlayerWanted;
static CPlayerInfo &PlayerInfo; static CPlayerInfo PlayerInfo;
static uint32 &Time1; static uint32 Time1;
static uint32 &Time2; static uint32 Time2;
static uint32 &Time3; static uint32 Time3;
static uint32 &Time4; static uint32 Time4;
static uint32 &Frame; static uint32 Frame;
static uint8 &ClockHours; static uint8 ClockHours;
static uint8 &ClockMinutes; static uint8 ClockMinutes;
static uint16 &OldWeatherType; static uint16 OldWeatherType;
static uint16 &NewWeatherType; static uint16 NewWeatherType;
static float &WeatherInterpolationValue; static float WeatherInterpolationValue;
static float &TimeStepNonClipped; static float TimeStepNonClipped;
static float &TimeStep; static float TimeStep;
static float &TimeScale; static float TimeScale;
static float &CameraFixedX; static float CameraFixedX;
static float &CameraFixedY; static float CameraFixedY;
static float &CameraFixedZ; static float CameraFixedZ;
static int32 &OldRadioStation; static int32 OldRadioStation;
static int8 &CameraMode; static int8 CameraMode;
static bool &bAllowLookAroundCam; static bool bAllowLookAroundCam;
static float &LoadSceneX; static float LoadSceneX;
static float &LoadSceneY; static float LoadSceneY;
static float &LoadSceneZ; static float LoadSceneZ;
static float &CameraFocusX; static float CameraFocusX;
static float &CameraFocusY; static float CameraFocusY;
static float &CameraFocusZ; static float CameraFocusZ;
static bool &bPlayerInRCBuggy; static bool bPlayerInRCBuggy;
static float &fDistanceLookAroundCam; static float fDistanceLookAroundCam;
static float &fAlphaAngleLookAroundCam; static float fAlphaAngleLookAroundCam;
static float &fBetaAngleLookAroundCam; static float fBetaAngleLookAroundCam;
public: public:
static void Init(void); static void Init(void);

View File

@ -1,25 +1,25 @@
#include "common.h" #include "common.h"
#include "patcher.h"
#include "Restart.h" #include "Restart.h"
#include "Zones.h" #include "Zones.h"
#include "PathFind.h" #include "PathFind.h"
uint8 &CRestart::OverrideHospitalLevel = *(uint8*)0x95CD4C; uint8 CRestart::OverrideHospitalLevel;
uint8 &CRestart::OverridePoliceStationLevel = *(uint8*)0x95CD50; uint8 CRestart::OverridePoliceStationLevel;
bool &CRestart::bFadeInAfterNextArrest = *(bool*)0x95CD69; bool CRestart::bFadeInAfterNextArrest;
bool &CRestart::bFadeInAfterNextDeath = *(bool*)0x95CD9D; bool CRestart::bFadeInAfterNextDeath;
bool &CRestart::bOverrideRestart = *(bool*)0x95CD5D; bool CRestart::bOverrideRestart;
CVector &CRestart::OverridePosition = *(CVector*)0x8E2C00; CVector CRestart::OverridePosition;
float &CRestart::OverrideHeading = *(float*)0x8F2A18; float CRestart::OverrideHeading;
CVector(&CRestart::HospitalRestartPoints)[NUM_RESTART_POINTS] = *(CVector(*)[NUM_RESTART_POINTS])*(uintptr*)0x87F9B0; CVector CRestart::HospitalRestartPoints[NUM_RESTART_POINTS];
float(&CRestart::HospitalRestartHeadings)[NUM_RESTART_POINTS] = *(float(*)[NUM_RESTART_POINTS])*(uintptr*)0x6F1D40; float CRestart::HospitalRestartHeadings[NUM_RESTART_POINTS];
uint16 &CRestart::NumberOfHospitalRestarts = *(uint16*)0x95CC46; uint16 CRestart::NumberOfHospitalRestarts;
CVector(&CRestart::PoliceRestartPoints)[NUM_RESTART_POINTS] = *(CVector(*)[NUM_RESTART_POINTS])*(uintptr*)0x846228; CVector CRestart::PoliceRestartPoints[NUM_RESTART_POINTS];
float(&CRestart::PoliceRestartHeadings)[NUM_RESTART_POINTS] = *(float(*)[NUM_RESTART_POINTS])*(uintptr*)0x6F1D20; float CRestart::PoliceRestartHeadings[NUM_RESTART_POINTS];
uint16 &CRestart::NumberOfPoliceRestarts = *(uint16*)0x95CC44; uint16 CRestart::NumberOfPoliceRestarts;
void void
CRestart::Initialise() CRestart::Initialise()
@ -247,16 +247,3 @@ INITSAVEBUF
WriteSaveBuf(buf, OverridePoliceStationLevel); WriteSaveBuf(buf, OverridePoliceStationLevel);
VALIDATESAVEBUF(*size); VALIDATESAVEBUF(*size);
} }
STARTPATCHES
InjectHook(0x435E20, &CRestart::Initialise, PATCH_JUMP);
InjectHook(0x436100, &CRestart::AddHospitalRestartPoint, PATCH_JUMP);
InjectHook(0x436150, &CRestart::AddPoliceRestartPoint, PATCH_JUMP);
InjectHook(0x4366C0, &CRestart::OverrideNextRestart, PATCH_JUMP);
InjectHook(0x4366F0, &CRestart::CancelOverrideRestart, PATCH_JUMP);
InjectHook(0x4361A0, &CRestart::FindClosestHospitalRestartPoint, PATCH_JUMP);
InjectHook(0x436450, &CRestart::FindClosestPoliceRestartPoint, PATCH_JUMP);
InjectHook(0x436B20, &CRestart::LoadAllRestartPoints, PATCH_JUMP);
InjectHook(0x436700, &CRestart::SaveAllRestartPoints, PATCH_JUMP);
ENDPATCHES

View File

@ -17,20 +17,20 @@ public:
static void LoadAllRestartPoints(uint8 *buf, uint32 size); static void LoadAllRestartPoints(uint8 *buf, uint32 size);
static void SaveAllRestartPoints(uint8 *buf, uint32 *size); static void SaveAllRestartPoints(uint8 *buf, uint32 *size);
static uint8 &OverrideHospitalLevel; static uint8 OverrideHospitalLevel;
static uint8 &OverridePoliceStationLevel; static uint8 OverridePoliceStationLevel;
static bool &bFadeInAfterNextArrest; static bool bFadeInAfterNextArrest;
static bool &bFadeInAfterNextDeath; static bool bFadeInAfterNextDeath;
static bool &bOverrideRestart; static bool bOverrideRestart;
static CVector &OverridePosition; static CVector OverridePosition;
static float &OverrideHeading; static float OverrideHeading;
static CVector(&HospitalRestartPoints)[NUM_RESTART_POINTS]; static CVector HospitalRestartPoints[NUM_RESTART_POINTS];
static float (&HospitalRestartHeadings)[NUM_RESTART_POINTS]; static float HospitalRestartHeadings[NUM_RESTART_POINTS];
static uint16 &NumberOfHospitalRestarts; static uint16 NumberOfHospitalRestarts;
static CVector (&PoliceRestartPoints)[NUM_RESTART_POINTS]; static CVector PoliceRestartPoints[NUM_RESTART_POINTS];
static float (&PoliceRestartHeadings)[NUM_RESTART_POINTS]; static float PoliceRestartHeadings[NUM_RESTART_POINTS];
static uint16 &NumberOfPoliceRestarts; static uint16 NumberOfPoliceRestarts;
}; };

View File

@ -1,5 +1,5 @@
#include "common.h" #include "common.h"
#include "patcher.h"
#include "RoadBlocks.h" #include "RoadBlocks.h"
#include "PathFind.h" #include "PathFind.h"
#include "ModelIndices.h" #include "ModelIndices.h"
@ -15,9 +15,9 @@
#include "CarCtrl.h" #include "CarCtrl.h"
#include "General.h" #include "General.h"
int16 &CRoadBlocks::NumRoadBlocks = *(int16*)0x95CC34; int16 CRoadBlocks::NumRoadBlocks;
int16 (&CRoadBlocks::RoadBlockObjects)[NUMROADBLOCKS] = *(int16(*)[NUMROADBLOCKS]) * (uintptr*)0x72B3A8; int16 CRoadBlocks::RoadBlockObjects[NUMROADBLOCKS];
bool (&CRoadBlocks::InOrOut)[NUMROADBLOCKS] = *(bool(*)[NUMROADBLOCKS]) * (uintptr*)0x733810; bool CRoadBlocks::InOrOut[NUMROADBLOCKS];
void void
CRoadBlocks::Init(void) CRoadBlocks::Init(void)
@ -195,9 +195,3 @@ CRoadBlocks::GenerateRoadBlocks(void)
} }
} }
} }
STARTPATCHES
InjectHook(0x436F50, &CRoadBlocks::Init, PATCH_JUMP);
InjectHook(0x4376A0, &CRoadBlocks::GenerateRoadBlockCopsForCar, PATCH_JUMP);
InjectHook(0x436FA0, &CRoadBlocks::GenerateRoadBlocks, PATCH_JUMP);
ENDPATCHES

View File

@ -6,9 +6,9 @@ class CVehicle;
class CRoadBlocks class CRoadBlocks
{ {
public: public:
static int16 (&NumRoadBlocks); static int16 NumRoadBlocks;
static int16 (&RoadBlockObjects)[NUMROADBLOCKS]; static int16 RoadBlockObjects[NUMROADBLOCKS];
static bool (&InOrOut)[NUMROADBLOCKS]; static bool InOrOut[NUMROADBLOCKS];
static void Init(void); static void Init(void);
static void GenerateRoadBlockCopsForCar(CVehicle* pVehicle, int32 roadBlockType, int16 roadBlockNode); static void GenerateRoadBlockCopsForCar(CVehicle* pVehicle, int32 roadBlockType, int16 roadBlockNode);

View File

@ -1,5 +1,5 @@
#include "common.h" #include "common.h"
#include "patcher.h"
#include "SceneEdit.h" #include "SceneEdit.h"
#include "Automobile.h" #include "Automobile.h"

View File

@ -1,6 +1,6 @@
#define WITHWINDOWS // for our script loading hack #define WITHWINDOWS // for our script loading hack
#include "common.h" #include "common.h"
#include "patcher.h"
#include "Script.h" #include "Script.h"
#include "ScriptCommands.h" #include "ScriptCommands.h"
@ -87,47 +87,47 @@
#define FEET_IN_METER 3.33f #define FEET_IN_METER 3.33f
#endif #endif
uint8 (&CTheScripts::ScriptSpace)[SIZE_SCRIPT_SPACE] = *(uint8(*)[SIZE_SCRIPT_SPACE])*(uintptr*)0x74B248; uint8 CTheScripts::ScriptSpace[SIZE_SCRIPT_SPACE];
CRunningScript(&CTheScripts::ScriptsArray)[MAX_NUM_SCRIPTS] = *(CRunningScript(*)[MAX_NUM_SCRIPTS])*(uintptr*)0x6F5C08; CRunningScript CTheScripts::ScriptsArray[MAX_NUM_SCRIPTS];
int32(&CTheScripts::BaseBriefIdForContact)[MAX_NUM_CONTACTS] = *(int32(*)[MAX_NUM_CONTACTS])*(uintptr*)0x880200; int32 CTheScripts::BaseBriefIdForContact[MAX_NUM_CONTACTS];
int32(&CTheScripts::OnAMissionForContactFlag)[MAX_NUM_CONTACTS] = *(int32(*)[MAX_NUM_CONTACTS])*(uintptr*)0x8622F0; int32 CTheScripts::OnAMissionForContactFlag[MAX_NUM_CONTACTS];
intro_text_line (&CTheScripts::IntroTextLines)[MAX_NUM_INTRO_TEXT_LINES] = *(intro_text_line (*)[MAX_NUM_INTRO_TEXT_LINES])*(uintptr*)0x70EA68; intro_text_line CTheScripts::IntroTextLines[MAX_NUM_INTRO_TEXT_LINES];
intro_script_rectangle (&CTheScripts::IntroRectangles)[MAX_NUM_INTRO_RECTANGLES] = *(intro_script_rectangle (*)[MAX_NUM_INTRO_RECTANGLES])*(uintptr*)0x72D108; intro_script_rectangle CTheScripts::IntroRectangles[MAX_NUM_INTRO_RECTANGLES];
CSprite2d (&CTheScripts::ScriptSprites)[MAX_NUM_SCRIPT_SRPITES] = *(CSprite2d(*)[MAX_NUM_SCRIPT_SRPITES])*(uintptr*)0x72B090; CSprite2d CTheScripts::ScriptSprites[MAX_NUM_SCRIPT_SRPITES];
script_sphere_struct(&CTheScripts::ScriptSphereArray)[MAX_NUM_SCRIPT_SPHERES] = *(script_sphere_struct(*)[MAX_NUM_SCRIPT_SPHERES])*(uintptr*)0x727D60; script_sphere_struct CTheScripts::ScriptSphereArray[MAX_NUM_SCRIPT_SPHERES];
tCollectiveData(&CTheScripts::CollectiveArray)[MAX_NUM_COLLECTIVES] = *(tCollectiveData(*)[MAX_NUM_COLLECTIVES])*(uintptr*)0x6FA008; tCollectiveData CTheScripts::CollectiveArray[MAX_NUM_COLLECTIVES];
tUsedObject(&CTheScripts::UsedObjectArray)[MAX_NUM_USED_OBJECTS] = *(tUsedObject(*)[MAX_NUM_USED_OBJECTS])*(uintptr*)0x6E69C8; tUsedObject CTheScripts::UsedObjectArray[MAX_NUM_USED_OBJECTS];
int32(&CTheScripts::MultiScriptArray)[MAX_NUM_MISSION_SCRIPTS] = *(int32(*)[MAX_NUM_MISSION_SCRIPTS])*(uintptr*)0x6F0558; int32 CTheScripts::MultiScriptArray[MAX_NUM_MISSION_SCRIPTS];
tBuildingSwap(&CTheScripts::BuildingSwapArray)[MAX_NUM_BUILDING_SWAPS] = *(tBuildingSwap(*)[MAX_NUM_BUILDING_SWAPS])*(uintptr*)0x880E30; tBuildingSwap CTheScripts::BuildingSwapArray[MAX_NUM_BUILDING_SWAPS];
CEntity*(&CTheScripts::InvisibilitySettingArray)[MAX_NUM_INVISIBILITY_SETTINGS] = *(CEntity*(*)[MAX_NUM_INVISIBILITY_SETTINGS])*(uintptr*)0x8620F0; CEntity* CTheScripts::InvisibilitySettingArray[MAX_NUM_INVISIBILITY_SETTINGS];
CStoredLine (&CTheScripts::aStoredLines)[MAX_NUM_STORED_LINES] = *(CStoredLine(*)[MAX_NUM_STORED_LINES])*(uintptr*)0x743018; CStoredLine CTheScripts::aStoredLines[MAX_NUM_STORED_LINES];
bool &CTheScripts::DbgFlag = *(bool*)0x95CD87; bool CTheScripts::DbgFlag;
uint32 &CTheScripts::OnAMissionFlag = *(uint32*)0x8F1B64; uint32 CTheScripts::OnAMissionFlag;
int32 &CTheScripts::StoreVehicleIndex = *(int32*)0x8F5F3C; int32 CTheScripts::StoreVehicleIndex;
bool &CTheScripts::StoreVehicleWasRandom = *(bool*)0x95CDBC; bool CTheScripts::StoreVehicleWasRandom;
CRunningScript *&CTheScripts::pIdleScripts = *(CRunningScript**)0x9430D4; CRunningScript *CTheScripts::pIdleScripts;
CRunningScript *&CTheScripts::pActiveScripts = *(CRunningScript**)0x8E2BF4; CRunningScript *CTheScripts::pActiveScripts;
uint32 &CTheScripts::NextFreeCollectiveIndex = *(uint32*)0x942F98; uint32 CTheScripts::NextFreeCollectiveIndex;
int32 &CTheScripts::LastRandomPedId = *(int32*)0x8F251C; int32 CTheScripts::LastRandomPedId;
uint16 &CTheScripts::NumberOfUsedObjects = *(uint16*)0x95CC72; uint16 CTheScripts::NumberOfUsedObjects;
bool &CTheScripts::bAlreadyRunningAMissionScript = *(bool*)0x95CDB3; bool CTheScripts::bAlreadyRunningAMissionScript;
bool &CTheScripts::bUsingAMultiScriptFile = *(bool*)0x95CD55; bool CTheScripts::bUsingAMultiScriptFile;
uint16 &CTheScripts::NumberOfMissionScripts = *(uint16*)0x95CC9A; uint16 CTheScripts::NumberOfMissionScripts;
uint32 &CTheScripts::LargestMissionScriptSize = *(uint32*)0x9414C8; uint32 CTheScripts::LargestMissionScriptSize;
uint32 &CTheScripts::MainScriptSize = *(uint32*)0x9405A4; uint32 CTheScripts::MainScriptSize;
uint8 &CTheScripts::FailCurrentMission = *(uint8*)0x95CD41; uint8 CTheScripts::FailCurrentMission;
uint8 &CTheScripts::CountdownToMakePlayerUnsafe = *(uint8*)0x95CD51; uint8 CTheScripts::CountdownToMakePlayerUnsafe;
uint8 &CTheScripts::DelayMakingPlayerUnsafeThisTime = *(uint8*)0x95CD88; uint8 CTheScripts::DelayMakingPlayerUnsafeThisTime;
uint16 &CTheScripts::NumScriptDebugLines = *(uint16*)0x95CC42; uint16 CTheScripts::NumScriptDebugLines;
uint16 &CTheScripts::NumberOfIntroRectanglesThisFrame = *(uint16*)0x95CC88; uint16 CTheScripts::NumberOfIntroRectanglesThisFrame;
uint16 &CTheScripts::NumberOfIntroTextLinesThisFrame = *(uint16*)0x95CC32; uint16 CTheScripts::NumberOfIntroTextLinesThisFrame;
uint8 &CTheScripts::UseTextCommands = *(uint8*)0x95CD57; uint8 CTheScripts::UseTextCommands;
CMissionCleanup (&CTheScripts::MissionCleanup) = *(CMissionCleanup*)0x8F2A24; CMissionCleanup CTheScripts::MissionCleanup;
CUpsideDownCarCheck (&CTheScripts::UpsideDownCars) = *(CUpsideDownCarCheck*)0x6EE450; CUpsideDownCarCheck CTheScripts::UpsideDownCars;
CStuckCarCheck (&CTheScripts::StuckCars) = *(CStuckCarCheck*)0x87C588; CStuckCarCheck CTheScripts::StuckCars;
uint16 &CTheScripts::CommandsExecuted = *(uint16*)0x95CCA6; uint16 CTheScripts::CommandsExecuted;
uint16 &CTheScripts::ScriptsUpdated = *(uint16*)0x95CC5E; uint16 CTheScripts::ScriptsUpdated;
int32(&ScriptParams)[32] = *(int32(*)[32])*(uintptr*)0x6ED460; int32 ScriptParams[32];
CMissionCleanup::CMissionCleanup() CMissionCleanup::CMissionCleanup()
{ {
@ -11626,17 +11626,3 @@ void CTheScripts::ReadMultiScriptFileOffsetsFromScript()
MultiScriptArray[i] = Read4BytesFromScript(&ip); MultiScriptArray[i] = Read4BytesFromScript(&ip);
} }
} }
STARTPATCHES
InjectHook(0x438790, &CTheScripts::Init, PATCH_JUMP);
InjectHook(0x439040, &CTheScripts::Process, PATCH_JUMP);
InjectHook(0x439400, &CTheScripts::StartTestScript, PATCH_JUMP);
InjectHook(0x439410, &CTheScripts::IsPlayerOnAMission, PATCH_JUMP);
InjectHook(0x44FD10, &CTheScripts::UndoBuildingSwaps, PATCH_JUMP);
InjectHook(0x44FD60, &CTheScripts::UndoEntityInvisibilitySettings, PATCH_JUMP);
InjectHook(0x4534E0, &CTheScripts::ScriptDebugLine3D, PATCH_JUMP);
InjectHook(0x453550, &CTheScripts::RenderTheScriptDebugLines, PATCH_JUMP);
InjectHook(0x4535E0, &CTheScripts::SaveAllScripts, PATCH_JUMP);
InjectHook(0x453B30, &CTheScripts::LoadAllScripts, PATCH_JUMP);
InjectHook(0x454060, &CTheScripts::ClearSpaceForMissionEntity, PATCH_JUMP);
ENDPATCHES

View File

@ -240,46 +240,46 @@ enum {
class CTheScripts class CTheScripts
{ {
static uint8(&ScriptSpace)[SIZE_SCRIPT_SPACE]; static uint8 ScriptSpace[SIZE_SCRIPT_SPACE];
static CRunningScript(&ScriptsArray)[MAX_NUM_SCRIPTS]; static CRunningScript ScriptsArray[MAX_NUM_SCRIPTS];
static int32(&BaseBriefIdForContact)[MAX_NUM_CONTACTS]; static int32 BaseBriefIdForContact[MAX_NUM_CONTACTS];
static int32(&OnAMissionForContactFlag)[MAX_NUM_CONTACTS]; static int32 OnAMissionForContactFlag[MAX_NUM_CONTACTS];
static intro_text_line(&IntroTextLines)[MAX_NUM_INTRO_TEXT_LINES]; static intro_text_line IntroTextLines[MAX_NUM_INTRO_TEXT_LINES];
static intro_script_rectangle(&IntroRectangles)[MAX_NUM_INTRO_RECTANGLES]; static intro_script_rectangle IntroRectangles[MAX_NUM_INTRO_RECTANGLES];
static CSprite2d(&ScriptSprites)[MAX_NUM_SCRIPT_SRPITES]; static CSprite2d ScriptSprites[MAX_NUM_SCRIPT_SRPITES];
static script_sphere_struct(&ScriptSphereArray)[MAX_NUM_SCRIPT_SPHERES]; static script_sphere_struct ScriptSphereArray[MAX_NUM_SCRIPT_SPHERES];
static tCollectiveData(&CollectiveArray)[MAX_NUM_COLLECTIVES]; static tCollectiveData CollectiveArray[MAX_NUM_COLLECTIVES];
static tUsedObject(&UsedObjectArray)[MAX_NUM_USED_OBJECTS]; static tUsedObject UsedObjectArray[MAX_NUM_USED_OBJECTS];
static int32(&MultiScriptArray)[MAX_NUM_MISSION_SCRIPTS]; static int32 MultiScriptArray[MAX_NUM_MISSION_SCRIPTS];
static tBuildingSwap(&BuildingSwapArray)[MAX_NUM_BUILDING_SWAPS]; static tBuildingSwap BuildingSwapArray[MAX_NUM_BUILDING_SWAPS];
static CEntity*(&InvisibilitySettingArray)[MAX_NUM_INVISIBILITY_SETTINGS]; static CEntity* InvisibilitySettingArray[MAX_NUM_INVISIBILITY_SETTINGS];
static CStoredLine(&aStoredLines)[MAX_NUM_STORED_LINES]; static CStoredLine aStoredLines[MAX_NUM_STORED_LINES];
static bool &DbgFlag; static bool DbgFlag;
static uint32 &OnAMissionFlag; static uint32 OnAMissionFlag;
static CMissionCleanup &MissionCleanup; static CMissionCleanup MissionCleanup;
static CStuckCarCheck &StuckCars; static CStuckCarCheck StuckCars;
static CUpsideDownCarCheck &UpsideDownCars; static CUpsideDownCarCheck UpsideDownCars;
static int32 &StoreVehicleIndex; static int32 StoreVehicleIndex;
static bool &StoreVehicleWasRandom; static bool StoreVehicleWasRandom;
static CRunningScript *&pIdleScripts; static CRunningScript *pIdleScripts;
static CRunningScript *&pActiveScripts; static CRunningScript *pActiveScripts;
static uint32 &NextFreeCollectiveIndex; static uint32 NextFreeCollectiveIndex;
static int32 &LastRandomPedId; static int32 LastRandomPedId;
static uint16 &NumberOfUsedObjects; static uint16 NumberOfUsedObjects;
static bool &bAlreadyRunningAMissionScript; static bool bAlreadyRunningAMissionScript;
static bool &bUsingAMultiScriptFile; static bool bUsingAMultiScriptFile;
static uint16 &NumberOfMissionScripts; static uint16 NumberOfMissionScripts;
static uint32 &LargestMissionScriptSize; static uint32 LargestMissionScriptSize;
static uint32 &MainScriptSize; static uint32 MainScriptSize;
static uint8 &FailCurrentMission; static uint8 FailCurrentMission;
static uint8 &CountdownToMakePlayerUnsafe; static uint8 CountdownToMakePlayerUnsafe;
static uint8 &DelayMakingPlayerUnsafeThisTime; static uint8 DelayMakingPlayerUnsafeThisTime;
static uint16 &NumScriptDebugLines; static uint16 NumScriptDebugLines;
static uint16 &NumberOfIntroRectanglesThisFrame; static uint16 NumberOfIntroRectanglesThisFrame;
static uint16 &NumberOfIntroTextLinesThisFrame; static uint16 NumberOfIntroTextLinesThisFrame;
static uint8 &UseTextCommands; static uint8 UseTextCommands;
static uint16 &CommandsExecuted; static uint16 CommandsExecuted;
static uint16 &ScriptsUpdated; static uint16 ScriptsUpdated;
public: public:
static void Init(); static void Init();

View File

@ -1,5 +1,5 @@
#include "common.h" #include "common.h"
#include "patcher.h"
#include "General.h" #include "General.h"
#include "Camera.h" #include "Camera.h"
#include "World.h" #include "World.h"
@ -327,9 +327,3 @@ CTrafficLights::LightForCars2(void)
else else
return CAR_LIGHTS_RED; return CAR_LIGHTS_RED;
} }
STARTPATCHES
InjectHook(0x455760, &CTrafficLights::LightForCars1, PATCH_JUMP);
InjectHook(0x455790, &CTrafficLights::LightForCars2, PATCH_JUMP);
InjectHook(0x4557D0, &CTrafficLights::LightForPeds, PATCH_JUMP);
ENDPATCHES

View File

@ -1,12 +1,12 @@
#include "common.h" #include "common.h"
#include "patcher.h"
#include "Accident.h" #include "Accident.h"
#include "Ped.h" #include "Ped.h"
#include "Pools.h" #include "Pools.h"
#include "World.h" #include "World.h"
CAccidentManager& gAccidentManager = *(CAccidentManager*)0x87FD10; CAccidentManager gAccidentManager;
CAccident* CAccident*
CAccidentManager::GetNextFreeAccident() CAccidentManager::GetNextFreeAccident()
@ -122,13 +122,3 @@ CAccidentManager::UnattendedAccidents()
} }
return false; return false;
} }
STARTPATCHES
InjectHook(0x4565A0, &CAccidentManager::GetNextFreeAccident, PATCH_JUMP);
InjectHook(0x4565D0, &CAccidentManager::ReportAccident, PATCH_JUMP);
InjectHook(0x456710, &CAccidentManager::Update, PATCH_JUMP);
InjectHook(0x456760, &CAccidentManager::FindNearestAccident, PATCH_JUMP);
InjectHook(0x456880, &CAccidentManager::CountActiveAccidents, PATCH_JUMP);
InjectHook(0x4568A0, &CAccidentManager::WorkToDoForMedics, PATCH_JUMP);
InjectHook(0x4568D0, &CAccidentManager::UnattendedAccidents, PATCH_JUMP);
ENDPATCHES

View File

@ -29,4 +29,4 @@ public:
bool WorkToDoForMedics(); bool WorkToDoForMedics();
}; };
extern CAccidentManager& gAccidentManager; extern CAccidentManager gAccidentManager;

View File

@ -1,5 +1,5 @@
#include "common.h" #include "common.h"
#include "patcher.h"
#include "Font.h" #include "Font.h"
#include "Pad.h" #include "Pad.h"
#include "Text.h" #include "Text.h"

View File

@ -1,5 +1,5 @@
#include "common.h" #include "common.h"
#include "patcher.h"
#include "main.h" #include "main.h"
#include "Draw.h" #include "Draw.h"
#include "World.h" #include "World.h"
@ -28,7 +28,7 @@
const float DefaultFOV = 70.0f; // beta: 80.0f const float DefaultFOV = 70.0f; // beta: 80.0f
bool PrintDebugCode = false; bool PrintDebugCode = false;
int16 &DebugCamMode = *(int16*)0x95CCF2; int16 DebugCamMode;
#ifdef FREE_CAM #ifdef FREE_CAM
bool CCamera::bFreeCam = false; bool CCamera::bFreeCam = false;
@ -5236,55 +5236,3 @@ CCam::Process_FollowCar_SA(const CVector& CameraTarget, float TargetOrientation,
} }
} }
#endif #endif
STARTPATCHES
InjectHook(0x456F40, WellBufferMe, PATCH_JUMP);
InjectHook(0x458410, &CCam::Init, PATCH_JUMP);
InjectHook(0x4582F0, &CCam::GetVectorsReadyForRW, PATCH_JUMP);
InjectHook(0x457710, &CCam::DoAverageOnVector, PATCH_JUMP);
InjectHook(0x458060, &CCam::GetPedBetaAngleForClearView, PATCH_JUMP);
InjectHook(0x457210, &CCam::Cam_On_A_String_Unobscured, PATCH_JUMP);
InjectHook(0x457A80, &CCam::FixCamWhenObscuredByVehicle, PATCH_JUMP);
InjectHook(0x457B90, &CCam::FixCamIfObscured, PATCH_JUMP);
InjectHook(0x465DA0, &CCam::RotCamIfInFrontCar, PATCH_JUMP);
InjectHook(0x4662D0, &CCam::WorkOutCamHeightWeeCar, PATCH_JUMP);
InjectHook(0x466650, &CCam::WorkOutCamHeight, PATCH_JUMP);
InjectHook(0x458600, &CCam::LookBehind, PATCH_JUMP);
InjectHook(0x458C40, &CCam::LookLeft, PATCH_JUMP);
InjectHook(0x458FB0, &CCam::LookRight, PATCH_JUMP);
InjectHook(0x4574C0, &CCam::ClipIfPedInFrontOfPlayer, PATCH_JUMP);
InjectHook(0x459300, &CCam::KeepTrackOfTheSpeed, PATCH_JUMP);
InjectHook(0x458580, &CCam::IsTargetInWater, PATCH_JUMP);
InjectHook(0x4570C0, &CCam::AvoidWallsTopDownPed, PATCH_JUMP);
InjectHook(0x4595B0, &CCam::PrintMode, PATCH_JUMP);
InjectHook(0x467400, &CCam::ProcessSpecialHeightRoutines, PATCH_JUMP);
InjectHook(0x4596A0, &CCam::Process, PATCH_JUMP);
InjectHook(0x45E3A0, &CCam::Process_FollowPed, PATCH_JUMP);
InjectHook(0x45FF70, &CCam::Process_FollowPedWithMouse, PATCH_JUMP);
InjectHook(0x45BE60, &CCam::Process_BehindCar, PATCH_JUMP);
InjectHook(0x45C090, &CCam::Process_Cam_On_A_String, PATCH_JUMP);
InjectHook(0x463EB0, &CCam::Process_TopDown, PATCH_JUMP);
InjectHook(0x464390, &CCam::Process_TopDownPed, PATCH_JUMP);
InjectHook(0x461AF0, &CCam::Process_Rocket, PATCH_JUMP);
InjectHook(0x460E00, &CCam::Process_M16_1stPerson, PATCH_JUMP);
InjectHook(0x459FA0, &CCam::Process_1stPerson, PATCH_JUMP);
InjectHook(0x462420, &CCam::Process_Sniper, PATCH_JUMP);
InjectHook(0x463130, &CCam::Process_Syphon, PATCH_JUMP);
InjectHook(0x463A70, &CCam::Process_Syphon_Crim_In_Front, PATCH_JUMP);
InjectHook(0x45B470, &CCam::Process_BehindBoat, PATCH_JUMP);
InjectHook(0x45D2F0, &CCam::Process_Fight_Cam, PATCH_JUMP);
InjectHook(0x45DC20, &CCam::Process_FlyBy, PATCH_JUMP);
InjectHook(0x464D10, &CCam::Process_WheelCam, PATCH_JUMP);
InjectHook(0x45DA20, &CCam::Process_Fixed, PATCH_JUMP);
InjectHook(0x461940, &CCam::Process_Player_Fallen_Water, PATCH_JUMP);
InjectHook(0x45C400, &CCam::Process_Circle, PATCH_JUMP);
InjectHook(0x462FC0, &CCam::Process_SpecialFixedForSyphon, PATCH_JUMP);
InjectHook(0x45CCC0, &CCam::Process_Debug, PATCH_JUMP);
InjectHook(0x4656C0, &CCam::ProcessPedsDeadBaby, PATCH_JUMP);
InjectHook(0x465000, &CCam::ProcessArrestCamOne, PATCH_JUMP);
InjectHook(0x4653C0, &CCam::ProcessArrestCamTwo, PATCH_JUMP);
InjectHook(0x456CE0, &FindSplinePathPositionFloat, PATCH_JUMP);
InjectHook(0x4569A0, &FindSplinePathPositionVector, PATCH_JUMP);
ENDPATCHES

View File

@ -1,5 +1,5 @@
#include "common.h" #include "common.h"
#include "patcher.h"
#include "main.h" #include "main.h"
#include "Draw.h" #include "Draw.h"
#include "World.h" #include "World.h"
@ -58,9 +58,9 @@ enum
#define PLAYER (CWorld::Players[CWorld::PlayerInFocus].m_pPed) #define PLAYER (CWorld::Players[CWorld::PlayerInFocus].m_pPed)
// NB: removed explicit TheCamera from all functions // NB: removed explicit TheCamera from all functions
CCamera &TheCamera = *(CCamera*)0x6FACF8; CCamera TheCamera;
bool &CCamera::m_bUseMouse3rdPerson = *(bool *)0x5F03D8; bool CCamera::m_bUseMouse3rdPerson = true;
bool &bDidWeProcessAnyCinemaCam = *(bool*)0x95CD46; bool bDidWeProcessAnyCinemaCam;
#ifdef IMPROVED_CAMERA #ifdef IMPROVED_CAMERA
#define KEYJUSTDOWN(k) ControlsManager.GetIsKeyboardKeyJustDown((RsKeyCodes)k) #define KEYJUSTDOWN(k) ControlsManager.GetIsKeyboardKeyJustDown((RsKeyCodes)k)
@ -3386,58 +3386,3 @@ CCamPathSplines::CCamPathSplines(void)
for(i = 0; i < MAXPATHLENGTH; i++) for(i = 0; i < MAXPATHLENGTH; i++)
m_arr_PathData[i] = 0.0f; m_arr_PathData[i] = 0.0f;
} }
STARTPATCHES
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);
InjectHook(0x46FD80, &CCamera::SetMotionBlurAlpha, PATCH_JUMP);
InjectHook(0x46F940, &CCamera::RenderMotionBlur, PATCH_JUMP);
InjectHook(0x46FC90, &CCamera::SetCameraDirectlyInFrontForFollowPed_CamOnAString, PATCH_JUMP);
InjectHook(0x46FF00, &CCamera::SetWideScreenOn, PATCH_JUMP);
InjectHook(0x46FF10, &CCamera::SetWideScreenOff, PATCH_JUMP);
InjectHook(0x46FCC0, &CCamera::SetCamPositionForFixedMode, PATCH_JUMP);
InjectHook(0x46FEC0, &CCamera::SetRwCamera, PATCH_JUMP);
InjectHook(0x46B920, &CCamera::GetCutSceneFinishTime, PATCH_JUMP);
InjectHook(0x46B560, &CCamera::FinishCutscene, PATCH_JUMP);
InjectHook(0x46FF30, &CCamera::SetZoomValueFollowPedScript, PATCH_JUMP);
InjectHook(0x46FF90, &CCamera::SetZoomValueCamStringScript, PATCH_JUMP);
InjectHook(0x46F8E0, &CCamera::ProcessWideScreenOn, PATCH_JUMP);
InjectHook(0x46FDE0, &CCamera::SetParametersForScriptInterpolation, PATCH_JUMP);
InjectHook(0x46BA20, &CCamera::GetLookingLRBFirstPerson, PATCH_JUMP);
InjectHook(0x470D80, &CCamera::StartTransitionWhenNotFinishedInter, PATCH_JUMP);
InjectHook(0x46FFF0, &CCamera::StartTransition, PATCH_JUMP);
InjectHook(0x46BEB0, &CCamera::InitialiseCameraForDebugMode, PATCH_JUMP);
InjectHook(0x471500, &CCamera::TakeControl, PATCH_JUMP);
InjectHook(0x4715B0, &CCamera::TakeControlNoEntity, PATCH_JUMP);
InjectHook(0x46B3A0, &CCamera::Fade, PATCH_JUMP);
InjectHook(0x46FE20, &CCamera::SetPercentAlongCutScene, PATCH_JUMP);
InjectHook(0x46B100, &CamShakeNoPos, PATCH_JUMP);
InjectHook(0x46B200, &CCamera::CamShake, PATCH_JUMP);
InjectHook(0x46F520, &CCamera::ProcessObbeCinemaCameraPed, PATCH_JUMP);
InjectHook(0x46F3E0, &CCamera::ProcessObbeCinemaCameraCar, PATCH_JUMP);
InjectHook(0x470DA0, &CCamera::StoreValuesDuringInterPol, PATCH_JUMP);
InjectHook(0x46B430, &CCamera::DrawBordersForWideScreen, PATCH_JUMP);
InjectHook(0x46F990, &CCamera::Restore, PATCH_JUMP);
InjectHook(0x46FAE0, &CCamera::RestoreWithJumpCut, PATCH_JUMP);
InjectHook(0x46F080, &CCamera::ProcessFade, PATCH_JUMP);
InjectHook(0x46EEA0, &CCamera::CalculateDerivedValues, PATCH_JUMP);
InjectHook(0x46F1E0, &CCamera::ProcessMusicFade, PATCH_JUMP);
InjectHook(0x46D1D0, &CCamera::LoadPathSplines, PATCH_JUMP);
InjectHook(0x4712A0, &CCamera::UpdateTargetEntity, PATCH_JUMP);
InjectHook(0x46B580, &CCamera::Find3rdPersonCamTargetVector, PATCH_JUMP);
InjectHook(0x46BAD0, &CCamera::Init, PATCH_JUMP);
InjectHook(0x46C9E0, &CCamera::LoadTrainCamNodes, PATCH_JUMP);
InjectHook(0x46F600, &CCamera::Process_Train_Camera_Control, PATCH_JUMP);
InjectHook(0x470EA0, &CCamera::UpdateSoundDistances, PATCH_JUMP);
InjectHook(0x46BF10, &CCamera::IsItTimeForNewcam, PATCH_JUMP);
InjectHook(0x471650, &CCamera::TryToStartNewCamMode, PATCH_JUMP);
// InjectHook(0x46D3F0, &CCamera::Process, PATCH_JUMP);
ENDPATCHES

View File

@ -6,7 +6,7 @@ class CPed;
class CAutomobile; class CAutomobile;
class CGarage; class CGarage;
extern int16 &DebugCamMode; extern int16 DebugCamMode;
enum enum
{ {
@ -540,7 +540,7 @@ uint32 unknown; // some counter having to do with music
uint32 m_uiFadeTimeStarted; uint32 m_uiFadeTimeStarted;
uint32 m_uiFadeTimeStartedMusic; uint32 m_uiFadeTimeStartedMusic;
static bool &m_bUseMouse3rdPerson; static bool m_bUseMouse3rdPerson;
#ifdef FREE_CAM #ifdef FREE_CAM
static bool bFreeCam; static bool bFreeCam;
#endif #endif
@ -647,7 +647,7 @@ static_assert(offsetof(CCamera, m_vecCutSceneOffset) == 0x6F8, "CCamera: error")
static_assert(offsetof(CCamera, m_arrPathArray) == 0x7a8, "CCamera: error"); static_assert(offsetof(CCamera, m_arrPathArray) == 0x7a8, "CCamera: error");
static_assert(sizeof(CCamera) == 0xE9D8, "CCamera: wrong size"); static_assert(sizeof(CCamera) == 0xE9D8, "CCamera: wrong size");
extern CCamera &TheCamera; extern CCamera TheCamera;
void CamShakeNoPos(CCamera*, float); void CamShakeNoPos(CCamera*, float);
void MakeAngleLessThan180(float &Angle); void MakeAngleLessThan180(float &Angle);

View File

@ -1,6 +1,6 @@
#include <windows.h> #include <windows.h>
#include "common.h" #include "common.h"
#include "patcher.h"
#include "CdStream.h" #include "CdStream.h"
#include "rwcore.h" #include "rwcore.h"
#include "RwHelper.h" #include "RwHelper.h"
@ -507,24 +507,3 @@ CdStreamGetNumImages(void)
{ {
return gNumImages; return gNumImages;
} }
STARTPATCHES
InjectHook(0x405B50, CdStreamInitThread, PATCH_JUMP);
InjectHook(0x405C80, CdStreamInit, PATCH_JUMP);
//InjectHook(0x405DB0, debug, PATCH_JUMP);
InjectHook(0x405DC0, GetGTA3ImgSize, PATCH_JUMP);
InjectHook(0x405DD0, CdStreamShutdown, PATCH_JUMP);
InjectHook(0x405E40, CdStreamRead, PATCH_JUMP);
InjectHook(0x405F90, CdStreamGetStatus, PATCH_JUMP);
InjectHook(0x406000, CdStreamGetLastPosn, PATCH_JUMP);
InjectHook(0x406010, CdStreamSync, PATCH_JUMP);
InjectHook(0x4060B0, AddToQueue, PATCH_JUMP);
InjectHook(0x4060F0, GetFirstInQueue, PATCH_JUMP);
InjectHook(0x406110, RemoveFirstInQueue, PATCH_JUMP);
InjectHook(0x406140, CdStreamThread, PATCH_JUMP);
InjectHook(0x406270, CdStreamAddImage, PATCH_JUMP);
InjectHook(0x4062E0, CdStreamGetImageName, PATCH_JUMP);
InjectHook(0x406300, CdStreamRemoveImages, PATCH_JUMP);
InjectHook(0x406370, CdStreamGetNumImages, PATCH_JUMP);
ENDPATCHES

View File

@ -1,22 +1,22 @@
#include "common.h" #include "common.h"
#include "patcher.h"
#include "Timer.h" #include "Timer.h"
#include "Pad.h" #include "Pad.h"
#include "Clock.h" #include "Clock.h"
#include "Stats.h" #include "Stats.h"
_TODO("gbFastTime"); _TODO("gbFastTime");
bool &gbFastTime = *(bool*)0x95CDBB; bool gbFastTime;
uint8 &CClock::ms_nGameClockHours = *(uint8*)0x95CDA6; uint8 CClock::ms_nGameClockHours;
uint8 &CClock::ms_nGameClockMinutes = *(uint8*)0x95CDC8; uint8 CClock::ms_nGameClockMinutes;
uint16 &CClock::ms_nGameClockSeconds = *(uint16*)0x95CC7C; uint16 CClock::ms_nGameClockSeconds;
uint8 &CClock::ms_Stored_nGameClockHours = *(uint8*)0x95CD7B; uint8 CClock::ms_Stored_nGameClockHours;
uint8 &CClock::ms_Stored_nGameClockMinutes = *(uint8*)0x95CD9B; uint8 CClock::ms_Stored_nGameClockMinutes;
uint16 &CClock::ms_Stored_nGameClockSeconds = *(uint16*)0x95CC9C; uint16 CClock::ms_Stored_nGameClockSeconds;
uint32 &CClock::ms_nMillisecondsPerGameMinute = *(uint32*)0x8F2C64; uint32 CClock::ms_nMillisecondsPerGameMinute;
uint32 &CClock::ms_nLastClockTick = *(uint32*)0x9430E4; uint32 CClock::ms_nLastClockTick;
bool &CClock::ms_bClockHasBeenStored = *(bool*)0x95CD82; bool CClock::ms_bClockHasBeenStored;
void void
CClock::Initialise(uint32 scale) CClock::Initialise(uint32 scale)
@ -115,14 +115,3 @@ CClock::RestoreClock(void)
ms_nGameClockMinutes = ms_Stored_nGameClockMinutes; ms_nGameClockMinutes = ms_Stored_nGameClockMinutes;
ms_nGameClockSeconds = ms_Stored_nGameClockSeconds; ms_nGameClockSeconds = ms_Stored_nGameClockSeconds;
} }
STARTPATCHES
InjectHook(0x473370, CClock::Initialise, PATCH_JUMP);
InjectHook(0x473460, CClock::Update, PATCH_JUMP);
InjectHook(0x4733C0, CClock::SetGameClock, PATCH_JUMP);
InjectHook(0x4733F0, CClock::GetGameClockMinutesUntil, PATCH_JUMP);
InjectHook(0x473420, CClock::GetIsTimeInRange, PATCH_JUMP);
InjectHook(0x473540, CClock::StoreClock, PATCH_JUMP);
InjectHook(0x473570, CClock::RestoreClock, PATCH_JUMP);
ENDPATCHES

View File

@ -3,15 +3,15 @@
class CClock class CClock
{ {
public: public:
static uint8 &ms_nGameClockHours; static uint8 ms_nGameClockHours;
static uint8 &ms_nGameClockMinutes; static uint8 ms_nGameClockMinutes;
static uint16 &ms_nGameClockSeconds; static uint16 ms_nGameClockSeconds;
static uint8 &ms_Stored_nGameClockHours; static uint8 ms_Stored_nGameClockHours;
static uint8 &ms_Stored_nGameClockMinutes; static uint8 ms_Stored_nGameClockMinutes;
static uint16 &ms_Stored_nGameClockSeconds; static uint16 ms_Stored_nGameClockSeconds;
static uint32 &ms_nMillisecondsPerGameMinute; static uint32 ms_nMillisecondsPerGameMinute;
static uint32 &ms_nLastClockTick; static uint32 ms_nLastClockTick;
static bool &ms_bClockHasBeenStored; static bool ms_bClockHasBeenStored;
static void Initialise(uint32 scale); static void Initialise(uint32 scale);
static void Update(void); static void Update(void);

View File

@ -1,5 +1,5 @@
#include "common.h" #include "common.h"
#include "patcher.h"
#include "main.h" #include "main.h"
#include "Lists.h" #include "Lists.h"
#include "Game.h" #include "Game.h"
@ -2140,70 +2140,3 @@ CColModel::operator=(const CColModel &other)
} }
return *this; return *this;
} }
#include <new>
struct CColLine_ : public CColLine
{
CColLine *ctor(CVector *p0, CVector *p1) { return ::new (this) CColLine(*p0, *p1); }
};
struct CColModel_ : public CColModel
{
CColModel *ctor(void) { return ::new (this) CColModel(); }
void dtor(void) { this->CColModel::~CColModel(); }
};
STARTPATCHES
InjectHook(0x4B9C30, (CMatrix& (*)(const CMatrix &src, CMatrix &dst))Invert, PATCH_JUMP);
InjectHook(0x40B380, CCollision::Init, PATCH_JUMP);
InjectHook(0x40B3A0, CCollision::Shutdown, PATCH_JUMP);
InjectHook(0x40B3B0, CCollision::Update, PATCH_JUMP);
InjectHook(0x40B5B0, CCollision::LoadCollisionWhenINeedIt, PATCH_JUMP);
InjectHook(0x40B900, CCollision::SortOutCollisionAfterLoad, PATCH_JUMP);
InjectHook(0x40BB70, CCollision::TestSphereBox, PATCH_JUMP);
InjectHook(0x40E130, CCollision::TestLineBox, PATCH_JUMP);
InjectHook(0x40E5C0, CCollision::TestVerticalLineBox, PATCH_JUMP);
InjectHook(0x40EC10, CCollision::TestLineTriangle, PATCH_JUMP);
InjectHook(0x40DAA0, CCollision::TestLineSphere, PATCH_JUMP);
InjectHook(0x40C580, CCollision::TestSphereTriangle, PATCH_JUMP);
InjectHook(0x40F720, CCollision::TestLineOfSight, PATCH_JUMP);
InjectHook(0x40B9F0, CCollision::ProcessSphereSphere, PATCH_JUMP);
InjectHook(0x40BC00, CCollision::ProcessSphereBox, PATCH_JUMP);
InjectHook(0x40E670, CCollision::ProcessLineBox, PATCH_JUMP);
InjectHook(0x40DE80, CCollision::ProcessLineSphere, PATCH_JUMP);
InjectHook(0x40FB50, CCollision::ProcessVerticalLineTriangle, PATCH_JUMP);
InjectHook(0x40F140, CCollision::ProcessLineTriangle, PATCH_JUMP);
InjectHook(0x40CE30, CCollision::ProcessSphereTriangle, PATCH_JUMP);
InjectHook(0x40F910, CCollision::ProcessLineOfSight, PATCH_JUMP);
InjectHook(0x410120, CCollision::ProcessVerticalLine, PATCH_JUMP);
InjectHook(0x410BE0, CCollision::ProcessColModels, PATCH_JUMP);
InjectHook(0x40B960, CCollision::CalculateTrianglePlanes, PATCH_JUMP);
InjectHook(0x411640, &CLink<CColModel*>::Remove, PATCH_JUMP);
InjectHook(0x411620, &CLink<CColModel*>::Insert, PATCH_JUMP);
InjectHook(0x4115C0, &CLinkList<CColModel*>::Insert, PATCH_JUMP);
InjectHook(0x411600, &CLinkList<CColModel*>::Remove, PATCH_JUMP);
// InjectHook(0x411530, &CLinkList<CColModel*>::Init, PATCH_JUMP);
InjectHook(0x411E40, (void (CColSphere::*)(float, const CVector&, uint8, uint8))&CColSphere::Set, PATCH_JUMP);
InjectHook(0x40B2A0, &CColBox::Set, PATCH_JUMP);
InjectHook(0x40B320, &CColLine_::ctor, PATCH_JUMP);
InjectHook(0x40B350, &CColLine::Set, PATCH_JUMP);
InjectHook(0x411E70, &CColTriangle::Set, PATCH_JUMP);
InjectHook(0x411EA0, &CColTrianglePlane::Set, PATCH_JUMP);
InjectHook(0x412140, &CColTrianglePlane::GetNormal, PATCH_JUMP);
InjectHook(0x411680, &CColModel_::ctor, PATCH_JUMP);
InjectHook(0x4116E0, &CColModel_::dtor, PATCH_JUMP);
InjectHook(0x411D80, &CColModel::RemoveCollisionVolumes, PATCH_JUMP);
InjectHook(0x411CB0, &CColModel::CalculateTrianglePlanes, PATCH_JUMP);
InjectHook(0x411D10, &CColModel::RemoveTrianglePlanes, PATCH_JUMP);
InjectHook(0x411D40, &CColModel::SetLinkPtr, PATCH_JUMP);
InjectHook(0x411D60, &CColModel::GetLinkPtr, PATCH_JUMP);
ENDPATCHES

View File

@ -1,7 +1,7 @@
#define DIRECTINPUT_VERSION 0x0800 #define DIRECTINPUT_VERSION 0x0800
#include <dinput.h> #include <dinput.h>
#include "common.h" #include "common.h"
#include "patcher.h"
#include "ControllerConfig.h" #include "ControllerConfig.h"
#include "Pad.h" #include "Pad.h"
#include "FileMgr.h" #include "FileMgr.h"
@ -18,7 +18,7 @@
#include "win.h" #include "win.h"
#include "GenericGameStorage.h" #include "GenericGameStorage.h"
CControllerConfigManager &ControlsManager = *(CControllerConfigManager*)0x8F43A4; CControllerConfigManager ControlsManager;
CControllerConfigManager::CControllerConfigManager() CControllerConfigManager::CControllerConfigManager()
{ {
@ -2362,57 +2362,3 @@ void CControllerConfigManager::ResetSettingOrder(e_ControllerAction action)
} }
} }
} }
STARTPATCHES
InjectHook(0x58B7A0, &CControllerConfigManager::MakeControllerActionsBlank, PATCH_JUMP);
InjectHook(0x58B7D0, &CControllerConfigManager::GetJoyButtonJustDown, PATCH_JUMP);
InjectHook(0x58B800, &CControllerConfigManager::SaveSettings, PATCH_JUMP);
InjectHook(0x58B870, &CControllerConfigManager::LoadSettings, PATCH_JUMP);
InjectHook(0x58B930, &CControllerConfigManager::InitDefaultControlConfiguration, PATCH_JUMP);
InjectHook(0x58BD00, &CControllerConfigManager::InitDefaultControlConfigMouse, PATCH_JUMP);
InjectHook(0x58BD90, &CControllerConfigManager::InitDefaultControlConfigJoyPad, PATCH_JUMP);
InjectHook(0x58C060, &CControllerConfigManager::InitialiseControllerActionNameArray, PATCH_JUMP);
InjectHook(0x58C5E0, &CControllerConfigManager::UpdateJoyInConfigMenus_ButtonDown, PATCH_JUMP);
InjectHook(0x58C730, &CControllerConfigManager::AffectControllerStateOn_ButtonDown, PATCH_JUMP);
InjectHook(0x58C880, &CControllerConfigManager::AffectControllerStateOn_ButtonDown_Driving, PATCH_JUMP);
InjectHook(0x58CAD0, &CControllerConfigManager::AffectControllerStateOn_ButtonDown_FirstPersonOnly, PATCH_JUMP);
InjectHook(0x58CB10, &CControllerConfigManager::AffectControllerStateOn_ButtonDown_ThirdPersonOnly, PATCH_JUMP);
InjectHook(0x58CBD0, &CControllerConfigManager::AffectControllerStateOn_ButtonDown_FirstAndThirdPersonOnly, PATCH_JUMP);
InjectHook(0x58CD70, &CControllerConfigManager::AffectControllerStateOn_ButtonDown_AllStates, PATCH_JUMP);
InjectHook(0x58CE50, &CControllerConfigManager::AffectControllerStateOn_ButtonDown_VehicleAndThirdPersonOnly, PATCH_JUMP);
InjectHook(0x58CE80, &CControllerConfigManager::UpdateJoyInConfigMenus_ButtonUp, PATCH_JUMP);
InjectHook(0x58CFD0, &CControllerConfigManager::AffectControllerStateOn_ButtonUp, PATCH_JUMP);
InjectHook(0x58D090, &CControllerConfigManager::AffectControllerStateOn_ButtonUp_All_Player_States, PATCH_JUMP);
InjectHook(0x58D0C0, &CControllerConfigManager::AffectPadFromKeyBoard, PATCH_JUMP);
InjectHook(0x58D1A0, &CControllerConfigManager::AffectPadFromMouse, PATCH_JUMP);
InjectHook(0x58D220, &CControllerConfigManager::ClearSimButtonPressCheckers, PATCH_JUMP);
InjectHook(0x58D2A0, &CControllerConfigManager::GetIsKeyboardKeyDown, PATCH_JUMP);
InjectHook(0x58D8A0, &CControllerConfigManager::GetIsKeyboardKeyJustDown, PATCH_JUMP);
InjectHook(0x58E280, &CControllerConfigManager::GetIsMouseButtonDown, PATCH_JUMP);
InjectHook(0x58E360, &CControllerConfigManager::GetIsMouseButtonUp, PATCH_JUMP);
InjectHook(0x58E440, &CControllerConfigManager::DeleteMatchingCommonControls, PATCH_JUMP);
InjectHook(0x58E540, &CControllerConfigManager::DeleteMatching3rdPersonControls, PATCH_JUMP);
InjectHook(0x58E630, &CControllerConfigManager::DeleteMatching1rst3rdPersonControls, PATCH_JUMP);
InjectHook(0x58E710, &CControllerConfigManager::DeleteMatchingVehicleControls, PATCH_JUMP);
InjectHook(0x58E890, &CControllerConfigManager::DeleteMatchingVehicle_3rdPersonControls, PATCH_JUMP);
InjectHook(0x58E8D0, &CControllerConfigManager::DeleteMatching1rstPersonControls, PATCH_JUMP);
InjectHook(0x58E920, &CControllerConfigManager::DeleteMatchingActionInitiators, PATCH_JUMP);
InjectHook(0x58EA70, &CControllerConfigManager::GetIsKeyBlank, PATCH_JUMP);
InjectHook(0x58EAD0, &CControllerConfigManager::GetActionType, PATCH_JUMP);
InjectHook(0x58EB40, &CControllerConfigManager::ClearSettingsAssociatedWithAction, PATCH_JUMP);
InjectHook(0x58EBF0, &CControllerConfigManager::GetControllerSettingTextWithOrderNumber, PATCH_JUMP);
InjectHook(0x58EC50, &CControllerConfigManager::GetControllerSettingTextKeyBoard, PATCH_JUMP);
InjectHook(0x58F320, &CControllerConfigManager::GetControllerSettingTextMouse, PATCH_JUMP);
InjectHook(0x58F3D0, &CControllerConfigManager::GetControllerSettingTextJoystick, PATCH_JUMP);
InjectHook(0x58F420, &CControllerConfigManager::GetNumOfSettingsForAction, PATCH_JUMP);
InjectHook(0x58F460, &CControllerConfigManager::GetWideStringOfCommandKeys, PATCH_JUMP);
InjectHook(0x58F590, &CControllerConfigManager::GetControllerKeyAssociatedWithAction, PATCH_JUMP);
InjectHook(0x58F5B0, &CControllerConfigManager::UpdateJoyButtonState, PATCH_JUMP);
InjectHook(0x58F660, &CControllerConfigManager::GetIsActionAButtonCombo, PATCH_JUMP);
InjectHook(0x58F690, &CControllerConfigManager::GetButtonComboText, PATCH_JUMP);
InjectHook(0x58F700, &CControllerConfigManager::SetControllerKeyAssociatedWithAction, PATCH_JUMP);
InjectHook(0x58F740, &CControllerConfigManager::GetMouseButtonAssociatedWithAction, PATCH_JUMP);
InjectHook(0x58F760, &CControllerConfigManager::SetMouseButtonAssociatedWithAction, PATCH_JUMP);
InjectHook(0x58F790, &CControllerConfigManager::ResetSettingOrder, PATCH_JUMP);
ENDPATCHES

View File

@ -198,4 +198,4 @@ public:
VALIDATE_SIZE(CControllerConfigManager, 0x143C); VALIDATE_SIZE(CControllerConfigManager, 0x143C);
extern CControllerConfigManager &ControlsManager; extern CControllerConfigManager ControlsManager;

View File

@ -1,5 +1,5 @@
#include "common.h" #include "common.h"
#include "patcher.h"
#include "General.h" #include "General.h"
#include "FileMgr.h" #include "FileMgr.h"
#include "Directory.h" #include "Directory.h"
@ -57,10 +57,3 @@ CDirectory::FindItem(const char *name, uint32 &offset, uint32 &size)
} }
return false; return false;
} }
STARTPATCHES
InjectHook(0x473630, &CDirectory::ReadDirFile, PATCH_JUMP);
InjectHook(0x473690, &CDirectory::WriteDirFile, PATCH_JUMP);
InjectHook(0x473600, &CDirectory::AddItem, PATCH_JUMP);
InjectHook(0x4736E0, &CDirectory::FindItem, PATCH_JUMP);
ENDPATCHES

View File

@ -1,5 +1,5 @@
#include "common.h" #include "common.h"
#include "patcher.h"
#include "Pools.h" #include "Pools.h"
#include "ModelIndices.h" #include "ModelIndices.h"
#include "World.h" #include "World.h"
@ -11,7 +11,6 @@
int32 CEventList::ms_nFirstFreeSlotIndex; int32 CEventList::ms_nFirstFreeSlotIndex;
CEvent gaEvent[NUMEVENTS]; CEvent gaEvent[NUMEVENTS];
//CEvent *gaEvent = (CEvent*)0x6EF830;
enum enum
{ {
@ -228,14 +227,3 @@ CEventList::ReportCrimeForEvent(eEventType type, int32 crimeId, bool copsDontCar
FindPlayerPed()->SetWantedLevelNoDrop(2); FindPlayerPed()->SetWantedLevelNoDrop(2);
} }
STARTPATCHES
InjectHook(0x475B60, CEventList::Initialise, PATCH_JUMP);
InjectHook(0x475BE0, CEventList::Update, PATCH_JUMP);
InjectHook(0x475C50, (void (*)(eEventType,eEventEntity,CEntity *,CPed *,int32))CEventList::RegisterEvent, PATCH_JUMP);
InjectHook(0x475E10, (void (*)(eEventType,CVector,int32))CEventList::RegisterEvent, PATCH_JUMP);
InjectHook(0x475F40, CEventList::GetEvent, PATCH_JUMP);
InjectHook(0x475F70, CEventList::ClearEvent, PATCH_JUMP);
InjectHook(0x475F90, CEventList::FindClosestEvent, PATCH_JUMP);
InjectHook(0x476070, CEventList::ReportCrimeForEvent, PATCH_JUMP);
ENDPATCHES

View File

@ -1,6 +1,6 @@
#include "common.h" #include "common.h"
#include "main.h" #include "main.h"
#include "patcher.h"
#include "Quaternion.h" #include "Quaternion.h"
#include "ModelInfo.h" #include "ModelInfo.h"
#include "ModelIndices.h" #include "ModelIndices.h"
@ -1355,43 +1355,3 @@ CFileLoader::ReLoadScene(const char *filename)
} }
CFileMgr::CloseFile(fd); CFileMgr::CloseFile(fd);
} }
STARTPATCHES
InjectHook(0x476290, CFileLoader::LoadLevel, PATCH_JUMP);
InjectHook(0x476520, CFileLoader::LoadCollisionFromDatFile, PATCH_JUMP);
InjectHook(0x4761D0, CFileLoader::LoadLine, PATCH_JUMP);
InjectHook(0x4765B0, CFileLoader::LoadTexDictionary, PATCH_JUMP);
InjectHook(0x478B20, CFileLoader::LoadCollisionFile, PATCH_JUMP);
InjectHook(0x478C20, CFileLoader::LoadCollisionModel, PATCH_JUMP);
InjectHook(0x476750, CFileLoader::LoadModelFile, PATCH_JUMP);
InjectHook(0x476810, (void (*)(const char*))CFileLoader::LoadClumpFile, PATCH_JUMP);
InjectHook(0x476990, (bool (*)(RwStream*,uint32))CFileLoader::LoadClumpFile, PATCH_JUMP);
InjectHook(0x476A20, CFileLoader::StartLoadClumpFile, PATCH_JUMP);
InjectHook(0x476A70, CFileLoader::FinishLoadClumpFile, PATCH_JUMP);
InjectHook(0x476930, CFileLoader::LoadAtomicFile, PATCH_JUMP);
InjectHook(0x4767C0, CFileLoader::LoadAtomicFile2Return, PATCH_JUMP);
InjectHook(0x476630, CFileLoader::AddTexDictionaries, PATCH_JUMP);
InjectHook(0x476AC0, CFileLoader::LoadObjectTypes, PATCH_JUMP);
InjectHook(0x477040, CFileLoader::LoadObject, PATCH_JUMP);
InjectHook(0x4774B0, CFileLoader::LoadTimeObject, PATCH_JUMP);
InjectHook(0x477920, CFileLoader::LoadClumpObject, PATCH_JUMP);
InjectHook(0x477990, CFileLoader::LoadVehicleObject, PATCH_JUMP);
InjectHook(0x477DE0, CFileLoader::LoadPedObject, PATCH_JUMP);
InjectHook(0x477ED0, CFileLoader::LoadPathHeader, PATCH_JUMP);
InjectHook(0x477FF0, CFileLoader::LoadCarPathNode, PATCH_JUMP);
InjectHook(0x477F00, CFileLoader::LoadPedPathNode, PATCH_JUMP);
InjectHook(0x4780E0, CFileLoader::Load2dEffect, PATCH_JUMP);
InjectHook(0x478370, CFileLoader::LoadScene, PATCH_JUMP);
InjectHook(0x4786B0, CFileLoader::LoadObjectInstance, PATCH_JUMP);
InjectHook(0x478A00, CFileLoader::LoadZone, PATCH_JUMP);
InjectHook(0x478A90, CFileLoader::LoadCullZone, PATCH_JUMP);
InjectHook(0x478550, CFileLoader::LoadMapZones, PATCH_JUMP);
InjectHook(0x476DB0, CFileLoader::ReloadPaths, PATCH_JUMP);
InjectHook(0x476F30, CFileLoader::ReloadObjectTypes, PATCH_JUMP);
InjectHook(0x4772B0, CFileLoader::ReloadObject, PATCH_JUMP);
ENDPATCHES

View File

@ -2,7 +2,7 @@
#include <fcntl.h> #include <fcntl.h>
#include <direct.h> #include <direct.h>
#include "common.h" #include "common.h"
#include "patcher.h"
#include "FileMgr.h" #include "FileMgr.h"
const char *_psGetUserFilesFolder(); const char *_psGetUserFilesFolder();
@ -168,8 +168,8 @@ myfeof(int fd)
} }
char *CFileMgr::ms_rootDirName = (char*)0x5F18F8; char CFileMgr::ms_rootDirName[128] = {'\0'};
char *CFileMgr::ms_dirName = (char*)0x713CA8; char CFileMgr::ms_dirName[128];
void void
CFileMgr::Initialise(void) CFileMgr::Initialise(void)
@ -282,19 +282,3 @@ CFileMgr::GetErrorReadWrite(int fd)
{ {
return myfeof(fd); return myfeof(fd);
} }
STARTPATCHES
InjectHook(0x478F80, CFileMgr::Initialise, PATCH_JUMP);
InjectHook(0x478FB0, CFileMgr::ChangeDir, PATCH_JUMP);
InjectHook(0x479020, CFileMgr::SetDir, PATCH_JUMP);
InjectHook(0x479080, CFileMgr::SetDirMyDocuments, PATCH_JUMP);
InjectHook(0x479090, CFileMgr::LoadFile, PATCH_JUMP);
InjectHook(0x479100, CFileMgr::OpenFile, PATCH_JUMP);
InjectHook(0x479120, CFileMgr::OpenFileForWriting, PATCH_JUMP);
InjectHook(0x479140, CFileMgr::Read, PATCH_JUMP);
InjectHook(0x479160, CFileMgr::Write, PATCH_JUMP);
InjectHook(0x479180, CFileMgr::Seek, PATCH_JUMP);
InjectHook(0x4791D0, CFileMgr::ReadLine, PATCH_JUMP);
InjectHook(0x479200, CFileMgr::CloseFile, PATCH_JUMP);
InjectHook(0x479210, CFileMgr::GetErrorReadWrite, PATCH_JUMP);
ENDPATCHES

View File

@ -2,8 +2,8 @@
class CFileMgr class CFileMgr
{ {
static char *ms_rootDirName; //[128]; static char ms_rootDirName[128];
static char *ms_dirName; //[128]; static char ms_dirName[128];
public: public:
static void Initialise(void); static void Initialise(void);
static void ChangeDir(const char *dir); static void ChangeDir(const char *dir);

View File

@ -1,5 +1,5 @@
#include "common.h" #include "common.h"
#include "patcher.h"
#include "Vector.h" #include "Vector.h"
#include "PlayerPed.h" #include "PlayerPed.h"
#include "Entity.h" #include "Entity.h"
@ -16,7 +16,7 @@
#include "Ped.h" #include "Ped.h"
#include "Fire.h" #include "Fire.h"
CFireManager &gFireManager = *(CFireManager*)0x8F31D0; CFireManager gFireManager;
CFire::CFire() CFire::CFire()
{ {
@ -438,21 +438,3 @@ CFireManager::SetScriptFireAudio(int16 index, bool state)
{ {
m_aFires[index].m_bAudioSet = state; m_aFires[index].m_bAudioSet = state;
} }
STARTPATCHES
InjectHook(0x4798D0, &CFire::ProcessFire, PATCH_JUMP);
InjectHook(0x4798B0, &CFire::ReportThisFire, PATCH_JUMP);
InjectHook(0x479D40, &CFire::Extinguish, PATCH_JUMP);
InjectHook(0x479500, (void(CFireManager::*)(CVector pos, float size, bool propagation))&CFireManager::StartFire, PATCH_JUMP);
InjectHook(0x479590, (CFire *(CFireManager::*)(CEntity *, CEntity *, float, bool))&CFireManager::StartFire, PATCH_JUMP);
InjectHook(0x479310, &CFireManager::Update, PATCH_JUMP);
InjectHook(0x479430, &CFireManager::FindFurthestFire_NeverMindFireMen, PATCH_JUMP);
InjectHook(0x479340, &CFireManager::FindNearestFire, PATCH_JUMP);
InjectHook(0x4792E0, &CFireManager::GetNextFreeFire, PATCH_JUMP);
InjectHook(0x479DB0, &CFireManager::ExtinguishPoint, PATCH_JUMP);
InjectHook(0x479E60, &CFireManager::StartScriptFire, PATCH_JUMP);
InjectHook(0x479FC0, &CFireManager::IsScriptFireExtinguish, PATCH_JUMP);
InjectHook(0x47A000, &CFireManager::RemoveAllScriptFires, PATCH_JUMP);
InjectHook(0x479FE0, &CFireManager::RemoveScriptFire, PATCH_JUMP);
InjectHook(0x47A040, &CFireManager::SetScriptFireAudio, PATCH_JUMP);
ENDPATCHES

View File

@ -48,4 +48,4 @@ public:
void RemoveScriptFire(int16 index); void RemoveScriptFire(int16 index);
void SetScriptFireAudio(int16 index, bool state); void SetScriptFireAudio(int16 index, bool state);
}; };
extern CFireManager &gFireManager; extern CFireManager gFireManager;

View File

@ -1,7 +1,7 @@
#define DIRECTINPUT_VERSION 0x0800 #define DIRECTINPUT_VERSION 0x0800
#include <dinput.h> #include <dinput.h>
#include "common.h" #include "common.h"
#include "patcher.h"
#include "win.h" #include "win.h"
#include "Frontend.h" #include "Frontend.h"
#include "Font.h" #include "Font.h"
@ -93,7 +93,7 @@ int8 CMenuManager::m_PrefsSpeakers;
int32 CMenuManager::m_ControlMethod; int32 CMenuManager::m_ControlMethod;
int8 CMenuManager::m_PrefsDMA = 1; int8 CMenuManager::m_PrefsDMA = 1;
int32 CMenuManager::m_PrefsLanguage; int32 CMenuManager::m_PrefsLanguage;
uint8 CMenuManager::m_PrefsStereoMono; // *(bool*)0x95CDB5; // unused except restore settings uint8 CMenuManager::m_PrefsStereoMono; // unused except restore settings
bool CMenuManager::m_PrefsAllowNastyGame = true; bool CMenuManager::m_PrefsAllowNastyGame = true;
bool CMenuManager::m_bStartUpFrontEndRequested; bool CMenuManager::m_bStartUpFrontEndRequested;
@ -5624,21 +5624,3 @@ uint8 CMenuManager::GetNumberOfMenuOptions()
#undef GetBackJustUp #undef GetBackJustUp
#undef GetBackJustDown #undef GetBackJustDown
STARTPATCHES
for (int i = 1; i < ARRAY_SIZE(aScreens); i++)
Patch(0x611930 + sizeof(CMenuScreen) * i, aScreens[i]);
InjectHook(0x4856F0, &CMenuManager::ProcessButtonPresses, PATCH_JUMP);
InjectHook(0x485100, &CMenuManager::Process, PATCH_JUMP);
InjectHook(0x47A230, &CMenuManager::LoadAllTextures, PATCH_JUMP);
InjectHook(0x47A540, &CMenuManager::DrawFrontEnd, PATCH_JUMP);
InjectHook(0x48ABE0, &CMenuManager::StretchX, PATCH_JUMP);
InjectHook(0x48AC20, &CMenuManager::StretchY, PATCH_JUMP);
InjectHook(0x488EE0, &CMenuManager::LoadSettings, PATCH_JUMP);
InjectHook(0x488CC0, &CMenuManager::SaveSettings, PATCH_JUMP);
InjectHook(0x47A440, &CMenuManager::UnloadTextures, PATCH_JUMP);
InjectHook(0x48AB40, &CMenuManager::DoSettingsBeforeStartingAGame, PATCH_JUMP);
InjectHook(0x48AE60, &CMenuManager::ProcessOnOffMenuOptions, PATCH_JUMP);
InjectHook(0x489710, &CMenuManager::DrawControllerBound, PATCH_JUMP);
ENDPATCHES

View File

@ -5,7 +5,7 @@
#pragma warning( pop ) #pragma warning( pop )
#include "common.h" #include "common.h"
#include "win.h" #include "win.h"
#include "patcher.h"
#include "Game.h" #include "Game.h"
#include "main.h" #include "main.h"
#include "RwHelper.h" #include "RwHelper.h"
@ -89,19 +89,19 @@
eLevelName &CGame::currLevel = *(eLevelName*)0x941514; eLevelName CGame::currLevel;
bool &CGame::bDemoMode = *(bool*)0x5F4DD0; bool CGame::bDemoMode = true;
bool &CGame::nastyGame = *(bool*)0x5F4DD4; bool CGame::nastyGame = true;
bool &CGame::frenchGame = *(bool*)0x95CDCB; bool CGame::frenchGame;
bool &CGame::germanGame = *(bool*)0x95CD1E; bool CGame::germanGame;
bool &CGame::noProstitutes = *(bool*)0x95CDCF; bool CGame::noProstitutes;
bool &CGame::playingIntro = *(bool*)0x95CDC2; bool CGame::playingIntro;
char *CGame::aDatFile = (char*)0x773A48; char CGame::aDatFile[32];
#ifdef MORE_LANGUAGES #ifdef MORE_LANGUAGES
bool CGame::russianGame = false; bool CGame::russianGame = false;
#endif #endif
int &gameTxdSlot = *(int*)0x628D88; int gameTxdSlot;
bool bool
CGame::InitialiseOnceBeforeRW(void) CGame::InitialiseOnceBeforeRW(void)
@ -115,7 +115,9 @@ CGame::InitialiseOnceBeforeRW(void)
bool bool
CGame::InitialiseRenderWare(void) CGame::InitialiseRenderWare(void)
{ {
#ifdef USE_TEXTURE_POOL
_TexturePoolsInitialise(); _TexturePoolsInitialise();
#endif
CTxdStore::Initialise(); CTxdStore::Initialise();
CVisibilityPlugins::Initialise(); CVisibilityPlugins::Initialise();
@ -188,7 +190,9 @@ void CGame::ShutdownRenderWare(void)
CVisibilityPlugins::Shutdown(); CVisibilityPlugins::Shutdown();
#ifdef USE_TEXTURE_POOL
_TexturePoolsShutdown(); _TexturePoolsShutdown();
#endif
} }
bool CGame::InitialiseOnceAfterRW(void) bool CGame::InitialiseOnceAfterRW(void)
@ -706,20 +710,3 @@ void CGame::ProcessTidyUpMemory(void)
// meow // meow
#endif #endif
} }
STARTPATCHES
InjectHook(0x48BB80, CGame::InitialiseOnceBeforeRW, PATCH_JUMP);
InjectHook(0x48BBA0, CGame::InitialiseRenderWare, PATCH_JUMP);
InjectHook(0x48BCB0, CGame::ShutdownRenderWare, PATCH_JUMP);
InjectHook(0x48BD50, CGame::InitialiseOnceAfterRW, PATCH_JUMP);
InjectHook(0x48BEC0, CGame::FinalShutdown, PATCH_JUMP);
InjectHook(0x48BED0, CGame::Initialise, PATCH_JUMP);
InjectHook(0x48C3A0, CGame::ShutDown, PATCH_JUMP);
InjectHook(0x48C4B0, CGame::ReInitGameObjectVariables, PATCH_JUMP);
InjectHook(0x48C620, CGame::ReloadIPLs, PATCH_JUMP);
InjectHook(0x48C6B0, CGame::ShutDownForRestart, PATCH_JUMP);
InjectHook(0x48C740, CGame::InitialiseWhenRestarting, PATCH_JUMP);
InjectHook(0x48C850, CGame::Process, PATCH_JUMP);
InjectHook(0x48CA10, CGame::DrasticTidyUpMemory, PATCH_JUMP);
InjectHook(0x48CA20, CGame::TidyUpMemory, PATCH_JUMP);
ENDPATCHES

View File

@ -11,17 +11,17 @@ enum eLevelName
class CGame class CGame
{ {
public: public:
static eLevelName &currLevel; static eLevelName currLevel;
static bool &bDemoMode; static bool bDemoMode;
static bool &nastyGame; static bool nastyGame;
static bool &frenchGame; static bool frenchGame;
static bool &germanGame; static bool germanGame;
#ifdef MORE_LANGUAGES #ifdef MORE_LANGUAGES
static bool russianGame; static bool russianGame;
#endif #endif
static bool &noProstitutes; static bool noProstitutes;
static bool &playingIntro; static bool playingIntro;
static char *aDatFile; //[32]; static char aDatFile[32];
static bool InitialiseOnceBeforeRW(void); static bool InitialiseOnceBeforeRW(void);
static bool InitialiseRenderWare(void); static bool InitialiseRenderWare(void);

View File

@ -1,5 +1,5 @@
#include "common.h" #include "common.h"
#include "patcher.h"
#include "IniFile.h" #include "IniFile.h"
#include "CarCtrl.h" #include "CarCtrl.h"
@ -7,8 +7,8 @@
#include "main.h" #include "main.h"
#include "Population.h" #include "Population.h"
float CIniFile::PedNumberMultiplier = 1.0f;// = *(float*)0x6182F4; float CIniFile::PedNumberMultiplier = 1.0f;
float CIniFile::CarNumberMultiplier = 1.0f;// = *(float*)0x6182F8; float CIniFile::CarNumberMultiplier = 1.0f;
void CIniFile::LoadIniFile() void CIniFile::LoadIniFile()
{ {

View File

@ -9,7 +9,7 @@
#include <Xinput.h> #include <Xinput.h>
#pragma comment( lib, "Xinput9_1_0.lib" ) #pragma comment( lib, "Xinput9_1_0.lib" )
#endif #endif
#include "patcher.h"
#include "Pad.h" #include "Pad.h"
#include "ControllerConfig.h" #include "ControllerConfig.h"
#include "Timer.h" #include "Timer.h"
@ -35,26 +35,26 @@
#include "Wanted.h" #include "Wanted.h"
#include "General.h" #include "General.h"
CPad *Pads = (CPad*)0x6F0360; // [2] CPad Pads[MAX_PADS];
CMousePointerStateHelper &MousePointerStateHelper = *(CMousePointerStateHelper*)0x95CC8C; CMousePointerStateHelper MousePointerStateHelper;
bool &CPad::bDisplayNoControllerMessage = *(bool *)0x95CD52; bool CPad::bDisplayNoControllerMessage;
bool &CPad::bObsoleteControllerMessage = *(bool *)0x95CDB8; bool CPad::bObsoleteControllerMessage;
bool CPad::bOldDisplayNoControllerMessage; bool CPad::bOldDisplayNoControllerMessage;
bool &CPad::m_bMapPadOneToPadTwo = *(bool *)0x95CD48; bool CPad::m_bMapPadOneToPadTwo;
CKeyboardState &CPad::OldKeyState = *(CKeyboardState*)0x6F1E70; CKeyboardState CPad::OldKeyState;
CKeyboardState &CPad::NewKeyState = *(CKeyboardState*)0x6E60D0; CKeyboardState CPad::NewKeyState;
CKeyboardState &CPad::TempKeyState = *(CKeyboardState*)0x774DE8; CKeyboardState CPad::TempKeyState;
char CPad::KeyBoardCheatString[20]; char CPad::KeyBoardCheatString[20];
CMouseControllerState &CPad::OldMouseControllerState = *(CMouseControllerState*)0x8472A0; CMouseControllerState CPad::OldMouseControllerState;
CMouseControllerState &CPad::NewMouseControllerState = *(CMouseControllerState*)0x8809F0; CMouseControllerState CPad::NewMouseControllerState;
CMouseControllerState &CPad::PCTempMouseControllerState = *(CMouseControllerState*)0x6F1E60; CMouseControllerState CPad::PCTempMouseControllerState;
_TODO("gbFastTime"); _TODO("gbFastTime");
extern bool &gbFastTime; extern bool gbFastTime;
void WeaponCheat() void WeaponCheat()
{ {
@ -2404,111 +2404,3 @@ int32 *CPad::EditCodesForControls(int32 *pRsKeys, int32 nSize)
return pRsKeys; return pRsKeys;
} }
STARTPATCHES
InjectHook(0x490D90, &WeaponCheat, PATCH_JUMP);
InjectHook(0x490E70, &HealthCheat, PATCH_JUMP);
InjectHook(0x490EE0, &TankCheat, PATCH_JUMP);
InjectHook(0x491040, &BlowUpCarsCheat, PATCH_JUMP);
InjectHook(0x4910B0, &ChangePlayerCheat, PATCH_JUMP);
InjectHook(0x4911C0, &MayhemCheat, PATCH_JUMP);
InjectHook(0x491270, &EverybodyAttacksPlayerCheat, PATCH_JUMP);
InjectHook(0x491370, &WeaponsForAllCheat, PATCH_JUMP);
InjectHook(0x4913A0, &FastTimeCheat, PATCH_JUMP);
InjectHook(0x4913F0, &SlowTimeCheat, PATCH_JUMP);
InjectHook(0x491430, &MoneyCheat, PATCH_JUMP);
InjectHook(0x491460, &ArmourCheat, PATCH_JUMP);
InjectHook(0x491490, &WantedLevelUpCheat, PATCH_JUMP);
InjectHook(0x4914F0, &WantedLevelDownCheat, PATCH_JUMP);
InjectHook(0x491520, &SunnyWeatherCheat, PATCH_JUMP);
InjectHook(0x491550, &CloudyWeatherCheat, PATCH_JUMP);
InjectHook(0x491580, &RainyWeatherCheat, PATCH_JUMP);
InjectHook(0x4915B0, &FoggyWeatherCheat, PATCH_JUMP);
InjectHook(0x4915E0, &FastWeatherCheat, PATCH_JUMP);
InjectHook(0x491610, &OnlyRenderWheelsCheat, PATCH_JUMP);
InjectHook(0x491640, &ChittyChittyBangBangCheat, PATCH_JUMP);
InjectHook(0x491670, &StrongGripCheat, PATCH_JUMP);
InjectHook(0x4916A0, &NastyLimbsCheat, PATCH_JUMP);
InjectHook(0x4916C0, &CControllerState::Clear, PATCH_JUMP);
InjectHook(0x491760, &CKeyboardState::Clear, PATCH_JUMP);
InjectHook(0x491A10, &CPad::Clear, PATCH_JUMP);
InjectHook(0x491B50, &CPad::ClearMouseHistory, PATCH_JUMP);
//InjectHook(0x491B80, &CMouseControllerState::CMouseControllerState, PATCH_JUMP);
InjectHook(0x491BB0, &CMouseControllerState::Clear, PATCH_JUMP);
InjectHook(0x491BD0, &CMousePointerStateHelper::GetMouseSetUp, PATCH_JUMP);
InjectHook(0x491CA0, &CPad::UpdateMouse, PATCH_JUMP);
InjectHook(0x491E60, &CPad::ReconcileTwoControllersInput, PATCH_JUMP);
InjectHook(0x492230, &CPad::StartShake, PATCH_JUMP);
InjectHook(0x492290, &CPad::StartShake_Distance, PATCH_JUMP);
InjectHook(0x492360, &CPad::StartShake_Train, PATCH_JUMP);
InjectHook(0x492450, &CPad::AddToPCCheatString, PATCH_JUMP);
InjectHook(0x492720, CPad::UpdatePads, PATCH_JUMP);
InjectHook(0x492C60, &CPad::ProcessPCSpecificStuff, PATCH_JUMP);
InjectHook(0x492C70, &CPad::Update, PATCH_JUMP);
#pragma warning( push )
#pragma warning( disable : 4573)
InjectHook(0x492F00, (void (*)())CPad::DoCheats, PATCH_JUMP);
#pragma warning( pop )
InjectHook(0x492F20, (void (CPad::*)(int16))&CPad::DoCheats, PATCH_JUMP);
InjectHook(0x492F30, CPad::StopPadsShaking, PATCH_JUMP);
InjectHook(0x492F50, &CPad::StopShaking, PATCH_JUMP);
InjectHook(0x492F60, CPad::GetPad, PATCH_JUMP);
InjectHook(0x492F70, &CPad::GetSteeringLeftRight, PATCH_JUMP);
InjectHook(0x492FF0, &CPad::GetSteeringUpDown, PATCH_JUMP);
InjectHook(0x493070, &CPad::GetCarGunUpDown, PATCH_JUMP);
InjectHook(0x4930C0, &CPad::GetCarGunLeftRight, PATCH_JUMP);
InjectHook(0x493110, &CPad::GetPedWalkLeftRight, PATCH_JUMP);
InjectHook(0x493190, &CPad::GetPedWalkUpDown, PATCH_JUMP);
InjectHook(0x493210, &CPad::GetAnalogueUpDown, PATCH_JUMP);
InjectHook(0x493290, &CPad::GetLookLeft, PATCH_JUMP);
InjectHook(0x4932C0, &CPad::GetLookRight, PATCH_JUMP);
InjectHook(0x4932F0, &CPad::GetLookBehindForCar, PATCH_JUMP);
InjectHook(0x493320, &CPad::GetLookBehindForPed, PATCH_JUMP);
InjectHook(0x493350, &CPad::GetHorn, PATCH_JUMP);
InjectHook(0x4933F0, &CPad::HornJustDown, PATCH_JUMP);
InjectHook(0x493490, &CPad::GetCarGunFired, PATCH_JUMP);
InjectHook(0x4934F0, &CPad::CarGunJustDown, PATCH_JUMP);
InjectHook(0x493560, &CPad::GetHandBrake, PATCH_JUMP);
InjectHook(0x4935A0, &CPad::GetBrake, PATCH_JUMP);
InjectHook(0x4935F0, &CPad::GetExitVehicle, PATCH_JUMP);
InjectHook(0x493650, &CPad::ExitVehicleJustDown, PATCH_JUMP);
InjectHook(0x4936C0, &CPad::GetWeapon, PATCH_JUMP);
InjectHook(0x493700, &CPad::WeaponJustDown, PATCH_JUMP);
InjectHook(0x493780, &CPad::GetAccelerate, PATCH_JUMP);
InjectHook(0x4937D0, &CPad::CycleCameraModeUpJustDown, PATCH_JUMP);
InjectHook(0x493830, &CPad::CycleCameraModeDownJustDown, PATCH_JUMP);
InjectHook(0x493870, &CPad::ChangeStationJustDown, PATCH_JUMP);
InjectHook(0x493910, &CPad::CycleWeaponLeftJustDown, PATCH_JUMP);
InjectHook(0x493940, &CPad::CycleWeaponRightJustDown, PATCH_JUMP);
InjectHook(0x493970, &CPad::GetTarget, PATCH_JUMP);
InjectHook(0x4939D0, &CPad::TargetJustDown, PATCH_JUMP);
InjectHook(0x493A40, &CPad::JumpJustDown, PATCH_JUMP);
InjectHook(0x493A70, &CPad::GetSprint, PATCH_JUMP);
InjectHook(0x493AE0, &CPad::ShiftTargetLeftJustDown, PATCH_JUMP);
InjectHook(0x493B10, &CPad::ShiftTargetRightJustDown, PATCH_JUMP);
InjectHook(0x493B40, &CPad::GetAnaloguePadUp, PATCH_JUMP);
InjectHook(0x493BA0, &CPad::GetAnaloguePadDown, PATCH_JUMP);
InjectHook(0x493C00, &CPad::GetAnaloguePadLeft, PATCH_JUMP);
InjectHook(0x493C60, &CPad::GetAnaloguePadRight, PATCH_JUMP);
InjectHook(0x493CC0, &CPad::GetAnaloguePadLeftJustUp, PATCH_JUMP);
InjectHook(0x493D20, &CPad::GetAnaloguePadRightJustUp, PATCH_JUMP);
InjectHook(0x493D80, &CPad::ForceCameraBehindPlayer, PATCH_JUMP);
InjectHook(0x493E00, &CPad::SniperZoomIn, PATCH_JUMP);
InjectHook(0x493E70, &CPad::SniperZoomOut, PATCH_JUMP);
InjectHook(0x493EE0, &CPad::SniperModeLookLeftRight, PATCH_JUMP);
InjectHook(0x493F30, &CPad::SniperModeLookUpDown, PATCH_JUMP);
InjectHook(0x493F80, &CPad::LookAroundLeftRight, PATCH_JUMP);
InjectHook(0x494130, &CPad::LookAroundUpDown, PATCH_JUMP);
InjectHook(0x494290, &CPad::ResetAverageWeapon, PATCH_JUMP);
InjectHook(0x4942B0, CPad::PrintErrorMessage, PATCH_JUMP);
InjectHook(0x494420, LittleTest, PATCH_JUMP);
InjectHook(0x494450, CPad::ResetCheats, PATCH_JUMP);
InjectHook(0x4944B0, CPad::EditString, PATCH_JUMP);
InjectHook(0x494690, CPad::EditCodesForControls, PATCH_JUMP);
//InjectHook(0x494E50, `global constructor keyed to'Pad.cpp, PATCH_JUMP);
//InjectHook(0x494EB0, sub_494EB0, PATCH_JUMP);
//InjectHook(0x494ED0, &CPad::~CPad, PATCH_JUMP);
//InjectHook(0x494EE0, &CPad::CPad, PATCH_JUMP);
ENDPATCHES

View File

@ -66,7 +66,7 @@ public:
VALIDATE_SIZE(CMousePointerStateHelper, 0x2); VALIDATE_SIZE(CMousePointerStateHelper, 0x2);
extern CMousePointerStateHelper &MousePointerStateHelper; extern CMousePointerStateHelper MousePointerStateHelper;
class CKeyboardState class CKeyboardState
@ -163,18 +163,18 @@ public:
CPad() { } CPad() { }
~CPad() { } ~CPad() { }
static bool &bDisplayNoControllerMessage; static bool bDisplayNoControllerMessage;
static bool &bObsoleteControllerMessage; static bool bObsoleteControllerMessage;
static bool bOldDisplayNoControllerMessage; static bool bOldDisplayNoControllerMessage;
static bool &m_bMapPadOneToPadTwo; static bool m_bMapPadOneToPadTwo;
static CKeyboardState &OldKeyState; static CKeyboardState OldKeyState;
static CKeyboardState &NewKeyState; static CKeyboardState NewKeyState;
static CKeyboardState &TempKeyState; static CKeyboardState TempKeyState;
static char KeyBoardCheatString[20]; static char KeyBoardCheatString[20];
static CMouseControllerState &OldMouseControllerState; static CMouseControllerState OldMouseControllerState;
static CMouseControllerState &NewMouseControllerState; static CMouseControllerState NewMouseControllerState;
static CMouseControllerState &PCTempMouseControllerState; static CMouseControllerState PCTempMouseControllerState;
#ifdef GTA_PS2_STUFF #ifdef GTA_PS2_STUFF
@ -450,4 +450,4 @@ public:
}; };
VALIDATE_SIZE(CPad, 0xFC); VALIDATE_SIZE(CPad, 0xFC);
extern CPad *Pads; //[2] extern CPad Pads[MAX_PADS];

View File

@ -1,6 +1,6 @@
#include "common.h" #include "common.h"
#include "Placeable.h" #include "Placeable.h"
#include "patcher.h"
CPlaceable::CPlaceable(void) CPlaceable::CPlaceable(void)
{ {
@ -62,21 +62,3 @@ CPlaceable::IsWithinArea(float x1, float y1, float z1, float x2, float y2, float
y1 <= GetPosition().y && GetPosition().y <= y2 && y1 <= GetPosition().y && GetPosition().y <= y2 &&
z1 <= GetPosition().z && GetPosition().z <= z2; z1 <= GetPosition().z && GetPosition().z <= z2;
} }
#include <new>
class CPlaceable_ : public CPlaceable
{
public:
CPlaceable *ctor(void) { return ::new (this) CPlaceable(); }
void dtor(void) { CPlaceable::~CPlaceable(); }
};
STARTPATCHES
InjectHook(0x49F9A0, &CPlaceable_::ctor, PATCH_JUMP);
InjectHook(0x49F9E0, &CPlaceable_::dtor, PATCH_JUMP);
InjectHook(0x49FA00, &CPlaceable::SetHeading, PATCH_JUMP);
InjectHook(0x49FA50, (bool (CPlaceable::*)(float, float, float, float))&CPlaceable::IsWithinArea, PATCH_JUMP);
InjectHook(0x49FAF0, (bool (CPlaceable::*)(float, float, float, float, float, float))&CPlaceable::IsWithinArea, PATCH_JUMP);
ENDPATCHES

View File

@ -1,5 +1,5 @@
#include "common.h" #include "common.h"
#include "patcher.h"
#include "main.h" #include "main.h"
#include "PlayerPed.h" #include "PlayerPed.h"
#include "Wanted.h" #include "Wanted.h"
@ -558,20 +558,3 @@ CPlayerInfo::Process(void)
CStats::DistanceTravelledOnFoot += FindPlayerPed()->m_fDistanceTravelled; CStats::DistanceTravelledOnFoot += FindPlayerPed()->m_fDistanceTravelled;
} }
} }
STARTPATCHES
InjectHook(0x4B5DC0, &CPlayerInfo::dtor, PATCH_JUMP);
InjectHook(0x4A1700, &CPlayerInfo::LoadPlayerSkin, PATCH_JUMP);
InjectHook(0x4A1750, &CPlayerInfo::DeletePlayerSkin, PATCH_JUMP);
InjectHook(0x4A12E0, &CPlayerInfo::KillPlayer, PATCH_JUMP);
InjectHook(0x4A1330, &CPlayerInfo::ArrestPlayer, PATCH_JUMP);
InjectHook(0x49FC10, &CPlayerInfo::Clear, PATCH_JUMP);
InjectHook(0x4A15C0, &CPlayerInfo::BlowUpRCBuggy, PATCH_JUMP);
InjectHook(0x4A13B0, &CPlayerInfo::CancelPlayerEnteringCars, PATCH_JUMP);
InjectHook(0x4A1400, &CPlayerInfo::MakePlayerSafe, PATCH_JUMP);
InjectHook(0x4A0EC0, &CPlayerInfo::EvaluateCarPosition, PATCH_JUMP);
InjectHook(0x4A15F0, &CPlayerInfo::AwardMoneyForExplosion, PATCH_JUMP);
InjectHook(0x4A0B20, &CPlayerInfo::LoadPlayerInfo, PATCH_JUMP);
InjectHook(0x4A0960, &CPlayerInfo::SavePlayerInfo, PATCH_JUMP);
InjectHook(0x49FD30, &CPlayerInfo::Process, PATCH_JUMP);
ENDPATCHES

View File

@ -1,5 +1,5 @@
#include "common.h" #include "common.h"
#include "patcher.h"
#include "Pools.h" #include "Pools.h"
#include "Boat.h" #include "Boat.h"
@ -10,15 +10,15 @@
#include "Wanted.h" #include "Wanted.h"
#include "World.h" #include "World.h"
CCPtrNodePool *&CPools::ms_pPtrNodePool = *(CCPtrNodePool**)0x943044; CCPtrNodePool *CPools::ms_pPtrNodePool;
CEntryInfoNodePool *&CPools::ms_pEntryInfoNodePool = *(CEntryInfoNodePool**)0x941448; CEntryInfoNodePool *CPools::ms_pEntryInfoNodePool;
CPedPool *&CPools::ms_pPedPool = *(CPedPool**)0x8F2C60; CPedPool *CPools::ms_pPedPool;
CVehiclePool *&CPools::ms_pVehiclePool = *(CVehiclePool**)0x9430DC; CVehiclePool *CPools::ms_pVehiclePool;
CBuildingPool *&CPools::ms_pBuildingPool = *(CBuildingPool**)0x8F2C04; CBuildingPool *CPools::ms_pBuildingPool;
CTreadablePool *&CPools::ms_pTreadablePool = *(CTreadablePool**)0x8F2568; CTreadablePool *CPools::ms_pTreadablePool;
CObjectPool *&CPools::ms_pObjectPool = *(CObjectPool**)0x880E28; CObjectPool *CPools::ms_pObjectPool;
CDummyPool *&CPools::ms_pDummyPool = *(CDummyPool**)0x8F2C18; CDummyPool *CPools::ms_pDummyPool;
CAudioScriptObjectPool *&CPools::ms_pAudioScriptObjectPool = *(CAudioScriptObjectPool**)0x8F1B6C; CAudioScriptObjectPool *CPools::ms_pAudioScriptObjectPool;
void void
CPools::Initialise(void) CPools::Initialise(void)
@ -425,19 +425,3 @@ INITSAVEBUF
} }
VALIDATESAVEBUF(size) VALIDATESAVEBUF(size)
} }
STARTPATCHES
InjectHook(0x4A1770, CPools::Initialise, PATCH_JUMP);
InjectHook(0x4A1880, CPools::ShutDown, PATCH_JUMP);
InjectHook(0x4A1A50, CPools::CheckPoolsEmpty, PATCH_JUMP);
InjectHook(0x4A1A80, CPools::GetPedRef, PATCH_JUMP);
InjectHook(0x4A1AA0, CPools::GetPed, PATCH_JUMP);
InjectHook(0x4A1AC0, CPools::GetVehicleRef, PATCH_JUMP);
InjectHook(0x4A1AE0, CPools::GetVehicle, PATCH_JUMP);
InjectHook(0x4A1B00, CPools::GetObjectRef, PATCH_JUMP);
InjectHook(0x4A1B20, CPools::GetObject, PATCH_JUMP);
InjectHook(0x4A2DB0, CPools::MakeSureSlotInObjectPoolIsEmpty, PATCH_JUMP);
InjectHook(0x4A1B40, CPools::LoadVehiclePool, PATCH_JUMP);
InjectHook(0x4A2550, CPools::LoadObjectPool, PATCH_JUMP);
InjectHook(0x4A2B50, CPools::LoadPedPool, PATCH_JUMP);
ENDPATCHES

View File

@ -22,15 +22,15 @@ typedef CPool<cAudioScriptObject> CAudioScriptObjectPool;
class CPools class CPools
{ {
static CCPtrNodePool *&ms_pPtrNodePool; static CCPtrNodePool *ms_pPtrNodePool;
static CEntryInfoNodePool *&ms_pEntryInfoNodePool; static CEntryInfoNodePool *ms_pEntryInfoNodePool;
static CPedPool *&ms_pPedPool; static CPedPool *ms_pPedPool;
static CVehiclePool *&ms_pVehiclePool; static CVehiclePool *ms_pVehiclePool;
static CBuildingPool *&ms_pBuildingPool; static CBuildingPool *ms_pBuildingPool;
static CTreadablePool *&ms_pTreadablePool; static CTreadablePool *ms_pTreadablePool;
static CObjectPool *&ms_pObjectPool; static CObjectPool *ms_pObjectPool;
static CDummyPool *&ms_pDummyPool; static CDummyPool *ms_pDummyPool;
static CAudioScriptObjectPool *&ms_pAudioScriptObjectPool; static CAudioScriptObjectPool *ms_pAudioScriptObjectPool;
public: public:
static CCPtrNodePool *GetPtrNodePool(void) { return ms_pPtrNodePool; } static CCPtrNodePool *GetPtrNodePool(void) { return ms_pPtrNodePool; }
static CEntryInfoNodePool *GetEntryInfoNodePool(void) { return ms_pEntryInfoNodePool; } static CEntryInfoNodePool *GetEntryInfoNodePool(void) { return ms_pEntryInfoNodePool; }

View File

@ -1,6 +1,6 @@
#include "config.h" #include "config.h"
#include "common.h" #include "common.h"
#include "patcher.h"
#include "RwHelper.h" #include "RwHelper.h"
#include "Radar.h" #include "Radar.h"
#include "Camera.h" #include "Camera.h"
@ -19,28 +19,28 @@
float CRadar::m_radarRange; float CRadar::m_radarRange;
sRadarTrace CRadar::ms_RadarTrace[NUMRADARBLIPS]; sRadarTrace CRadar::ms_RadarTrace[NUMRADARBLIPS];
CVector2D vec2DRadarOrigin; CVector2D vec2DRadarOrigin;
int32 gRadarTxdIds[64];// = (int*)0x6299C0; int32 gRadarTxdIds[64];
CSprite2d CRadar::AsukaSprite;// = *(CSprite2d*)0x8F1A40; CSprite2d CRadar::AsukaSprite;
CSprite2d CRadar::BombSprite;// = (CSprite2d*)0x8F5FB4; CSprite2d CRadar::BombSprite;
CSprite2d CRadar::CatSprite;// = (CSprite2d*)0x885B24; CSprite2d CRadar::CatSprite;
CSprite2d CRadar::CentreSprite;// = (CSprite2d*)0x8F6268; CSprite2d CRadar::CentreSprite;
CSprite2d CRadar::CopcarSprite;// = (CSprite2d*)0x8F1A2C; CSprite2d CRadar::CopcarSprite;
CSprite2d CRadar::DonSprite;// = (CSprite2d*)0x8F2BE0; CSprite2d CRadar::DonSprite;
CSprite2d CRadar::EightSprite;// = (CSprite2d*)0x8F2BCC; CSprite2d CRadar::EightSprite;
CSprite2d CRadar::ElSprite;// = (CSprite2d*)0x8F1B80; CSprite2d CRadar::ElSprite;
CSprite2d CRadar::IceSprite;// = (CSprite2d*)0x9415FC; CSprite2d CRadar::IceSprite;
CSprite2d CRadar::JoeySprite;// = (CSprite2d*)0x8F2C00; CSprite2d CRadar::JoeySprite;
CSprite2d CRadar::KenjiSprite;// = (CSprite2d*)0x8F2C68; CSprite2d CRadar::KenjiSprite;
CSprite2d CRadar::LizSprite;// = (CSprite2d*)0x8F5830; CSprite2d CRadar::LizSprite;
CSprite2d CRadar::LuigiSprite;// = (CSprite2d*)0x8F1A3C; CSprite2d CRadar::LuigiSprite;
CSprite2d CRadar::NorthSprite;// = (CSprite2d*)0x8F6274; CSprite2d CRadar::NorthSprite;
CSprite2d CRadar::RaySprite;// = (CSprite2d*)0x8E2A7C; CSprite2d CRadar::RaySprite;
CSprite2d CRadar::SalSprite;// = (CSprite2d*)0x8F29EC; CSprite2d CRadar::SalSprite;
CSprite2d CRadar::SaveSprite;// = (CSprite2d*)0x8F5F74; CSprite2d CRadar::SaveSprite;
CSprite2d CRadar::SpraySprite;// = (CSprite2d*)0x94307C; CSprite2d CRadar::SpraySprite;
CSprite2d CRadar::TonySprite;// = (CSprite2d*)0x885B58; CSprite2d CRadar::TonySprite;
CSprite2d CRadar::WeaponSprite;// = (CSprite2d*)0x941534; CSprite2d CRadar::WeaponSprite;
CSprite2d *CRadar::RadarSprites[RADAR_SPRITE_COUNT] = { CSprite2d *CRadar::RadarSprites[RADAR_SPRITE_COUNT] = {
nil, nil,
@ -1458,51 +1458,3 @@ CRadar::ToggleTargetMarker(float x, float y)
} }
#endif #endif
STARTPATCHES
InjectHook(0x4A3EF0, CRadar::Initialise, PATCH_JUMP);
InjectHook(0x4A3F60, CRadar::Shutdown, PATCH_JUMP);
InjectHook(0x4A4030, CRadar::LoadTextures, PATCH_JUMP);
InjectHook(0x4A4180, CRadar::GetNewUniqueBlipIndex, PATCH_JUMP);
InjectHook(0x4A41C0, CRadar::GetActualBlipArrayIndex, PATCH_JUMP);
InjectHook(0x4A4200, CRadar::DrawMap, PATCH_JUMP);
InjectHook(0x4A42F0, CRadar::DrawBlips, PATCH_JUMP);
InjectHook(0x4A4C70, CRadar::Draw3dMarkers, PATCH_JUMP);
InjectHook(0x4A4F30, CRadar::LimitRadarPoint, PATCH_JUMP);
InjectHook(0x4A4F90, CRadar::CalculateBlipAlpha, PATCH_JUMP);
InjectHook(0x4A5040, CRadar::TransformRadarPointToScreenSpace, PATCH_JUMP);
InjectHook(0x4A50D0, CRadar::TransformRealWorldPointToRadarSpace, PATCH_JUMP);
InjectHook(0x4A5300, CRadar::TransformRadarPointToRealWorldSpace, PATCH_JUMP);
InjectHook(0x4A5530, CRadar::TransformRealWorldToTexCoordSpace, PATCH_JUMP);
InjectHook(0x4A5590, CRadar::SetCoordBlip, PATCH_JUMP);
InjectHook(0x4A5640, CRadar::SetEntityBlip, PATCH_JUMP);
InjectHook(0x4A56C0, CRadar::ClearBlipForEntity, PATCH_JUMP);
InjectHook(0x4A5720, CRadar::ClearBlip, PATCH_JUMP);
InjectHook(0x4A5770, CRadar::ChangeBlipColour, PATCH_JUMP);
InjectHook(0x4A57A0, CRadar::ChangeBlipBrightness, PATCH_JUMP);
InjectHook(0x4A57E0, CRadar::ChangeBlipScale, PATCH_JUMP);
InjectHook(0x4A5810, CRadar::ChangeBlipDisplay, PATCH_JUMP);
InjectHook(0x4A5840, CRadar::SetBlipSprite, PATCH_JUMP);
InjectHook(0x4A5870, CRadar::ShowRadarTrace, PATCH_JUMP);
InjectHook(0x4A59C0, CRadar::ShowRadarMarker, PATCH_JUMP);
InjectHook(0x4A5BB0, CRadar::GetRadarTraceColour, PATCH_JUMP);
InjectHook(0x4A5C60, CRadar::SetRadarMarkerState, PATCH_JUMP);
InjectHook(0x4A5D10, CRadar::DrawRotatingRadarSprite, PATCH_JUMP);
InjectHook(0x4A5EF0, CRadar::DrawRadarSprite, PATCH_JUMP);
InjectHook(0x4A6020, ClipRadarTileCoords, PATCH_JUMP);
InjectHook(0x4A6060, RequestMapSection, PATCH_JUMP);
InjectHook(0x4A60A0, RemoveMapSection, PATCH_JUMP);
InjectHook(0x4A60E0, CRadar::RemoveRadarSections, PATCH_JUMP);
InjectHook(0x4A6100, (void (*)(int32, int32))&CRadar::StreamRadarSections, PATCH_JUMP);
InjectHook(0x4A6160, IsPointInsideRadar, PATCH_JUMP);
InjectHook(0x4A61C0, GetTextureCorners, PATCH_JUMP);
InjectHook(0x4A6250, LineRadarBoxCollision, PATCH_JUMP);
InjectHook(0x4A64A0, CRadar::ClipRadarPoly, PATCH_JUMP);
InjectHook(0x4A67E0, CRadar::DrawRadarSection, PATCH_JUMP);
InjectHook(0x4A69C0, CRadar::DrawRadarMask, PATCH_JUMP);
InjectHook(0x4A6B60, (void (*)(const CVector&))&CRadar::StreamRadarSections, PATCH_JUMP);
InjectHook(0x4A6C20, CRadar::DrawRadarMap, PATCH_JUMP);
InjectHook(0x4A6E30, CRadar::SaveAllRadarBlips, PATCH_JUMP);
InjectHook(0x4A6F30, CRadar::LoadAllRadarBlips, PATCH_JUMP);
//InjectHook(0x4A7000, `global constructor keyed to'Radar.cpp, PATCH_JUMP);
//InjectHook(0x4A7260, sRadarTrace::sRadarTrace, PATCH_JUMP);
ENDPATCHES

View File

@ -1,13 +1,13 @@
#include "common.h" #include "common.h"
#include "patcher.h"
#include "World.h" #include "World.h"
#include "Vehicle.h" #include "Vehicle.h"
#include "PlayerPed.h" #include "PlayerPed.h"
#include "Pools.h" #include "Pools.h"
#include "References.h" #include "References.h"
CReference *CReferences::aRefs = (CReference*)0x70BBE0; //[NUMREFERENCES]; CReference CReferences::aRefs[NUMREFERENCES];
CReference *&CReferences::pEmptyList = *(CReference**)0x8F1AF8; CReference *CReferences::pEmptyList;
void void
CReferences::Init(void) CReferences::Init(void)
@ -57,9 +57,3 @@ CReferences::PruneAllReferencesInWorld(void)
e->PruneReferences(); e->PruneReferences();
} }
} }
STARTPATCHES
InjectHook(0x4A7350, CReferences::Init, PATCH_JUMP);
InjectHook(0x4A7570, CReferences::RemoveReferencesToPlayer, PATCH_JUMP);
InjectHook(0x4A75A0, CReferences::PruneAllReferencesInWorld, PATCH_JUMP);
ENDPATCHES

View File

@ -11,8 +11,8 @@ struct CReference
class CReferences class CReferences
{ {
public: public:
static CReference *aRefs; //[NUMREFERENCES]; static CReference aRefs[NUMREFERENCES];
static CReference *&pEmptyList; static CReference *pEmptyList;
static void Init(void); static void Init(void);
static void RemoveReferencesToPlayer(void); static void RemoveReferencesToPlayer(void);

View File

@ -1,62 +1,62 @@
#include "common.h" #include "common.h"
#include "patcher.h"
#include "Stats.h" #include "Stats.h"
#include "Text.h" #include "Text.h"
#include "World.h" #include "World.h"
int32 &CStats::DaysPassed = *(int32*)0x8F2BB8; int32 CStats::DaysPassed;
int32 &CStats::HeadsPopped = *(int32*)0x8F647C; int32 CStats::HeadsPopped;
int32& CStats::CommercialPassed = *(int32*)0x8F4334; int32 CStats::CommercialPassed;
int32& CStats::IndustrialPassed = *(int32*)0x8E2A68; int32 CStats::IndustrialPassed;
int32& CStats::SuburbanPassed = *(int32*)0x8F2740; int32 CStats::SuburbanPassed;
int32 &CStats::NumberKillFrenziesPassed = *(int32*)0x8E287C; int32 CStats::NumberKillFrenziesPassed;
int32 &CStats::PeopleKilledByOthers = *(int32*)0x8E2C50; int32 CStats::PeopleKilledByOthers;
int32 &CStats::HelisDestroyed = *(int32*)0x8E2A64; int32 CStats::HelisDestroyed;
int32(&CStats::PedsKilledOfThisType)[NUM_PEDTYPES] = *(int32(*)[NUM_PEDTYPES]) * (uintptr*)0x880DBC; int32 CStats::PedsKilledOfThisType[NUM_PEDTYPES];
int32 &CStats::TimesDied = *(int32*)0x8E2BDC; int32 CStats::TimesDied;
int32 &CStats::TimesArrested = *(int32*)0x8E2BEC; int32 CStats::TimesArrested;
int32 &CStats::KillsSinceLastCheckpoint = *(int32*)0x8F2C8C; int32 CStats::KillsSinceLastCheckpoint;
int32& CStats::DistanceTravelledInVehicle = *(int32*)0x940574; int32 CStats::DistanceTravelledInVehicle;
int32& CStats::DistanceTravelledOnFoot = *(int32*)0x941518; int32 CStats::DistanceTravelledOnFoot;
int32 &CStats::ProgressMade = *(int32*)0x8F6224; int32 CStats::ProgressMade;
int32 &CStats::TotalProgressInGame = *(int32*)0x885B2C; int32 CStats::TotalProgressInGame;
int32& CStats::CarsExploded = *(int32*)0x941288; int32 CStats::CarsExploded;
int32& CStats::PeopleKilledByPlayer = *(int32*)0x8F1B7C; int32 CStats::PeopleKilledByPlayer;
float &CStats::MaximumJumpDistance = *(float*)0x8F2BDC; float CStats::MaximumJumpDistance;
float &CStats::MaximumJumpHeight = *(float*)0x940564; float CStats::MaximumJumpHeight;
int32 &CStats::MaximumJumpFlips = *(int32*)0x8F2524; int32 CStats::MaximumJumpFlips;
int32 &CStats::MaximumJumpSpins = *(int32*)0x8F29B0; int32 CStats::MaximumJumpSpins;
int32 &CStats::BestStuntJump = *(int32*)0x885B50; int32 CStats::BestStuntJump;
int32 &CStats::NumberOfUniqueJumpsFound = *(int32*)0x885B74; int32 CStats::NumberOfUniqueJumpsFound;
int32 &CStats::TotalNumberOfUniqueJumps = *(int32*)0x8E2DC0; int32 CStats::TotalNumberOfUniqueJumps;
int32 &CStats::PassengersDroppedOffWithTaxi = *(int32*)0x940724; int32 CStats::PassengersDroppedOffWithTaxi;
int32 &CStats::MoneyMadeWithTaxi = *(int32*)0x941544; int32 CStats::MoneyMadeWithTaxi;
int32 &CStats::MissionsGiven = *(int32*)0x9430E8; int32 CStats::MissionsGiven;
int32 &CStats::MissionsPassed = *(int32*)0x940768; int32 CStats::MissionsPassed;
char(&CStats::LastMissionPassedName)[8] = *(char(*)[8])*(uintptr*)0x70D828; char CStats::LastMissionPassedName[8];
int32 &CStats::TotalLegitimateKills = *(int32*)0x8F6004; int32 CStats::TotalLegitimateKills;
int32 &CStats::ElBurroTime = *(int32*)0x8E2A6C; int32 CStats::ElBurroTime;
int32& CStats::Record4x4One = *(int32*)0x940570; int32 CStats::Record4x4One;
int32& CStats::Record4x4Two = *(int32*)0x94058C; int32 CStats::Record4x4Two;
int32& CStats::Record4x4Three = *(int32*)0x880FA8; int32 CStats::Record4x4Three;
int32& CStats::Record4x4Mayhem = *(int32*)0x885B70; int32 CStats::Record4x4Mayhem;
int32& CStats::LivesSavedWithAmbulance = *(int32*)0x8F57E0; int32 CStats::LivesSavedWithAmbulance;
int32& CStats::CriminalsCaught = *(int32*)0x8F2518; int32 CStats::CriminalsCaught;
int32& CStats::HighestLevelAmbulanceMission = *(int32*)0x8F2A04; int32 CStats::HighestLevelAmbulanceMission;
int32& CStats::FiresExtinguished = *(int32*)0x8F5FEC; int32 CStats::FiresExtinguished;
int32& CStats::LongestFlightInDodo = *(int32*)0x8F5FE4; int32 CStats::LongestFlightInDodo;
int32& CStats::TimeTakenDefuseMission = *(int32*)0x880E24; int32 CStats::TimeTakenDefuseMission;
int32& CStats::TotalNumberKillFrenzies = *(int32*)0x8E2884; int32 CStats::TotalNumberKillFrenzies;
int32& CStats::TotalNumberMissions = *(int32*)0x8E2820; int32 CStats::TotalNumberMissions;
int32& CStats::RoundsFiredByPlayer = *(int32*)0x8E2BE8; int32 CStats::RoundsFiredByPlayer;
int32& CStats::KgsOfExplosivesUsed = *(int32*)0x8F2510; int32 CStats::KgsOfExplosivesUsed;
int32& CStats::InstantHitsFiredByPlayer = *(int32*)0x943070; int32 CStats::InstantHitsFiredByPlayer;
int32& CStats::InstantHitsHitByPlayer = *(int32*)0x95CB8C; int32 CStats::InstantHitsHitByPlayer;
int32& CStats::BestTimeBombDefusal = *(int32*)0x880E24; int32 CStats::BestTimeBombDefusal;
int32& CStats::mmRain = *(int32*)0x8F2C98; int32 CStats::mmRain;
int32& CStats::CarsCrushed = *(int32*)0x943050; int32 CStats::CarsCrushed;
int32(&CStats::FastestTimes)[CStats::TOTAL_FASTEST_TIMES] = *(int32(*)[CStats::TOTAL_FASTEST_TIMES])*(uintptr*)0x6E9128; int32 CStats::FastestTimes[CStats::TOTAL_FASTEST_TIMES];
int32(&CStats::HighestScores)[CStats::TOTAL_HIGHEST_SCORES] = *(int32(*)[CStats::TOTAL_HIGHEST_SCORES]) * (uintptr*)0x8622B0; int32 CStats::HighestScores[CStats::TOTAL_HIGHEST_SCORES];
void CStats::Init() void CStats::Init()
{ {
@ -418,11 +418,3 @@ void CStats::LoadStats(uint8 *buf, uint32 size)
assert(buf - buf_start == size); assert(buf - buf_start == size);
#undef CopyFromBuf #undef CopyFromBuf
} }
STARTPATCHES
InjectHook(0x48C5A3, CStats::Init, PATCH_JUMP); // CGame::ReInitGameObjectVariables
InjectHook(0x4AB3E0, CStats::SaveStats, PATCH_JUMP);
InjectHook(0x4AB670, CStats::LoadStats, PATCH_JUMP);
InjectHook(0x4AB090, CStats::FindCriminalRatingString, PATCH_JUMP);
InjectHook(0x4AB2A0, CStats::FindCriminalRatingNumber, PATCH_JUMP);
ENDPATCHES

View File

@ -9,59 +9,59 @@ public:
TOTAL_FASTEST_TIMES = 16, TOTAL_FASTEST_TIMES = 16,
TOTAL_HIGHEST_SCORES = 16 TOTAL_HIGHEST_SCORES = 16
}; };
static int32 &DaysPassed; static int32 DaysPassed;
static int32 &HeadsPopped; static int32 HeadsPopped;
static int32& CommercialPassed; static int32 CommercialPassed;
static int32& IndustrialPassed; static int32 IndustrialPassed;
static int32& SuburbanPassed; static int32 SuburbanPassed;
static int32 &NumberKillFrenziesPassed; static int32 NumberKillFrenziesPassed;
static int32 &PeopleKilledByOthers; static int32 PeopleKilledByOthers;
static int32 &HelisDestroyed; static int32 HelisDestroyed;
static int32(&PedsKilledOfThisType)[ePedType::NUM_PEDTYPES]; static int32 PedsKilledOfThisType[ePedType::NUM_PEDTYPES];
static int32 &TimesDied; static int32 TimesDied;
static int32 &TimesArrested; static int32 TimesArrested;
static int32 &KillsSinceLastCheckpoint; static int32 KillsSinceLastCheckpoint;
static int32 &DistanceTravelledInVehicle; static int32 DistanceTravelledInVehicle;
static int32 &DistanceTravelledOnFoot; static int32 DistanceTravelledOnFoot;
static int32 &CarsExploded; static int32 CarsExploded;
static int32 &PeopleKilledByPlayer; static int32 PeopleKilledByPlayer;
static int32 &ProgressMade; static int32 ProgressMade;
static int32 &TotalProgressInGame; static int32 TotalProgressInGame;
static float &MaximumJumpDistance; static float MaximumJumpDistance;
static float &MaximumJumpHeight; static float MaximumJumpHeight;
static int32 &MaximumJumpFlips; static int32 MaximumJumpFlips;
static int32 &MaximumJumpSpins; static int32 MaximumJumpSpins;
static int32 &BestStuntJump; static int32 BestStuntJump;
static int32 &NumberOfUniqueJumpsFound; static int32 NumberOfUniqueJumpsFound;
static int32 &TotalNumberOfUniqueJumps; static int32 TotalNumberOfUniqueJumps;
static int32 &PassengersDroppedOffWithTaxi; static int32 PassengersDroppedOffWithTaxi;
static int32 &MoneyMadeWithTaxi; static int32 MoneyMadeWithTaxi;
static int32 &MissionsGiven; static int32 MissionsGiven;
static int32 &MissionsPassed; static int32 MissionsPassed;
static char (&LastMissionPassedName)[8]; static char LastMissionPassedName[8];
static int32 &TotalLegitimateKills; static int32 TotalLegitimateKills;
static int32 &ElBurroTime; static int32 ElBurroTime;
static int32 &Record4x4One; static int32 Record4x4One;
static int32 &Record4x4Two; static int32 Record4x4Two;
static int32 &Record4x4Three; static int32 Record4x4Three;
static int32 &Record4x4Mayhem; static int32 Record4x4Mayhem;
static int32 &LivesSavedWithAmbulance; static int32 LivesSavedWithAmbulance;
static int32 &CriminalsCaught; static int32 CriminalsCaught;
static int32 &HighestLevelAmbulanceMission; static int32 HighestLevelAmbulanceMission;
static int32 &FiresExtinguished; static int32 FiresExtinguished;
static int32 &LongestFlightInDodo; static int32 LongestFlightInDodo;
static int32 &TimeTakenDefuseMission; static int32 TimeTakenDefuseMission;
static int32 &TotalNumberKillFrenzies; static int32 TotalNumberKillFrenzies;
static int32 &TotalNumberMissions; static int32 TotalNumberMissions;
static int32 &RoundsFiredByPlayer; static int32 RoundsFiredByPlayer;
static int32 &KgsOfExplosivesUsed; static int32 KgsOfExplosivesUsed;
static int32 &InstantHitsFiredByPlayer; static int32 InstantHitsFiredByPlayer;
static int32 &InstantHitsHitByPlayer; static int32 InstantHitsHitByPlayer;
static int32 &BestTimeBombDefusal; static int32 BestTimeBombDefusal;
static int32 &mmRain; static int32 mmRain;
static int32 &CarsCrushed; static int32 CarsCrushed;
static int32(&FastestTimes)[TOTAL_FASTEST_TIMES]; static int32 FastestTimes[TOTAL_FASTEST_TIMES];
static int32(&HighestScores)[TOTAL_HIGHEST_SCORES]; static int32 HighestScores[TOTAL_HIGHEST_SCORES];
public: public:
static void Init(void); static void Init(void);

View File

@ -1,5 +1,5 @@
#include "common.h" #include "common.h"
#include "patcher.h"
#include "General.h" #include "General.h"
#include "Pad.h" #include "Pad.h"
#include "Hud.h" #include "Hud.h"
@ -30,49 +30,49 @@
#include "Streaming.h" #include "Streaming.h"
#include "main.h" #include "main.h"
bool &CStreaming::ms_disableStreaming = *(bool*)0x95CD6E; bool CStreaming::ms_disableStreaming;
bool &CStreaming::ms_bLoadingBigModel = *(bool*)0x95CDB0; bool CStreaming::ms_bLoadingBigModel;
int32 &CStreaming::ms_numModelsRequested = *(int32*)0x8E2C10; int32 CStreaming::ms_numModelsRequested;
CStreamingInfo *CStreaming::ms_aInfoForModel = (CStreamingInfo*)0x6C7088; CStreamingInfo CStreaming::ms_aInfoForModel[NUMSTREAMINFO];
CStreamingInfo &CStreaming::ms_startLoadedList = *(CStreamingInfo*)0x942F60; CStreamingInfo CStreaming::ms_startLoadedList;
CStreamingInfo &CStreaming::ms_endLoadedList = *(CStreamingInfo*)0x8F1AC0; CStreamingInfo CStreaming::ms_endLoadedList;
CStreamingInfo &CStreaming::ms_startRequestedList = *(CStreamingInfo*)0x8F1B3C; CStreamingInfo CStreaming::ms_startRequestedList;
CStreamingInfo &CStreaming::ms_endRequestedList = *(CStreamingInfo*)0x940738; CStreamingInfo CStreaming::ms_endRequestedList;
int32 &CStreaming::ms_oldSectorX = *(int32*)0x8F2C84; int32 CStreaming::ms_oldSectorX;
int32 &CStreaming::ms_oldSectorY = *(int32*)0x8F2C88; int32 CStreaming::ms_oldSectorY;
int32 &CStreaming::ms_streamingBufferSize = *(int32*)0x942FB0; int32 CStreaming::ms_streamingBufferSize;
int8 **CStreaming::ms_pStreamingBuffer = (int8**)0x87F818; int8 *CStreaming::ms_pStreamingBuffer[2];
int32 &CStreaming::ms_memoryUsed = *(int32*)0x940568; int32 CStreaming::ms_memoryUsed;
CStreamingChannel *CStreaming::ms_channel = (CStreamingChannel*)0x727EE0; CStreamingChannel CStreaming::ms_channel[2];
int32 &CStreaming::ms_channelError = *(int32*)0x880DB8; int32 CStreaming::ms_channelError;
int32 &CStreaming::ms_numVehiclesLoaded = *(int32*)0x8F2C80; int32 CStreaming::ms_numVehiclesLoaded;
int32 *CStreaming::ms_vehiclesLoaded = (int32*)0x773560; int32 CStreaming::ms_vehiclesLoaded[MAXVEHICLESLOADED];
int32 &CStreaming::ms_lastVehicleDeleted = *(int32*)0x95CBF8; int32 CStreaming::ms_lastVehicleDeleted;
CDirectory *&CStreaming::ms_pExtraObjectsDir = *(CDirectory**)0x95CB90; CDirectory *CStreaming::ms_pExtraObjectsDir;
int32 &CStreaming::ms_numPriorityRequests = *(int32*)0x8F31C4; int32 CStreaming::ms_numPriorityRequests;
bool &CStreaming::ms_hasLoadedLODs = *(bool*)0x95CD47; bool CStreaming::ms_hasLoadedLODs;
int32 &CStreaming::ms_currentPedGrp = *(int32*)0x8F2BBC; int32 CStreaming::ms_currentPedGrp;
int32 CStreaming::ms_currentPedLoading; int32 CStreaming::ms_currentPedLoading;
int32 CStreaming::ms_lastCullZone; int32 CStreaming::ms_lastCullZone;
uint16 &CStreaming::ms_loadedGangs = *(uint16*)0x95CC60; uint16 CStreaming::ms_loadedGangs;
uint16 &CStreaming::ms_loadedGangCars = *(uint16*)0x95CC2E; uint16 CStreaming::ms_loadedGangCars;
int32 *CStreaming::ms_imageOffsets = (int32*)0x6E60A0; int32 CStreaming::ms_imageOffsets[NUMCDIMAGES];
int32 &CStreaming::ms_lastImageRead = *(int32*)0x880E2C; int32 CStreaming::ms_lastImageRead;
int32 &CStreaming::ms_imageSize = *(int32*)0x8F1A34; int32 CStreaming::ms_imageSize;
uint32 &CStreaming::ms_memoryAvailable = *(uint32*)0x880F8C; uint32 CStreaming::ms_memoryAvailable;
int32 &desiredNumVehiclesLoaded = *(int32*)0x5EC194; int32 desiredNumVehiclesLoaded = 12;
CEntity *&pIslandLODindustEntity = *(CEntity**)0x6212DC; CEntity *pIslandLODindustEntity;
CEntity *&pIslandLODcomIndEntity = *(CEntity**)0x6212E0; CEntity *pIslandLODcomIndEntity;
CEntity *&pIslandLODcomSubEntity = *(CEntity**)0x6212E4; CEntity *pIslandLODcomSubEntity;
CEntity *&pIslandLODsubIndEntity = *(CEntity**)0x6212E8; CEntity *pIslandLODsubIndEntity;
CEntity *&pIslandLODsubComEntity = *(CEntity**)0x6212EC; CEntity *pIslandLODsubComEntity;
int32 &islandLODindust = *(int32*)0x6212C8; int32 islandLODindust;
int32 &islandLODcomInd = *(int32*)0x6212CC; int32 islandLODcomInd;
int32 &islandLODcomSub = *(int32*)0x6212D0; int32 islandLODcomSub;
int32 &islandLODsubInd = *(int32*)0x6212D4; int32 islandLODsubInd;
int32 &islandLODsubCom = *(int32*)0x6212D8; int32 islandLODsubCom;
bool bool
CStreamingInfo::GetCdPosnAndSize(uint32 &posn, uint32 &size) CStreamingInfo::GetCdPosnAndSize(uint32 &posn, uint32 &size)
@ -199,7 +199,7 @@ CStreaming::Init(void)
// PC only, figure out how much memory we got // PC only, figure out how much memory we got
#ifdef GTA_PC #ifdef GTA_PC
#define MB (1024*1024) #define MB (1024*1024)
extern unsigned long &_dwMemAvailPhys; extern unsigned long _dwMemAvailPhys;
ms_memoryAvailable = (_dwMemAvailPhys - 10*MB)/2; ms_memoryAvailable = (_dwMemAvailPhys - 10*MB)/2;
if(ms_memoryAvailable < 50*MB) if(ms_memoryAvailable < 50*MB)
ms_memoryAvailable = 50*MB; ms_memoryAvailable = 50*MB;
@ -2439,82 +2439,3 @@ CStreaming::UpdateForAnimViewer(void)
CStreaming::RetryLoadFile(CStreaming::ms_channelError); CStreaming::RetryLoadFile(CStreaming::ms_channelError);
} }
} }
STARTPATCHES
InjectHook(0x406430, CStreaming::Init, PATCH_JUMP);
InjectHook(0x406C80, CStreaming::Shutdown, PATCH_JUMP);
InjectHook(0x4076C0, CStreaming::Update, PATCH_JUMP);
InjectHook(0x406CC0, (void (*)(void))CStreaming::LoadCdDirectory, PATCH_JUMP);
InjectHook(0x406DA0, (void (*)(const char*, int))CStreaming::LoadCdDirectory, PATCH_JUMP);
InjectHook(0x409740, CStreaming::ConvertBufferToObject, PATCH_JUMP);
InjectHook(0x409580, CStreaming::FinishLoadingLargeFile, PATCH_JUMP);
InjectHook(0x407EA0, CStreaming::RequestModel, PATCH_JUMP);
InjectHook(0x407FD0, CStreaming::RequestSubway, PATCH_JUMP);
InjectHook(0x408190, CStreaming::RequestBigBuildings, PATCH_JUMP);
InjectHook(0x408210, CStreaming::RequestIslands, PATCH_JUMP);
InjectHook(0x40A890, CStreaming::RequestSpecialModel, PATCH_JUMP);
InjectHook(0x40ADA0, CStreaming::RequestSpecialChar, PATCH_JUMP);
InjectHook(0x54A5F0, CStreaming::HasModelLoaded, PATCH_JUMP);
InjectHook(0x40ADC0, CStreaming::HasSpecialCharLoaded, PATCH_JUMP);
InjectHook(0x40ADE0, CStreaming::SetMissionDoesntRequireSpecialChar, PATCH_JUMP);
InjectHook(0x408830, CStreaming::RemoveModel, PATCH_JUMP);
InjectHook(0x4083A0, CStreaming::RemoveUnusedBuildings, PATCH_JUMP);
InjectHook(0x4083D0, CStreaming::RemoveBuildings, PATCH_JUMP);
InjectHook(0x408640, CStreaming::RemoveUnusedBigBuildings, PATCH_JUMP);
InjectHook(0x408680, CStreaming::RemoveBigBuildings, PATCH_JUMP);
InjectHook(0x408780, CStreaming::RemoveIslandsNotUsed, PATCH_JUMP);
InjectHook(0x40B180, CStreaming::RemoveLoadedVehicle, PATCH_JUMP);
InjectHook(0x4089B0, CStreaming::RemoveLeastUsedModel, PATCH_JUMP);
InjectHook(0x408940, CStreaming::RemoveAllUnusedModels, PATCH_JUMP);
InjectHook(0x409450, CStreaming::RemoveReferencedTxds, PATCH_JUMP);
InjectHook(0x40B160, CStreaming::GetAvailableVehicleSlot, PATCH_JUMP);
InjectHook(0x40B060, CStreaming::AddToLoadedVehiclesList, PATCH_JUMP);
InjectHook(0x4094C0, CStreaming::IsTxdUsedByRequestedModels, PATCH_JUMP);
InjectHook(0x407E70, CStreaming::IsObjectInCdImage, PATCH_JUMP);
InjectHook(0x408280, CStreaming::HaveAllBigBuildingsLoaded, PATCH_JUMP);
InjectHook(0x40A790, CStreaming::SetModelIsDeletable, PATCH_JUMP);
InjectHook(0x40A800, CStreaming::SetModelTxdIsDeletable, PATCH_JUMP);
InjectHook(0x40A820, CStreaming::SetMissionDoesntRequireModel, PATCH_JUMP);
InjectHook(0x40AA00, CStreaming::LoadInitialPeds, PATCH_JUMP);
InjectHook(0x40ADF0, CStreaming::LoadInitialVehicles, PATCH_JUMP);
InjectHook(0x40AE60, CStreaming::StreamVehiclesAndPeds, PATCH_JUMP);
InjectHook(0x40AA30, CStreaming::StreamZoneModels, PATCH_JUMP);
InjectHook(0x40AD00, CStreaming::RemoveCurrentZonesModels, PATCH_JUMP);
InjectHook(0x409BE0, CStreaming::ProcessLoadingChannel, PATCH_JUMP);
InjectHook(0x40A610, CStreaming::FlushChannels, PATCH_JUMP);
InjectHook(0x40A680, CStreaming::FlushRequestList, PATCH_JUMP);
InjectHook(0x409FF0, CStreaming::GetCdImageOffset, PATCH_JUMP);
InjectHook(0x409E50, CStreaming::GetNextFileOnCd, PATCH_JUMP);
InjectHook(0x40A060, CStreaming::RequestModelStream, PATCH_JUMP);
InjectHook(0x4077F0, CStreaming::RetryLoadFile, PATCH_JUMP);
InjectHook(0x40A390, CStreaming::LoadRequestedModels, PATCH_JUMP);
InjectHook(0x40A440, CStreaming::LoadAllRequestedModels, PATCH_JUMP);
InjectHook(0x4078F0, CStreaming::AddModelsToRequestList, PATCH_JUMP);
InjectHook(0x407C50, (void (*)(CPtrList&,float,float,float,float,float,float))CStreaming::ProcessEntitiesInSectorList, PATCH_JUMP);
InjectHook(0x407DD0, (void (*)(CPtrList&))CStreaming::ProcessEntitiesInSectorList, PATCH_JUMP);
InjectHook(0x407070, CStreaming::DeleteFarAwayRwObjects, PATCH_JUMP);
InjectHook(0x407390, CStreaming::DeleteAllRwObjects, PATCH_JUMP);
InjectHook(0x407400, CStreaming::DeleteRwObjectsAfterDeath, PATCH_JUMP);
InjectHook(0x408A60, CStreaming::DeleteRwObjectsBehindCamera, PATCH_JUMP);
InjectHook(0x407560, CStreaming::DeleteRwObjectsInSectorList, PATCH_JUMP);
InjectHook(0x4075A0, CStreaming::DeleteRwObjectsInOverlapSectorList, PATCH_JUMP);
InjectHook(0x409340, CStreaming::DeleteRwObjectsBehindCameraInSectorList, PATCH_JUMP);
InjectHook(0x4093C0, CStreaming::DeleteRwObjectsNotInFrustumInSectorList, PATCH_JUMP);
InjectHook(0x409B70, CStreaming::MakeSpaceFor, PATCH_JUMP);
InjectHook(0x40A6D0, CStreaming::LoadScene, PATCH_JUMP);
InjectHook(0x40B210, CStreaming::MemoryCardSave, PATCH_JUMP);
InjectHook(0x40B250, CStreaming::MemoryCardLoad, PATCH_JUMP);
InjectHook(0x4063E0, &CStreamingInfo::GetCdPosnAndSize, PATCH_JUMP);
InjectHook(0x406410, &CStreamingInfo::SetCdPosnAndSize, PATCH_JUMP);
InjectHook(0x4063D0, &CStreamingInfo::GetCdSize, PATCH_JUMP);
InjectHook(0x406380, &CStreamingInfo::AddToList, PATCH_JUMP);
InjectHook(0x4063A0, &CStreamingInfo::RemoveFromList, PATCH_JUMP);
ENDPATCHES

View File

@ -77,36 +77,36 @@ class CPtrList;
class CStreaming class CStreaming
{ {
public: public:
static bool &ms_disableStreaming; static bool ms_disableStreaming;
static bool &ms_bLoadingBigModel; static bool ms_bLoadingBigModel;
static int32 &ms_numModelsRequested; static int32 ms_numModelsRequested;
static CStreamingInfo *ms_aInfoForModel; //[NUMSTREAMINFO] static CStreamingInfo ms_aInfoForModel[NUMSTREAMINFO];
static CStreamingInfo &ms_startLoadedList; static CStreamingInfo ms_startLoadedList;
static CStreamingInfo &ms_endLoadedList; static CStreamingInfo ms_endLoadedList;
static CStreamingInfo &ms_startRequestedList; static CStreamingInfo ms_startRequestedList;
static CStreamingInfo &ms_endRequestedList; static CStreamingInfo ms_endRequestedList;
static int32 &ms_oldSectorX; static int32 ms_oldSectorX;
static int32 &ms_oldSectorY; static int32 ms_oldSectorY;
static int32 &ms_streamingBufferSize; static int32 ms_streamingBufferSize;
static int8 **ms_pStreamingBuffer; //[2] static int8 *ms_pStreamingBuffer[2];
static int32 &ms_memoryUsed; static int32 ms_memoryUsed;
static CStreamingChannel *ms_channel; //[2] static CStreamingChannel ms_channel[2];
static int32 &ms_channelError; static int32 ms_channelError;
static int32 &ms_numVehiclesLoaded; static int32 ms_numVehiclesLoaded;
static int32 *ms_vehiclesLoaded; //[MAXVEHICLESLOADED] static int32 ms_vehiclesLoaded[MAXVEHICLESLOADED];
static int32 &ms_lastVehicleDeleted; static int32 ms_lastVehicleDeleted;
static CDirectory *&ms_pExtraObjectsDir; static CDirectory *ms_pExtraObjectsDir;
static int32 &ms_numPriorityRequests; static int32 ms_numPriorityRequests;
static bool &ms_hasLoadedLODs; static bool ms_hasLoadedLODs;
static int32 &ms_currentPedGrp; static int32 ms_currentPedGrp;
static int32 ms_lastCullZone; static int32 ms_lastCullZone;
static uint16 &ms_loadedGangs; static uint16 ms_loadedGangs;
static uint16 &ms_loadedGangCars; static uint16 ms_loadedGangCars;
static int32 ms_currentPedLoading; static int32 ms_currentPedLoading;
static int32 *ms_imageOffsets; //[NUMCDIMAGES] static int32 ms_imageOffsets[NUMCDIMAGES];
static int32 &ms_lastImageRead; static int32 ms_lastImageRead;
static int32 &ms_imageSize; static int32 ms_imageSize;
static uint32 &ms_memoryAvailable; static uint32 ms_memoryAvailable;
static void Init(void); static void Init(void);
static void Shutdown(void); static void Shutdown(void);

View File

@ -1,12 +1,12 @@
#include "common.h" #include "common.h"
#include "patcher.h"
#include "main.h" #include "main.h"
#include "FileMgr.h" #include "FileMgr.h"
#include "Weather.h" #include "Weather.h"
#include "Collision.h" #include "Collision.h"
#include "SurfaceTable.h" #include "SurfaceTable.h"
float (*CSurfaceTable::ms_aAdhesiveLimitTable)[NUMADHESIVEGROUPS] = (float (*)[NUMADHESIVEGROUPS])0x8E29D4; float CSurfaceTable::ms_aAdhesiveLimitTable[NUMADHESIVEGROUPS][NUMADHESIVEGROUPS];
void void
CSurfaceTable::Initialise(char *filename) CSurfaceTable::Initialise(char *filename)
@ -141,10 +141,3 @@ CSurfaceTable::GetAdhesiveLimit(CColPoint &colpoint)
{ {
return ms_aAdhesiveLimitTable[GetAdhesionGroup(colpoint.surfaceB)][GetAdhesionGroup(colpoint.surfaceA)]; return ms_aAdhesiveLimitTable[GetAdhesionGroup(colpoint.surfaceB)][GetAdhesionGroup(colpoint.surfaceA)];
} }
STARTPATCHES
InjectHook(0x4AB8F0, CSurfaceTable::Initialise, PATCH_JUMP);
InjectHook(0x4ABA60, CSurfaceTable::GetAdhesionGroup, PATCH_JUMP);
InjectHook(0x4ABAA0, CSurfaceTable::GetWetMultiplier, PATCH_JUMP);
InjectHook(0x4ABA30, CSurfaceTable::GetAdhesiveLimit, PATCH_JUMP);
ENDPATCHES

View File

@ -98,8 +98,7 @@ struct CColPoint;
class CSurfaceTable class CSurfaceTable
{ {
// static float ms_aAdhesiveLimitTable[NUMADHESIVEGROUPS][NUMADHESIVEGROUPS]; static float ms_aAdhesiveLimitTable[NUMADHESIVEGROUPS][NUMADHESIVEGROUPS];
static float (*ms_aAdhesiveLimitTable)[NUMADHESIVEGROUPS];
public: public:
static void Initialise(char *filename); static void Initialise(char *filename);
static int GetAdhesionGroup(uint8 surfaceType); static int GetAdhesionGroup(uint8 surfaceType);

View File

@ -1,21 +1,21 @@
#include "common.h" #include "common.h"
#include "patcher.h"
#include "TempColModels.h" #include "TempColModels.h"
#include "SurfaceTable.h" #include "SurfaceTable.h"
CColModel &CTempColModels::ms_colModelPed1 = *(CColModel*)0x726CB0; CColModel CTempColModels::ms_colModelPed1;
CColModel &CTempColModels::ms_colModelPed2 = *(CColModel*)0x726D08; CColModel CTempColModels::ms_colModelPed2;
CColModel &CTempColModels::ms_colModelBBox = *(CColModel*)0x727FE0; CColModel CTempColModels::ms_colModelBBox;
CColModel &CTempColModels::ms_colModelBumper1 = *(CColModel*)0x86BE88; CColModel CTempColModels::ms_colModelBumper1;
CColModel &CTempColModels::ms_colModelWheel1 = *(CColModel*)0x878C40; CColModel CTempColModels::ms_colModelWheel1;
CColModel &CTempColModels::ms_colModelPanel1 = *(CColModel*)0x87BDD8; CColModel CTempColModels::ms_colModelPanel1;
CColModel &CTempColModels::ms_colModelBodyPart2 = *(CColModel*)0x87BE30; CColModel CTempColModels::ms_colModelBodyPart2;
CColModel &CTempColModels::ms_colModelBodyPart1 = *(CColModel*)0x87BE88; CColModel CTempColModels::ms_colModelBodyPart1;
CColModel (&CTempColModels::ms_colModelCutObj)[5] = *(CColModel(*)[5]) *(uintptr*)0x87C960; CColModel CTempColModels::ms_colModelCutObj[5];
CColModel &CTempColModels::ms_colModelPedGroundHit = *(CColModel*)0x880480; CColModel CTempColModels::ms_colModelPedGroundHit;
CColModel &CTempColModels::ms_colModelBoot1 = *(CColModel*)0x880670; CColModel CTempColModels::ms_colModelBoot1;
CColModel &CTempColModels::ms_colModelDoor1 = *(CColModel*)0x880850; CColModel CTempColModels::ms_colModelDoor1;
CColModel &CTempColModels::ms_colModelBonnet1 = *(CColModel*)0x8808A8; CColModel CTempColModels::ms_colModelBonnet1;
CColSphere s_aPedSpheres[3]; CColSphere s_aPedSpheres[3];
@ -287,7 +287,3 @@ CTempColModels::Initialise(void)
#undef SET_COLMODEL_SPHERES #undef SET_COLMODEL_SPHERES
} }
STARTPATCHES
InjectHook(0x412160, CTempColModels::Initialise, PATCH_JUMP);
ENDPATCHES

View File

@ -5,19 +5,19 @@
class CTempColModels class CTempColModels
{ {
public: public:
static CColModel &ms_colModelPed1; static CColModel ms_colModelPed1;
static CColModel &ms_colModelPed2; static CColModel ms_colModelPed2;
static CColModel &ms_colModelBBox; static CColModel ms_colModelBBox;
static CColModel &ms_colModelBumper1; static CColModel ms_colModelBumper1;
static CColModel &ms_colModelWheel1; static CColModel ms_colModelWheel1;
static CColModel &ms_colModelPanel1; static CColModel ms_colModelPanel1;
static CColModel &ms_colModelBodyPart2; static CColModel ms_colModelBodyPart2;
static CColModel &ms_colModelBodyPart1; static CColModel ms_colModelBodyPart1;
static CColModel (&ms_colModelCutObj)[5]; static CColModel ms_colModelCutObj[5];
static CColModel &ms_colModelPedGroundHit; static CColModel ms_colModelPedGroundHit;
static CColModel &ms_colModelBoot1; static CColModel ms_colModelBoot1;
static CColModel &ms_colModelDoor1; static CColModel ms_colModelDoor1;
static CColModel &ms_colModelBonnet1; static CColModel ms_colModelBonnet1;
static void Initialise(void); static void Initialise(void);
}; };

View File

@ -1,5 +1,5 @@
#include "TimeStep.h" #include "TimeStep.h"
float &CTimeStep::ms_fTimeScale = *(float*)0x5F76C8; float CTimeStep::ms_fTimeScale = 1.0f;
float &CTimeStep::ms_fFramesPerUpdate = *(float*)0x5F76CC; float CTimeStep::ms_fFramesPerUpdate = 1.0f;
float &CTimeStep::ms_fTimeStep = *(float*)0x5F76D0; float CTimeStep::ms_fTimeStep = 1.0f;

View File

@ -4,7 +4,7 @@
class CTimeStep class CTimeStep
{ {
public: public:
static float &ms_fTimeScale; static float ms_fTimeScale;
static float &ms_fFramesPerUpdate; static float ms_fFramesPerUpdate;
static float &ms_fTimeStep; static float ms_fTimeStep;
}; };

View File

@ -1,38 +1,32 @@
#include <windows.h> #include <windows.h>
#include "common.h" #include "common.h"
#include "patcher.h"
#include "DMAudio.h" #include "DMAudio.h"
#include "Record.h" #include "Record.h"
#include "Timer.h" #include "Timer.h"
uint32 &CTimer::m_snTimeInMilliseconds = *(uint32*)0x885B48; uint32 CTimer::m_snTimeInMilliseconds;
uint32 &CTimer::m_snTimeInMillisecondsPauseMode = *(uint32*)0x5F7614; uint32 CTimer::m_snTimeInMillisecondsPauseMode = 1;
uint32 &CTimer::m_snTimeInMillisecondsNonClipped = *(uint32*)0x9412E8; uint32 CTimer::m_snTimeInMillisecondsNonClipped;
uint32 &CTimer::m_snPreviousTimeInMilliseconds = *(uint32*)0x8F29E4; uint32 CTimer::m_snPreviousTimeInMilliseconds;
uint32 &CTimer::m_FrameCounter = *(uint32*)0x9412EC; uint32 CTimer::m_FrameCounter;
float &CTimer::ms_fTimeScale = *(float*)0x8F2C20; float CTimer::ms_fTimeScale;
float &CTimer::ms_fTimeStep = *(float*)0x8E2CB4; float CTimer::ms_fTimeStep;
float &CTimer::ms_fTimeStepNonClipped = *(float*)0x8E2C4C; float CTimer::ms_fTimeStepNonClipped;
bool &CTimer::m_UserPause = *(bool*)0x95CD7C; bool CTimer::m_UserPause;
bool &CTimer::m_CodePause = *(bool*)0x95CDB1; bool CTimer::m_CodePause;
//UInt32 oldPcTimer; uint32 oldPcTimer;
uint32 &oldPcTimer = *(uint32*)0x9434F4;
//UInt32 suspendPcTimer; uint32 suspendPcTimer;
uint32 &suspendPcTimer = *(uint32*)0x62A308;
//UInt32 _nCyclesPerMS = 1; uint32 _nCyclesPerMS = 1;
uint32 &_nCyclesPerMS = *(uint32*)0x5F7610;
//LARGE_INTEGER _oldPerfCounter; LARGE_INTEGER _oldPerfCounter;
LARGE_INTEGER &_oldPerfCounter = *(LARGE_INTEGER*)0x62A310;
//LARGE_INTEGER perfSuspendCounter; LARGE_INTEGER perfSuspendCounter;
LARGE_INTEGER &perfSuspendCounter = *(LARGE_INTEGER*)0x62A318;
//UInt32 suspendDepth; uint32 suspendDepth;
uint32 &suspendDepth = *(uint32*)0x62A320;
#ifdef FIX_BUGS #ifdef FIX_BUGS
double frameTime; double frameTime;
@ -231,18 +225,3 @@ uint32 CTimer::GetCyclesPerFrame()
return 20; return 20;
} }
#if 1
STARTPATCHES
InjectHook(0x4ACE60, CTimer::Initialise, PATCH_JUMP);
InjectHook(0x4ACF60, CTimer::Shutdown, PATCH_JUMP);
InjectHook(0x4ACF70, CTimer::Update, PATCH_JUMP);
InjectHook(0x4AD310, CTimer::Suspend, PATCH_JUMP);
InjectHook(0x4AD370, CTimer::Resume, PATCH_JUMP);
InjectHook(0x4AD3F0, CTimer::GetCyclesPerMillisecond, PATCH_JUMP);
InjectHook(0x4AD410, CTimer::GetCurrentTimeInCycles, PATCH_JUMP);
InjectHook(0x4AD450, CTimer::GetIsSlowMotionActive, PATCH_JUMP);
InjectHook(0x4AD480, CTimer::Stop, PATCH_JUMP);
InjectHook(0x4AD490, CTimer::StartUserPause, PATCH_JUMP);
InjectHook(0x4AD4A0, CTimer::EndUserPause, PATCH_JUMP);
ENDPATCHES
#endif

View File

@ -3,17 +3,17 @@
class CTimer class CTimer
{ {
static uint32 &m_snTimeInMilliseconds; static uint32 m_snTimeInMilliseconds;
static uint32 &m_snTimeInMillisecondsPauseMode; static uint32 m_snTimeInMillisecondsPauseMode;
static uint32 &m_snTimeInMillisecondsNonClipped; static uint32 m_snTimeInMillisecondsNonClipped;
static uint32 &m_snPreviousTimeInMilliseconds; static uint32 m_snPreviousTimeInMilliseconds;
static uint32 &m_FrameCounter; static uint32 m_FrameCounter;
static float &ms_fTimeScale; static float ms_fTimeScale;
static float &ms_fTimeStep; static float ms_fTimeStep;
static float &ms_fTimeStepNonClipped; static float ms_fTimeStepNonClipped;
public: public:
static bool &m_UserPause; static bool m_UserPause;
static bool &m_CodePause; static bool m_CodePause;
static const float &GetTimeStep(void) { return ms_fTimeStep; } static const float &GetTimeStep(void) { return ms_fTimeStep; }
static void SetTimeStep(float ts) { ms_fTimeStep = ts; } static void SetTimeStep(float ts) { ms_fTimeStep = ts; }

View File

@ -1,5 +1,5 @@
#include "common.h" #include "common.h"
#include "patcher.h"
#include "Hud.h" #include "Hud.h"
#include "PlayerPed.h" #include "PlayerPed.h"
@ -9,10 +9,10 @@
#include "World.h" #include "World.h"
#include "Zones.h" #include "Zones.h"
CPlaceName& CUserDisplay::PlaceName = *(CPlaceName*)0x8F29BC; CPlaceName CUserDisplay::PlaceName;
COnscreenTimer& CUserDisplay::OnscnTimer = *(COnscreenTimer*)0x862238; COnscreenTimer CUserDisplay::OnscnTimer;
CPager& CUserDisplay::Pager = *(CPager*)0x8F2744; CPager CUserDisplay::Pager;
CCurrentVehicle& CUserDisplay::CurrentVehicle = *(CCurrentVehicle*)0x8F5FE8; CCurrentVehicle CUserDisplay::CurrentVehicle;
CPlaceName::CPlaceName() CPlaceName::CPlaceName()
{ {
@ -120,16 +120,3 @@ CUserDisplay::Process()
Pager.Process(); Pager.Process();
CurrentVehicle.Process(); CurrentVehicle.Process();
} }
STARTPATCHES
InjectHook(0x4AD4C0, &CPlaceName::Init, PATCH_JUMP);
InjectHook(0x4AD4E0, &CPlaceName::Process, PATCH_JUMP);
InjectHook(0x4AD5B0, &CPlaceName::Display, PATCH_JUMP);
InjectHook(0x4AD5F0, &CCurrentVehicle::Init, PATCH_JUMP);
InjectHook(0x4AD600, &CCurrentVehicle::Process, PATCH_JUMP);
InjectHook(0x4AD630, &CCurrentVehicle::Display, PATCH_JUMP);
InjectHook(0x4AD660, &CUserDisplay::Init, PATCH_JUMP);
InjectHook(0x4AD690, &CUserDisplay::Process, PATCH_JUMP);
ENDPATCHES

View File

@ -31,10 +31,10 @@ public:
class CUserDisplay class CUserDisplay
{ {
public: public:
static CPlaceName &PlaceName; static CPlaceName PlaceName;
static COnscreenTimer &OnscnTimer; static COnscreenTimer OnscnTimer;
static CPager &Pager; static CPager Pager;
static CCurrentVehicle &CurrentVehicle; static CCurrentVehicle CurrentVehicle;
static void Init(); static void Init();
static void Process(); static void Process();

View File

@ -1,5 +1,5 @@
#include "common.h" #include "common.h"
#include "patcher.h"
#include "Pools.h" #include "Pools.h"
#include "ModelIndices.h" #include "ModelIndices.h"
#include "Timer.h" #include "Timer.h"
@ -11,8 +11,8 @@
#include "Wanted.h" #include "Wanted.h"
#include "General.h" #include "General.h"
int32 &CWanted::MaximumWantedLevel = *(int32*)0x5F7714; // 6 int32 CWanted::MaximumWantedLevel = 6;
int32 &CWanted::nMaximumWantedLevel = *(int32*)0x5F7718; // 6400 int32 CWanted::nMaximumWantedLevel = 6400;
void void
CWanted::Initialise() CWanted::Initialise()
@ -456,25 +456,3 @@ CWanted::UpdateCrimesQ(void)
} }
} }
} }
STARTPATCHES
InjectHook(0x4AD6E0, &CWanted::Initialise, PATCH_JUMP);
InjectHook(0x4AD790, &CWanted::Reset, PATCH_JUMP);
InjectHook(0x4AD7B0, &CWanted::Update, PATCH_JUMP);
InjectHook(0x4AD900, &CWanted::UpdateWantedLevel, PATCH_JUMP);
InjectHook(0x4AD9F0, &CWanted::RegisterCrime, PATCH_JUMP);
InjectHook(0x4ADA10, &CWanted::RegisterCrime_Immediately, PATCH_JUMP);
InjectHook(0x4ADA50, &CWanted::SetWantedLevel, PATCH_JUMP);
InjectHook(0x4ADAC0, &CWanted::SetWantedLevelNoDrop, PATCH_JUMP);
InjectHook(0x4ADAE0, &CWanted::SetMaximumWantedLevel, PATCH_JUMP);
InjectHook(0x4ADBA0, &CWanted::AreSwatRequired, PATCH_JUMP);
InjectHook(0x4ADBC0, &CWanted::AreFbiRequired, PATCH_JUMP);
InjectHook(0x4ADBE0, &CWanted::AreArmyRequired, PATCH_JUMP);
InjectHook(0x4ADC00, &CWanted::NumOfHelisRequired, PATCH_JUMP);
InjectHook(0x4ADC40, &CWanted::ResetPolicePursuit, PATCH_JUMP);
InjectHook(0x4ADD00, &CWanted::WorkOutPolicePresence, PATCH_JUMP);
InjectHook(0x4ADF20, &CWanted::ClearQdCrimes, PATCH_JUMP);
InjectHook(0x4ADFD0, &CWanted::AddCrimeToQ, PATCH_JUMP);
InjectHook(0x4AE090, &CWanted::UpdateCrimesQ, PATCH_JUMP);
InjectHook(0x4AE110, &CWanted::ReportCrimeNow, PATCH_JUMP);
ENDPATCHES

View File

@ -60,8 +60,8 @@ public:
CCrimeBeingQd m_aCrimes[16]; CCrimeBeingQd m_aCrimes[16];
CCopPed *m_pCops[10]; CCopPed *m_pCops[10];
static int32 &MaximumWantedLevel; static int32 MaximumWantedLevel;
static int32 &nMaximumWantedLevel; static int32 nMaximumWantedLevel;
public: public:
void Initialise(); void Initialise();

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More