mirror of
https://github.com/isledecomp/isle-portable.git
synced 2024-11-29 19:05:34 -05:00
MxDSAction::MergeFrom: match to 100% (#200)
* Minor accuracy improvement * Workaround for 100% match * Update mxdsaction.cpp
This commit is contained in:
parent
b7b0ac6ae7
commit
49ec7364c2
1 changed files with 7 additions and 3 deletions
|
@ -15,7 +15,7 @@ MxU16 g_unkSep = TWOCC(',', ' ');
|
||||||
// OFFSET: LEGO1 0x100ad810
|
// OFFSET: LEGO1 0x100ad810
|
||||||
MxDSAction::MxDSAction()
|
MxDSAction::MxDSAction()
|
||||||
{
|
{
|
||||||
this->m_flags = 32;
|
this->m_flags = MxDSAction::Flag_Enabled;
|
||||||
this->m_startTime = INT_MIN;
|
this->m_startTime = INT_MIN;
|
||||||
this->m_extraData = NULL;
|
this->m_extraData = NULL;
|
||||||
this->m_extraLength = 0;
|
this->m_extraLength = 0;
|
||||||
|
@ -153,7 +153,7 @@ void MxDSAction::MergeFrom(MxDSAction &p_dsAction)
|
||||||
if (p_dsAction.m_direction[1] != FLT_MAX)
|
if (p_dsAction.m_direction[1] != FLT_MAX)
|
||||||
this->m_direction[1] = p_dsAction.m_direction[1];
|
this->m_direction[1] = p_dsAction.m_direction[1];
|
||||||
if (p_dsAction.m_direction[2] != FLT_MAX)
|
if (p_dsAction.m_direction[2] != FLT_MAX)
|
||||||
this->m_direction[2] = p_dsAction.m_direction[2];
|
this->m_direction[2] = p_dsAction.m_up[2]; // This is correct
|
||||||
|
|
||||||
if (p_dsAction.m_up[0] != FLT_MAX)
|
if (p_dsAction.m_up[0] != FLT_MAX)
|
||||||
this->m_up[0] = p_dsAction.m_up[0];
|
this->m_up[0] = p_dsAction.m_up[0];
|
||||||
|
@ -162,9 +162,13 @@ void MxDSAction::MergeFrom(MxDSAction &p_dsAction)
|
||||||
if (p_dsAction.m_up[2] != FLT_MAX)
|
if (p_dsAction.m_up[2] != FLT_MAX)
|
||||||
this->m_up[2] = p_dsAction.m_up[2];
|
this->m_up[2] = p_dsAction.m_up[2];
|
||||||
|
|
||||||
// TODO
|
|
||||||
MxU16 extraLength = p_dsAction.m_extraLength;
|
MxU16 extraLength = p_dsAction.m_extraLength;
|
||||||
char *extraData = p_dsAction.m_extraData;
|
char *extraData = p_dsAction.m_extraData;
|
||||||
|
|
||||||
|
// Taking those references forces the compiler to move the values onto the stack.
|
||||||
|
// The original code most likely looked different, but this yields a 100% match.
|
||||||
|
MxU16 &_extraLength = extraLength;
|
||||||
|
char *&_extraData = extraData;
|
||||||
if (extraLength && extraData) {
|
if (extraLength && extraData) {
|
||||||
if (!this->m_extraData || !strncmp("XXX", this->m_extraData, 3)) {
|
if (!this->m_extraData || !strncmp("XXX", this->m_extraData, 3)) {
|
||||||
delete[] this->m_extraData;
|
delete[] this->m_extraData;
|
||||||
|
|
Loading…
Reference in a new issue