Fixed Inconsisent Casing In Some Classes (#27)

This commit is contained in:
tyackman 2024-07-15 20:59:37 -05:00 committed by GitHub
parent 9ef64d8529
commit 7c78535a48
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
12 changed files with 81 additions and 80 deletions

View File

@ -6,8 +6,8 @@ namespace rage
class fwExtensibleBase : public fwRefAwareBase
{
public:
void* m_extension_container; // 0x0010
void* m_extensible_unk; // 0x0018
void* m_ExtensionContainer; // 0x0010
void* m_ExtensibleUnk; // 0x0018
}; //Size: 0x0020
static_assert(sizeof(fwExtensibleBase) == 0x20);
}

View File

@ -6,6 +6,6 @@ namespace rage
class fwRefAwareBaseImpl : public T
{
private:
void *m_ref; // 0x08
void *m_Ref; // 0x08
};
}

View File

@ -76,7 +76,7 @@ public:
}
private:
uint32_t m_map_size;
uint32_t m_MapSize;
};
class pgBaseRefCounted : public pgBase {
@ -86,44 +86,44 @@ public:
class pgBaseMetaDataType {
public:
static pgBaseMetaDataType* m_first;
static pgBaseMetaDataType* m_First;
pgBaseMetaDataType(uint32_t id, uintptr_t value)
: m_id(id), m_value(value), m_next(nullptr) {
if (!m_first) {
m_first = this;
: m_Id(id), m_Value(value), m_Next(nullptr) {
if (!m_First) {
m_First = this;
}
}
~pgBaseMetaDataType() {
if (m_first == this) {
m_first = m_next;
if (m_First == this) {
m_First = m_Next;
} else {
pgBaseMetaDataType* current = m_first;
while (current && current->m_next != this) {
current = current->m_next;
pgBaseMetaDataType* current = m_First;
while (current && current->m_Next != this) {
current = current->m_Next;
}
if (current) {
current->m_next = m_next;
current->m_Next = m_Next;
}
}
}
static pgBaseMetaDataType* Lookup(uint32_t id) {
pgBaseMetaDataType* current = m_first;
pgBaseMetaDataType* current = m_First;
while (current != nullptr) {
if (current->m_id == id) {
if (current->m_Id == id) {
return current;
}
current = current->m_next;
current = current->m_Next;
}
return nullptr;
}
private:
uint32_t m_id;
uintptr_t m_value;
pgBaseMetaDataType* m_next;
uint32_t m_Id;
uintptr_t m_Value;
pgBaseMetaDataType* m_Next;
};
}

View File

@ -12,6 +12,6 @@ public:
virtual bool IsEventScriptCommand() { return false; }
virtual bool ExtractData(void* data, int size) { return false; }
char m_pad[0x58];
char m_Pad[0x58];
};
static_assert(sizeof(CEvent) == 0x60);

View File

@ -4,19 +4,20 @@
class CGadgetData
{
public:
uint32_t m_type;
uint8_t m_data[0xF3];
uint32_t m_Type;
uint8_t m_Data[0xF3];
};
static_assert(sizeof(CGadgetData) == 0xF8);
class alignas(16) CVehicleGadgetNodeData
// TODO: Fix this
class CVehicleGadgetDataNode
{
public:
bool m_has_position;
bool m_HasPosition;
char pad_0001[15];
float m_position[4];
uint32_t m_num_gadgets;
float m_Position[4];
uint32_t m_NumGadgets;
char pad_0002[12];
CGadgetData m_gadgets[2];
CGadgetData m_Gadgets[2];
};
static_assert(sizeof(CVehicleGadgetNodeData) == 0x220);
static_assert(sizeof(CVehicleGadgetDataNode) == 0x220);

View File

@ -12,41 +12,41 @@ namespace rage
{
public:
atArray() :
m_data(nullptr),
m_size(0),
m_count(0)
m_Data(nullptr),
m_Size(0),
m_Count(0)
{
}
T* begin() const
{
return &m_data[0];
return &m_Data[0];
}
T* end() const
{
return &m_data[m_size];
return &m_Data[m_Size];
}
T* data() const
{
return m_data;
return m_Data;
}
std::uint16_t size() const
{
return m_size;
return m_Size;
}
std::uint16_t count() const
{
return m_count;
return m_Count;
}
T& operator[](std::uint16_t index) const
{
return m_data[index];
return m_Data[index];
}
bool contains(T comparator)
@ -62,9 +62,9 @@ namespace rage
}
private:
T* m_data;
std::uint16_t m_size;
std::uint16_t m_count;
T* m_Data;
std::uint16_t m_Size;
std::uint16_t m_Count;
};
static_assert(sizeof(rage::atArray<std::uint32_t>) == 0x10, "rage::atArray is not properly sized");
#pragma pack(pop)

View File

@ -6,17 +6,17 @@
namespace rage
{
using joaat_t = std::uint32_t;
inline constexpr char joaat_to_lower(char c)
inline constexpr char JoaatToLower(char c)
{
return c >= 'A' && c <= 'Z' ? c | 1 << 5 : c;
}
inline constexpr joaat_t joaat(const std::string_view str)
inline constexpr joaat_t Joaat(const std::string_view str)
{
joaat_t hash = 0;
for (auto c : str)
{
hash += joaat_to_lower(c);
hash += JoaatToLower(c);
hash += (hash << 10);
hash ^= (hash >> 6);
}

View File

@ -8,29 +8,29 @@ namespace rage
{
uint32_t unk0; // 0x00
uint32_t unk1; // 0x04
char* buffer; // 0x08
uint32_t curlen;// 0x10
uint32_t maxlen;// 0x14
char* m_Buffer; // 0x08
uint32_t m_Curlen;// 0x10
uint32_t m_Maxlen;// 0x14
uint32_t unk4; // 0x18
uint32_t flags; // 0x1C
uint8_t flags2; // 0x20
uint32_t m_Flags; // 0x1C
uint8_t m_Flags2; // 0x20
public:
rlJson(char* _buffer, uint32_t _length) :
buffer(_buffer),
maxlen(_length)
m_Buffer(_buffer),
m_Maxlen(_length)
{
unk0 = 0;
unk1 = 0;
curlen = 0;
m_Curlen = 0;
unk4 = 1;
flags = 0;
flags2 = 0;
m_Flags = 0;
m_Flags2 = 0;
}
inline char* GetBuffer() const
{
return buffer;
return m_Buffer;
}
};
static_assert(sizeof(rage::rlJson) == 0x24);

View File

@ -10,48 +10,48 @@ namespace rage
public:
constexpr void reset()
{
m_arg_count = 0;
m_data_count = 0;
m_ArgCount = 0;
m_DataCount = 0;
}
template <typename T>
constexpr void push_arg(T&& value)
constexpr void PushArg(T&& value)
{
static_assert(sizeof(T) <= sizeof(std::uint64_t));
*reinterpret_cast<std::remove_cv_t<std::remove_reference_t<T>>*>(reinterpret_cast<std::uint64_t*>(m_args) + (m_arg_count++)) = std::forward<T>(value);
*reinterpret_cast<std::remove_cv_t<std::remove_reference_t<T>>*>(reinterpret_cast<std::uint64_t*>(m_Args) + (m_ArgCount++)) = std::forward<T>(value);
}
template <typename T>
constexpr T& get_arg(std::size_t index)
constexpr T& GetArg(std::size_t index)
{
static_assert(sizeof(T) <= sizeof(std::uint64_t));
return *reinterpret_cast<T*>(reinterpret_cast<std::uint64_t*>(m_args) + index);
return *reinterpret_cast<T*>(reinterpret_cast<std::uint64_t*>(m_Args) + index);
}
template <typename T>
constexpr void set_arg(std::size_t index, T&& value)
constexpr void SetArg(std::size_t index, T&& value)
{
static_assert(sizeof(T) <= sizeof(std::uint64_t));
*reinterpret_cast<std::remove_cv_t<std::remove_reference_t<T>>*>(reinterpret_cast<std::uint64_t*>(m_args) + index) = std::forward<T>(value);
*reinterpret_cast<std::remove_cv_t<std::remove_reference_t<T>>*>(reinterpret_cast<std::uint64_t*>(m_Args) + index) = std::forward<T>(value);
}
template <typename T>
constexpr T* get_return_value()
constexpr T* GetReturnValue()
{
return reinterpret_cast<T*>(m_return_value);
return reinterpret_cast<T*>(m_ReturnValue);
}
template <typename T>
constexpr void set_return_value(T&& value)
constexpr void SetReturnValue(T&& value)
{
*reinterpret_cast<std::remove_cv_t<std::remove_reference_t<T>>*>(m_return_value) = std::forward<T>(value);
*reinterpret_cast<std::remove_cv_t<std::remove_reference_t<T>>*>(m_ReturnValue) = std::forward<T>(value);
}
protected:
void* m_return_value;
std::uint32_t m_arg_count;
void* m_args;
std::int32_t m_data_count;
std::uint32_t m_data[48];
void* m_ReturnValue;
std::uint32_t m_ArgCount;
void* m_Args;
std::int32_t m_DataCount;
std::uint32_t m_Data[48];
};
static_assert(sizeof(scrNativeCallContext) == 0xE0);

View File

@ -30,7 +30,7 @@ public:
char m_Breakpoints[0x0C]; // 0x74 This is an atMap, which we don't have the
// class for ATM.
bool is_valid() const { return m_CodeSize != 0; }
bool IsValid() const { return m_CodeSize != 0; }
std::uint32_t GetNumCodePages() const { return (m_CodeSize + 0x3FFF) >> 14; }

View File

@ -67,7 +67,7 @@ namespace rage
return this->x != other.x || this->y != other.y || this->z != other.z;
}
std::string to_string() const
std::string ToString() const
{
std::stringstream ss;
ss << *this;

View File

@ -5,11 +5,11 @@ class CNetGamePlayer;
class CScriptParticipant
{
public:
char pad_0000[16]; // 0x0000
class CNetGamePlayer *m_net_game_player; // 0x0010
char pad_0018[2]; // 0x0018
int16_t m_participant_index; // 0x001A
char pad_001C[12]; // 0x001C
char m_Pad[16]; // 0x0000
class CNetGamePlayer *m_NetGamePlayer; // 0x0010
char m_Pad2[2]; // 0x0018
int16_t m_ParticipantIndex; // 0x001A
char m_Pad3[12]; // 0x001C
};
static_assert(sizeof(CScriptParticipant) == 0x28);
@ -77,7 +77,7 @@ public:
if (!m_Host)
return nullptr;
return m_Host->m_net_game_player;
return m_Host->m_NetGamePlayer;
}
};
static_assert(sizeof(rage::scriptHandlerNetComponent) == 0x170);