Use MxS8 for Compare return type

This commit is contained in:
disinvite 2023-11-12 19:13:47 -05:00
parent c970d08557
commit 6c914e0700
5 changed files with 9 additions and 9 deletions

View File

@ -15,7 +15,7 @@ class MxCollection : public MxCore {
virtual ~MxCollection() {} virtual ~MxCollection() {}
static void Destroy(T){}; static void Destroy(T){};
virtual MxBool Compare(T, T) { return 0; } virtual MxS8 Compare(T, T) { return 0; }
protected: protected:
MxU32 m_count; // +0x8 MxU32 m_count; // +0x8

View File

@ -61,14 +61,14 @@ class MxHashTable : protected MxCollection<T> {
MxHashTableNode<T>** m_slots; // +0x10 MxHashTableNode<T>** m_slots; // +0x10
MxU32 m_numSlots; // +0x14 MxU32 m_numSlots; // +0x14
MxU32 m_autoResizeRatio; MxU32 m_autoResizeRatio; // +0x18
HashTableOpt m_resizeOption; // +0x1c HashTableOpt m_resizeOption; // +0x1c
// FIXME: or FIXME? This qword is used as an integer or double depending // FIXME: or FIXME? This qword is used as an integer or double depending
// on the value of m_resizeOption. Hard to say whether this is how the devs // on the value of m_resizeOption. Hard to say whether this is how the devs
// did it, but a simple cast in either direction doesn't match. // did it, but a simple cast in either direction doesn't match.
union { union {
MxU32 m_increaseAmount; MxU32 m_increaseAmount; // +0x20
double m_increaseFactor; double m_increaseFactor; // +0x20
}; };
}; };

View File

@ -18,7 +18,7 @@ class MxString : public MxCore {
MxString operator+(const char*); MxString operator+(const char*);
MxString& operator+=(const char*); MxString& operator+=(const char*);
inline MxBool Compare(const MxString& p_str) const { return strcmp(m_data, p_str.m_data); } inline MxS8 Compare(const MxString& p_str) const { return strcmp(m_data, p_str.m_data); }
inline const char* GetData() const { return m_data; } inline const char* GetData() const { return m_data; }
private: private:

View File

@ -1,7 +1,7 @@
#include "mxvariabletable.h" #include "mxvariabletable.h"
// OFFSET: LEGO1 0x100b7330 // OFFSET: LEGO1 0x100b7330
MxBool MxVariableTable::Compare(MxVariable* p_var0, MxVariable* p_var1) MxS8 MxVariableTable::Compare(MxVariable* p_var0, MxVariable* p_var1)
{ {
return p_var0->GetKey()->Compare(*p_var1->GetKey()); return p_var0->GetKey()->Compare(*p_var1->GetKey());
} }

View File

@ -17,8 +17,8 @@ class MxVariableTable : public MxHashTable<MxVariable*> {
// OFFSET: LEGO1 0x100afdb0 // OFFSET: LEGO1 0x100afdb0
static void Destroy(MxVariable* p_obj) { p_obj->Destroy(); } static void Destroy(MxVariable* p_obj) { p_obj->Destroy(); }
virtual MxBool Compare(MxVariable*, MxVariable*) override; // +0x14 virtual MxS8 Compare(MxVariable*, MxVariable*) override; // +0x14
virtual MxU32 Hash(MxVariable*) override; // +0x18 virtual MxU32 Hash(MxVariable*) override; // +0x18
}; };
// OFFSET: LEGO1 0x100afcd0 TEMPLATE // OFFSET: LEGO1 0x100afcd0 TEMPLATE