flags are actually bitflags.

This commit is contained in:
morkt 2015-12-23 09:39:51 +04:00
parent 5f3122fd04
commit ab0ef6f3c5

View File

@ -129,6 +129,8 @@ namespace GameRes.Formats.Marble
--remaining; --remaining;
bit = 0x80; bit = 0x80;
} }
if (remaining <= 0)
break;
if (0 == (ctl & bit)) if (0 == (ctl & bit))
{ {
m_output[dst++] = m_input.ReadByte(); m_output[dst++] = m_input.ReadByte();
@ -184,7 +186,7 @@ namespace GameRes.Formats.Marble
Binary.CopyOverlapped (m_output, dst-shift, dst, length); Binary.CopyOverlapped (m_output, dst-shift, dst, length);
dst += length; dst += length;
} }
if (m_flag != 0) if ((m_flag & 0x80) != 0)
{ {
for (int i = 3; i < m_output.Length; ++i) for (int i = 3; i < m_output.Length; ++i)
m_output[i] += m_output[i-3]; m_output[i] += m_output[i-3];