mirror of
https://github.com/isledecomp/isle.git
synced 2025-10-23 00:14:22 +00:00
Match ParseExtra functions (#605)
* Match ParseExtra functions * Match MxStillPresenter::ParseExtra * Match remaining ParseExtra functions
This commit is contained in:

committed by
GitHub

parent
ff04b0ba5a
commit
49d6c88912
@@ -57,6 +57,12 @@ public:
|
||||
|
||||
void AppendData(MxU16 p_extraLength, const char* p_extraData);
|
||||
|
||||
inline void GetExtra(MxU16& p_extraLength, char*& p_extraData)
|
||||
{
|
||||
p_extraLength = m_extraLength;
|
||||
p_extraData = m_extraData;
|
||||
}
|
||||
|
||||
inline MxU32 GetFlags() { return m_flags; }
|
||||
inline void SetFlags(MxU32 p_flags) { m_flags = p_flags; }
|
||||
inline char* GetExtraData() { return m_extraData; }
|
||||
|
@@ -322,16 +322,16 @@ void MxWavePresenter::Enable(MxBool p_enable)
|
||||
// FUNCTION: LEGO1 0x100b23a0
|
||||
void MxWavePresenter::ParseExtra()
|
||||
{
|
||||
char extraCopy[512];
|
||||
|
||||
MxSoundPresenter::ParseExtra();
|
||||
*((MxU16*) &extraCopy[0]) = m_action->GetExtraLength();
|
||||
char* extraData = m_action->GetExtraData();
|
||||
|
||||
if (*((MxU16*) &extraCopy[0])) {
|
||||
MxU16 len = *((MxU16*) &extraCopy[0]);
|
||||
memcpy(extraCopy, extraData, len);
|
||||
extraCopy[len] = '\0';
|
||||
MxU16 extraLength;
|
||||
char* extraData;
|
||||
m_action->GetExtra(extraLength, extraData);
|
||||
|
||||
if (extraLength & MAXWORD) {
|
||||
char extraCopy[512];
|
||||
memcpy(extraCopy, extraData, extraLength & MAXWORD);
|
||||
extraCopy[extraLength & MAXWORD] = '\0';
|
||||
|
||||
char soundValue[512];
|
||||
if (KeyValueStringParse(soundValue, g_strSOUND, extraCopy)) {
|
||||
|
@@ -78,14 +78,15 @@ void MxPresenter::EndAction()
|
||||
void MxPresenter::ParseExtra()
|
||||
{
|
||||
MxAutoLocker lock(&m_criticalSection);
|
||||
MxU16 len = m_action->GetExtraLength();
|
||||
char* extraData = m_action->GetExtraData();
|
||||
|
||||
if (len) {
|
||||
// len &= MAXWORD;
|
||||
MxU16 extraLength;
|
||||
char* extraData;
|
||||
m_action->GetExtra(extraLength, extraData);
|
||||
|
||||
if (extraLength & MAXWORD) {
|
||||
char extraCopy[512];
|
||||
memcpy(extraCopy, extraData, len);
|
||||
extraCopy[len] = '\0';
|
||||
memcpy(extraCopy, extraData, extraLength & MAXWORD);
|
||||
extraCopy[extraLength & MAXWORD] = '\0';
|
||||
|
||||
char worldValue[512];
|
||||
if (KeyValueStringParse(worldValue, g_strWORLD, extraCopy)) {
|
||||
|
@@ -198,29 +198,27 @@ void MxStillPresenter::ParseExtra()
|
||||
SetBit3(TRUE);
|
||||
}
|
||||
|
||||
MxU32 len = m_action->GetExtraLength();
|
||||
MxU16 extraLength;
|
||||
char* extraData;
|
||||
m_action->GetExtra(extraLength, extraData);
|
||||
|
||||
if (len == 0) {
|
||||
return;
|
||||
}
|
||||
if (extraLength & MAXWORD) {
|
||||
char extraCopy[512];
|
||||
memcpy(extraCopy, extraData, extraLength & MAXWORD);
|
||||
extraCopy[extraLength & MAXWORD] = '\0';
|
||||
|
||||
len &= MAXWORD;
|
||||
|
||||
char buf[512];
|
||||
memcpy(buf, m_action->GetExtraData(), len);
|
||||
buf[len] = '\0';
|
||||
|
||||
char output[512];
|
||||
if (KeyValueStringParse(output, g_strVISIBILITY, buf)) {
|
||||
if (strcmpi(output, "FALSE") == 0) {
|
||||
Enable(FALSE);
|
||||
char output[512];
|
||||
if (KeyValueStringParse(output, g_strVISIBILITY, extraCopy)) {
|
||||
if (strcmpi(output, "FALSE") == 0) {
|
||||
Enable(FALSE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (KeyValueStringParse(output, g_strBmpIsmap, buf)) {
|
||||
SetBit4(TRUE);
|
||||
SetBit1(FALSE);
|
||||
SetBit2(FALSE);
|
||||
if (KeyValueStringParse(output, g_strBmpIsmap, extraCopy)) {
|
||||
SetBit4(TRUE);
|
||||
SetBit1(FALSE);
|
||||
SetBit2(FALSE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user