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() {}
static void Destroy(T){};
virtual MxBool Compare(T, T) { return 0; }
virtual MxS8 Compare(T, T) { return 0; }
protected:
MxU32 m_count; // +0x8

View File

@ -61,14 +61,14 @@ class MxHashTable : protected MxCollection<T> {
MxHashTableNode<T>** m_slots; // +0x10
MxU32 m_numSlots; // +0x14
MxU32 m_autoResizeRatio;
HashTableOpt m_resizeOption; // +0x1c
MxU32 m_autoResizeRatio; // +0x18
HashTableOpt m_resizeOption; // +0x1c
// 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
// did it, but a simple cast in either direction doesn't match.
union {
MxU32 m_increaseAmount;
double m_increaseFactor;
MxU32 m_increaseAmount; // +0x20
double m_increaseFactor; // +0x20
};
};

View File

@ -18,7 +18,7 @@ class MxString : public MxCore {
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; }
private:

View File

@ -1,7 +1,7 @@
#include "mxvariabletable.h"
// 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());
}

View File

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