Script VM classes (#60)

* feat(Script): Ported BBv2 script classes
* fix: Change hard tab indents to 4 width space indents
This commit is contained in:
Yimura
2022-11-08 22:11:50 +01:00
committed by GitHub
parent 12919a46ff
commit d81f392e61
64 changed files with 1963 additions and 1320 deletions
+8 -8
View File
@@ -7,15 +7,15 @@
class CNavigation
{
public:
char pad_0000[16]; //0x0000
class rage::phArchetypeDamp* m_damp; //0x0010
char pad_0018[8]; //0x0018
rage::fmatrix44 m_transformation_matrix;
char pad_0000[16]; //0x0000
class rage::phArchetypeDamp* m_damp; //0x0010
char pad_0018[8]; //0x0018
rage::fmatrix44 m_transformation_matrix;
rage::fvector3* get_position()
{
return reinterpret_cast<rage::fvector3*>(&m_transformation_matrix.rows[3]);
}
rage::fvector3* get_position()
{
return reinterpret_cast<rage::fvector3*>(&m_transformation_matrix.rows[3]);
}
}; //Size: 0x0060
static_assert(sizeof(CNavigation) == 0x60);
#pragma pack(pop)
+11 -11
View File
@@ -5,10 +5,10 @@
class HashNode
{
public:
int32_t m_hash; //0x0000
uint16_t m_idx; //0x0004
char pad_0006[2]; //0x0006
HashNode* m_next; //0x0008
int32_t m_hash; //0x0000
uint16_t m_idx; //0x0004
char pad_0006[2]; //0x0006
HashNode* m_next; //0x0008
}; //Size: 0x0010
static_assert(sizeof(HashNode) == 0x10);
@@ -16,13 +16,13 @@ template<typename T>
class HashTable
{
public:
T* m_data; //0x0000
uint16_t m_size; //0x0008
char pad_000A[14]; //0x000A
uint64_t m_item_size; //0x0018
char pad_0020[64]; //0x0020
HashNode** m_lookup_table; //0x0060
uint16_t m_lookup_key; //0x0068
T* m_data; //0x0000
uint16_t m_size; //0x0008
char pad_000A[14]; //0x000A
uint64_t m_item_size; //0x0018
char pad_0020[64]; //0x0020
HashNode** m_lookup_table; //0x0060
uint16_t m_lookup_key; //0x0068
}; //Size: 0x006A
// static_assert(sizeof(HashTable<void*>) == 0x6A); // compiler gives assert error without telling me what the problem is, the class is correct though.
#pragma pack(pop)
+4 -4
View File
@@ -4,10 +4,10 @@ namespace rage
{
class datBase
{
public:
virtual ~datBase() = default;
}; //Size: 0x0008
{
public:
virtual ~datBase() = default;
}; //Size: 0x0008
static_assert(sizeof(datBase) == 0x8);
}
+14 -14
View File
@@ -9,23 +9,23 @@
namespace rage
{
class fwExtensibleBase : public fwRefAwareBase
{
public:
virtual bool is_of_type(std::uint32_t hash) = 0;
virtual uint32_t const &get_type() = 0;
{
public:
virtual bool is_of_type(std::uint32_t hash) = 0;
virtual uint32_t const &get_type() = 0;
fwExtensionContainer* m_extension_container; // 0x0010
void *m_extensible_unk; // 0x0018
fwExtensionContainer* m_extension_container; // 0x0010
void *m_extensible_unk; // 0x0018
template <typename T>
bool is_of_type()
{
static auto name = (typeid(T).name()) + 6; // Skip "class "
static auto name_hash = joaat(name);
template <typename T>
bool is_of_type()
{
static auto name = (typeid(T).name()) + 6; // Skip "class "
static auto name_hash = joaat(name);
return is_of_type(name_hash);
}
}; //Size: 0x0020
return is_of_type(name_hash);
}
}; //Size: 0x0020
static_assert(sizeof(fwExtensibleBase) == 0x20);
}
+5 -5
View File
@@ -6,11 +6,11 @@ namespace rage
{
class fwExtensionContainer
{
public:
fwExtension *m_entry; //0x0000
fwExtensionContainer* m_next; //0x0008
}; //Size: 0x0010
{
public:
fwExtension *m_entry; //0x0000
fwExtensionContainer* m_next; //0x0008
}; //Size: 0x0010
static_assert(sizeof(fwExtensionContainer) == 0x10);
}
+2 -2
View File
@@ -7,8 +7,8 @@ namespace rage
{
class fwRefAwareBase : public fwRefAwareBaseImpl<datBase>
{
};
{
};
static_assert(sizeof(fwRefAwareBase) == 0x10);
}
+5 -5
View File
@@ -4,10 +4,10 @@ namespace rage
{
template <typename T>
class fwRefAwareBaseImpl : public T
{
private:
void *m_ref; // 0x08
};
class fwRefAwareBaseImpl : public T
{
private:
void *m_ref; // 0x08
};
}
+7 -7
View File
@@ -4,14 +4,14 @@ namespace rage
{
class pgBase
{
public:
virtual ~pgBase() = default;
virtual int return_zero() = 0;
virtual void error() = 0;
{
public:
virtual ~pgBase() = default;
virtual int return_zero() = 0;
virtual void error() = 0;
void *unk_0000; // 0x0000
}; //Size: 0x0008
void *unk_0000; // 0x0000
}; //Size: 0x0008
static_assert(sizeof(pgBase) == 0x10);
}
+20 -22
View File
@@ -4,28 +4,26 @@
namespace rage
{
class phArchetype
{
public:
char pad_0000[32]; //0x0000
class phBound* m_bound; //0x0020
char pad_0028[16]; //0x0028
}; //Size: 0x0038
static_assert(sizeof(phArchetype) == 0x38);
class phArchetype
{
char pad_0000[32]; //0x0000
class phBound* m_bound; //0x0020
char pad_0028[16]; //0x0028
}; //Size: 0x0038
static_assert(sizeof(phArchetype) == 0x38);
class phArchetypePhys : public phArchetype
{
public:
char pad_0038[28]; //0x0028
float m_water_collision; //0x0054
char pad_0058[40]; //0x0058
}; //Size: 0x0080
static_assert(sizeof(phArchetypePhys) == 0x80);
class phArchetypePhys : public phArchetype
{
char pad_0038[28]; //0x0028
float m_water_collision; //0x0054
char pad_0058[40]; //0x0058
}; //Size: 0x0080
static_assert(sizeof(phArchetypePhys) == 0x80);
class phArchetypeDamp : public phArchetypePhys
{
public:
char pad_0080[96]; //0x0080
}; //Size: 0x00E0
static_assert(sizeof(phArchetypeDamp) == 0xE0);
class phArchetypeDamp : public phArchetypePhys
{
public:
char pad_0080[96]; //0x0080
}; //Size: 0x00E0
static_assert(sizeof(phArchetypeDamp) == 0xE0);
}
+8 -8
View File
@@ -5,13 +5,13 @@
namespace rage
{
#pragma pack(push,1)
class phBoundCapsule : public phBound
{
public:
float m_capsule_half_height;
uint64_t unk_0074;
uint32_t unk_007C;
}; //Size: 0x0080
static_assert(sizeof(phBoundCapsule) == 0x80);
class phBoundCapsule : public phBound
{
public:
float m_capsule_half_height;
uint64_t unk_0074;
uint32_t unk_007C;
}; //Size: 0x0080
static_assert(sizeof(phBoundCapsule) == 0x80);
#pragma pack(pop)
}
+15 -15
View File
@@ -7,20 +7,20 @@
namespace rage
{
#pragma pack(push,8)
class phBoundComposite : public phBound
{
public:
class phBound** m_bounds; //0x0070
fmatrix34* m_current_matrices; //0x0078
fmatrix34* m_last_matrices; //0x0080
fvector3* unk_0088; //0x0088
uint32_t* m_type_and_include_flags; //0x0090
uint32_t* m_owned_type_and_include_flags; //0x0098
uint16_t m_max_num_bounds; //0x00A0
uint16_t m_num_bounds; //0x00A2
char pad_00A4[4]; //0x00A4
void* unk_00A8; //0x00A8
}; //Size: 0x00B0
static_assert(sizeof(phBoundComposite) == 0xB0);
class phBoundComposite : public phBound
{
public:
class phBound** m_bounds; //0x0070
fmatrix34* m_current_matrices; //0x0078
fmatrix34* m_last_matrices; //0x0080
fvector3* unk_0088; //0x0088
uint32_t* m_type_and_include_flags; //0x0090
uint32_t* m_owned_type_and_include_flags; //0x0098
uint16_t m_max_num_bounds; //0x00A0
uint16_t m_num_bounds; //0x00A2
char pad_00A4[4]; //0x00A4
void* unk_00A8; //0x00A8
}; //Size: 0x00B0
static_assert(sizeof(phBoundComposite) == 0xB0);
#pragma pack(pop)
}