isle: match Isle::Tick and FindExistingInstance (#32)

* match Isle::Tick and FindExistingInstance

* add offset comments

* inline Isle::Tick

* move inline MxDSObject, remove mx.cpp
This commit is contained in:
Christian Semmler
2023-06-22 00:18:37 +02:00
committed by GitHub
parent 4d531d1de5
commit fa8e4523bd
9 changed files with 157 additions and 225 deletions

View File

@@ -6,14 +6,11 @@
// OFFSET: LEGO1 0x100bf6a0
MxDSObject::MxDSObject()
{
// The following code yields 100% matching assembly if m_unk24 is declared as (signed) short.
// However, in other areas m_unk24 (notably, ISLE.EXE) is treated as unsigned short.
// Since we don't have a proper solution yet, we are using a union to work around this discrepancy.
this->m_unk0c = 0;
this->m_unk10 = 0;
this->m_unk14 = 0;
this->m_name = NULL;
this->m_unk24signed = -1;
this->m_unk24 = -1;
this->m_unk1c = -1;
this->m_unk28 = 0;
}

View File

@@ -15,7 +15,7 @@ public:
inline int GetUnknown1c() { return this->m_unk1c; }
inline void SetUnknown1c(int p_unk1c) { this->m_unk1c = p_unk1c; }
inline void SetUnknown24(unsigned short p_unk24) { this->m_unk24 = p_unk24; }
inline void SetUnknown24(short p_unk24) { this->m_unk24 = p_unk24; }
void SetAtomId(MxAtomId p_atomId);
@@ -27,13 +27,7 @@ private:
char *m_name;
int m_unk1c;
MxAtomId m_atomId;
// So far, implementing MxDSObject::MxDSObject correctly required that m_unk24 is declared a (signed) short.
// Most of the other game's code appears to treat it as unsigned short, however.
// This union is a workaround until we have figured this out.
union {
unsigned short m_unk24;
short m_unk24signed;
};
short m_unk24;
unsigned short m_unk26;
int m_unk28;
};