-
-
Notifications
You must be signed in to change notification settings - Fork 577
Expand file tree
/
Copy pathCFxSystemSA.h
More file actions
183 lines (156 loc) · 6.63 KB
/
Copy pathCFxSystemSA.h
File metadata and controls
183 lines (156 loc) · 6.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
/*****************************************************************************
*
* PROJECT: Multi Theft Auto v1.0
* LICENSE: See LICENSE in the top level directory
* FILE: game_sa/CFxSystemSA.h
* PURPOSE: Game effects interface
*
* Multi Theft Auto is available from https://www.multitheftauto.com/
*
*****************************************************************************/
#pragma once
#include <CVector.h>
#include <game/CFxSystem.h>
#include <game/RenderWare.h>
#define FUNC_FxSystem_c__PlayAndKill 0x4AA3D0
#define VAR_FxSystemUpdateCullDistMultiplier 0x4AB032
#define VAR_FxCreateParticleCullDistMultiplierA 0x4A4247
#define VAR_FxCreateParticleCullDistMultiplierB 0x4A4255
#define FX_SYSTEM_UPDATE_CULL_DIST_MULTIPLIER_DEFAULT (1 / 256.f)
#define FX_CREATE_PARTICLE_CULL_DIST_MULTIPLIER_DEFAULT (1 / 64.f)
class CAEFireAudioEntitySAInterface
{
public:
// this derives from CAEAudioEntity
// todo: reverse this structure and CAEAudioEntity
std::int32_t pad1[0x21];
void* audio; // 0x84 // TODO: Reverse what this __exactly__ is
};
static_assert(sizeof(CAEFireAudioEntitySAInterface) == 0x88, "Invalid size for CAEFireAudioEntitySAInterface");
// Internal SA Name: FxInfo_c
// nType is one of the eFxInfoType values (e.g. FX_INFO_COLOUR_DATA)
class FxInfoSAInterface
{
public:
void* vmt; // 0x00
uint16_t nType; // 0x04
};
constexpr uint16_t FX_INFO_COLOUR_DATA = 0x4001;
constexpr uint16_t FX_INFO_COLOURBRIGHT_DATA = 0x4400;
constexpr uint16_t FX_INFO_COLOURRANGE_DATA = 0x4100;
// Internal SA Name: FxInfoColour_c (FxInfo_c + an embedded FxInterpInfoU255_c)
// Holds ppChannelValues[channel][keyframe] for nNumChannels channels (4 = R, G, B, A) of
// nNumKeyframes keyframes each. Values are fixed-point, scaled by 1/256.
class FxInfoColorSAInterface : public FxInfoSAInterface
{
public:
void* pInterpInfoVmt; // 0x08
bool bLooped; // 0x0C
int8_t nNumKeyframes; // 0x0D
int8_t nNumChannels; // 0x0E
char pad; // 0x0F
uint16_t* pTimes; // 0x10
uint16_t** ppChannelValues; // 0x14
};
static_assert(sizeof(FxInfoColorSAInterface) == 0x18, "Invalid size for FxInfoColorSAInterface");
class CFxSystemBPSAInterface;
class CFxSystemSAInterface // Internal SA Name: FxSystem_c
{
public:
// Based upon ListItem_c
CFxSystemSAInterface* pPrevious; // 0x00
CFxSystemSAInterface* pNext; // 0x04
// Actual members
CFxSystemBPSAInterface* pBlueprint; // 0x08
RwMatrix* pmatUnknown; // 0x10
RwMatrix matPosition; // 0x0C
char cPlayStatus; // 0x50
char cUnknownFlag; // 0x51
char cConstTime; // 0x52
char pad; // 0x53
int unk2[2]; // 0x54
short sConstTimeMult; // 0x5C
short sRateMult; // 0x5E (This controls how often the effect is renewed)
short sTimeMult; // 0x60 (This controls how fast the effect plays)
char cFlags; // 0x62
char pad2; // 0x63
int unk3; // 0x64
CVector vecVelocity; // 0x68
void* pSphere; // 0x74
void** ppParticleEmitters; // 0x78 (Array of particle emitters, amount is defined by the blueprint)
CAEFireAudioEntitySAInterface audioEntity; // 0x7C
};
static_assert(sizeof(CFxSystemSAInterface) == 0x104, "Invalid size for CFxSystemSAInterface");
class CFxSystemSA : public CFxSystem
{
public:
CFxSystemSA(CFxSystemSAInterface* pInterface);
~CFxSystemSA();
void PlayAndKill();
void SetEffectSpeed(float fSpeed);
float GetEffectSpeed();
void SetEffectDensity(float fDensity);
float GetEffectDensity();
void GetPosition(CVector& vecPos);
void SetPosition(const CVector& vecPos);
void GetMatrix(CMatrix& matrix);
void SetMatrix(const CMatrix& matrix);
void SetDrawDistance(float fDrawDistance);
float GetDrawDistance();
bool HasCustomDrawDistance();
void* GetInterface() { return (void*)m_pInterface; }
static void StaticSetHooks();
static void SetPosition(CFxSystemSAInterface* fxSystem, const CVector& position);
protected:
CFxSystemSAInterface* m_pInterface;
float m_fDrawDistance;
};
class FxInfoManagerSAInterface
{
public:
uint32_t m_nNumInfos; // 0x00
FxInfoSAInterface** m_pInfos; // 0x04
uint8_t m_nFirstMovementInfo; // 0x08
uint8_t m_nFirstRenderInfo; // 0x09
};
static_assert(sizeof(FxInfoManagerSAInterface) == 0xC, "Invalid size for FxInfoManagerSAInterface");
class FxPrimBPSAInterface
{
public:
void* vtbl; // 0x00
uint8_t field_4; // 0x04
uint8_t m_nSrcBlendId; // 0x05
uint8_t m_nDstBlendId; // 0x06
uint8_t m_bAlphaOn; // 0x07
void* m_pCompressedInitialMatrix; // 0x08
RwTexture* m_apTextures[4]; // 0x0C
void* field_1C; // 0x1C
uint32_t particlesList[3]; // 0x20 -- List_c
FxInfoManagerSAInterface m_infoManager; // 0x2C
};
static_assert(sizeof(FxPrimBPSAInterface) == 0x38, "Invalid size for FxPrimBPSAInterface");
class CFxEmitterBPSAInterface : public FxPrimBPSAInterface
{
public:
uint16_t m_nLodStart; // 0x38
uint16_t m_nLodEnd; // 0x3A
bool m_bHasInfoFlatData; // 0x3C
bool m_bHasInfoHeatHazeData; // 0x3C
};
static_assert(sizeof(CFxEmitterBPSAInterface) == 0x40, "Invalid size for CFxEmitterBPSAInterface");
class CFxEmitterSAInterface
{
public:
void* vtbl; // 0x00
CFxEmitterBPSAInterface* pBlueprint; // 0x04
CFxSystemSAInterface* pOwner; // 0x08
// TODO the rest
};
// Internal SA Name: FxParticle_c
// A single particle instance, owned by an FxSystem_c and rendered via its FxEmitterBP_c.
class CFxParticleSAInterface
{
public:
uint8_t pad[0x28]; // 0x00
CFxSystemSAInterface* pSystem; // 0x28
};