Skip to content

Commit

Permalink
Update IV
Browse files Browse the repository at this point in the history
  • Loading branch information
gennariarmando committed Nov 4, 2023
1 parent 076d687 commit 6033510
Show file tree
Hide file tree
Showing 151 changed files with 136,644 additions and 17 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ nbproject
vsproject
Makefile
output
DXSDK
generated/

### Eclipse ###
Expand Down
17 changes: 17 additions & 0 deletions plugin_IV/game_IV/CCamIdle.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
Plugin-SDK (Grand Theft Auto IV) source file
Authors: GTA Community. See more here
https://github.com/DK22Pac/plugin-sdk
Do not delete this comment block. Respect others' work!
*/
#include "CCamIdle.h"

static uint32_t CCam__ResetStatsAddr;
void CCamIdle::ResetStats(bool unused) {
plugin::CallMethodDyn(CCam__ResetStatsAddr, this, unused);
}

template<>
void plugin::InitPatterns<CCamIdle>() {
CCam__ResetStatsAddr = plugin::GetPattern("C7 81 ? ? ? ? ? ? ? ? C7 81 ? ? ? ? ? ? ? ? C7 81 ? ? ? ? ? ? ? ? C7 81 ? ? ? ? ? ? ? ? C7 81 ? ? ? ? ? ? ? ? C7 81 ? ? ? ? ? ? ? ? C7 81 ? ? ? ? ? ? ? ? 80 A1 ? ? ? ? ? 8B 81", 0);
}
18 changes: 18 additions & 0 deletions plugin_IV/game_IV/CCamIdle.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
Plugin-SDK (Grand Theft Auto IV) header file
Authors: GTA Community. See more here
https://github.com/DK22Pac/plugin-sdk
Do not delete this comment block. Respect others' work!
*/
#pragma once
#include "PluginBase.h"
#include "Rage.h"
#include "CCam.h"

class CCamIdle : CCam {
public:

public:
void ResetStats(bool unused);

};
4 changes: 2 additions & 2 deletions plugin_IV/game_IV/CEntity.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@ class CEntity : CVirtualBase {
void CleanUpOldReference(void* object);

public:
void Teleport(rage::Matrix44* mat, int32_t dontUpdatePhysicsMatrix, bool clearTasks) { plugin::CallVirtualMethod<1>(this, mat, dontUpdatePhysicsMatrix, clearTasks); }
void Teleport(rage::Vector4* pos, int32_t dontUpdatePhysicsMatrix, bool clearTasks) { plugin::CallVirtualMethod<2>(this, pos, dontUpdatePhysicsMatrix, clearTasks); }
void Teleport(rage::Matrix44* mat, int32_t dontUpdatePhysicsMatrix, bool immediately) { plugin::CallVirtualMethod<1>(this, mat, dontUpdatePhysicsMatrix, immediately); }
void Teleport(rage::Vector4* pos, int32_t dontUpdatePhysicsMatrix, bool immediately) { plugin::CallVirtualMethod<2>(this, pos, dontUpdatePhysicsMatrix, immediately); }
};

VALIDATE_SIZE(CEntity, 0x70);
2 changes: 1 addition & 1 deletion plugin_IV/game_IV/CPed.h
Original file line number Diff line number Diff line change
Expand Up @@ -300,8 +300,8 @@ class CPed : public CPhysical {
// Ped Flags 4
uint32_t m_bPedFlags4_1 : 1;
uint32_t m_bPedFlags4_2 : 1;
uint32_t m_bPedFlags4_3 : 1;
uint32_t m_bInVehicle : 1;
uint32_t m_bPedFlags4_4 : 1;
uint32_t m_bPedFlags4_5 : 1;
uint32_t m_bPedFlags4_6 : 1;
uint32_t m_bPedFlags4_7 : 1;
Expand Down
2 changes: 1 addition & 1 deletion plugin_IV/game_IV/Rage.h
Original file line number Diff line number Diff line change
Expand Up @@ -725,7 +725,7 @@ namespace rage {
}
};

Vector3 operator*(const Matrix44& mat, const Vector3& vec) {
static inline Vector3 operator*(const Matrix44& mat, const Vector3& vec) {
return Vector3(mat.right.x * vec.x + mat.up.x * vec.y + mat.at.x * vec.z + mat.pos.x,
mat.right.y * vec.x + mat.up.y * vec.y + mat.at.y * vec.z + mat.pos.y,
mat.right.z * vec.x + mat.up.z * vec.y + mat.at.z * vec.z + mat.pos.z);
Expand Down
4 changes: 2 additions & 2 deletions shared/Events.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ StdcallEvent <AddressList<0x45C2DB, H_CALL>, PRIORITY_AFTER, ArgPickNone, void()
ThiscallEvent <AddressList<0x45C20D, H_CALL>, PRIORITY_AFTER, ArgPickN<CPlayerPed*, 0>, void(CPlayerPed*)> plugin::Events::processPlayerPedEvent;
#endif
#ifdef GTAIV
CdeclEvent <AddressList<0xB1E6F5, H_CALL>, PRIORITY_AFTER, ArgPickNone, void()> plugin::Events::initGameEvent;
CdeclEvent <AddressList<0x5C12AD, H_CALL>, PRIORITY_AFTER, ArgPickNone, void(const char*)> plugin::Events::initGameEvent;
CdeclEvent <AddressList<0x5C2B7A, H_CALL>, PRIORITY_AFTER, ArgPickNone, void()> plugin::Events::gameProcessEvent;
CdeclEvent <AddressList<0x5A9107, H_CALL>, PRIORITY_AFTER, ArgPickNone, uint32_t()> plugin::Events::drawMenuEvent;
CdeclEvent <AddressList<0xB01893, H_CALL>, PRIORITY_AFTER, ArgPickNone, uint32_t()> plugin::Events::drawingEvent;
Expand All @@ -393,7 +393,7 @@ ThiscallEvent <AddressList<0xA3DAB0, H_CALL, 0xA3DB13, H_CALL>, PRIORITY_BEFORE,
template<>
void plugin::InitPatterns<CallingConventions>() {
#ifdef GTAIV
plugin::Events::initGameEvent.SetRefAddr(plugin::GetPattern("E8 ? ? ? ? E8 ? ? ? ? B9 ? ? ? ? E8 ? ? ? ? E8 ? ? ? ? 8B 0D ? ? ? ? E8", 0));
plugin::Events::initGameEvent.SetRefAddr(plugin::GetPattern("E8 ? ? ? ? 83 C4 04 E8 ? ? ? ? E8 ? ? ? ? E8 ? ? ? ? E8 ? ? ? ? E8 ? ? ? ? E8 ? ? ? ? E8 ? ? ? ? E8 ? ? ? ? E8 ? ? ? ? E8 ? ? ? ? E8", 0));
plugin::Events::gameProcessEvent.SetRefAddr(plugin::GetPattern("E8 ? ? ? ? 80 3D ? ? ? ? ? 74 09 C6 05", 0));
plugin::Events::drawMenuEvent.SetRefAddr(plugin::GetPattern("E8 ? ? ? ? 80 3D ? ? ? ? ? 74 23 A1 ? ? ? ? 83 F8 22", 0));
plugin::Events::drawingEvent.SetRefAddr(plugin::GetPattern("E8 ? ? ? ? E8 ? ? ? ? 83 3D ? ? ? ? ? 74 6B", 0));
Expand Down
2 changes: 1 addition & 1 deletion shared/Events.h
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ extern ThiscallEvent <AddressList<0x45C20D, H_CALL>, PRIORITY_AFTER, ArgPickN<CP
#ifdef GTAIV
class CBaseDC;
class CAutomobile;
extern CdeclEvent <AddressList<0xB1E6F5, H_CALL>, PRIORITY_AFTER, ArgPickNone, void()> initGameEvent;
extern CdeclEvent <AddressList<0x5C12AD, H_CALL>, PRIORITY_AFTER, ArgPickNone, void(const char*)> initGameEvent;
extern CdeclEvent <AddressList<0x5C2B7A, H_CALL>, PRIORITY_AFTER, ArgPickNone, void()> gameProcessEvent;
extern CdeclEvent <AddressList<0x5A9107, H_CALL>, PRIORITY_AFTER, ArgPickNone, uint32_t()> drawMenuEvent;
extern CdeclEvent <AddressList<0xB01893, H_CALL>, PRIORITY_AFTER, ArgPickNone, uint32_t()> drawingEvent;
Expand Down
Loading

0 comments on commit 6033510

Please sign in to comment.