mirror of
https://github.com/isledecomp/isle.git
synced 2026-01-12 11:11:16 +00:00
use union hack
This commit is contained in:
parent
f7cbc4ba02
commit
cc49881c36
@ -8,20 +8,12 @@ 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.
|
||||
// this->m_unk0c = 0;
|
||||
// this->m_unk10 = 0;
|
||||
// this->m_unk14 = 0;
|
||||
// this->m_name = NULL;
|
||||
// this->m_unk24 = -1;
|
||||
// this->m_unk1c = -1;
|
||||
// this->m_unk28 = 0;
|
||||
|
||||
// Assembly not matching but m_unk24 is unsigned short (probably correct)
|
||||
// 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_unk24 = 0xFFFF;
|
||||
this->m_unk24signed = -1;
|
||||
this->m_unk1c = -1;
|
||||
this->m_unk28 = 0;
|
||||
}
|
||||
|
||||
@ -27,7 +27,13 @@ class MxDSObject : public MxCore
|
||||
char *m_name;
|
||||
int m_unk1c;
|
||||
MxAtomId m_atomId;
|
||||
unsigned short m_unk24;
|
||||
// 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;
|
||||
};
|
||||
unsigned short m_unk26;
|
||||
int m_unk28;
|
||||
};
|
||||
|
||||
Loading…
Reference in New Issue
Block a user