minor DRG compression fix.

This commit is contained in:
morkt 2014-08-24 08:42:38 +04:00
parent a9228c7534
commit 2420cfa07c

View File

@ -369,14 +369,6 @@ namespace GameRes.Formats.DRS
WindowPosition pos = new WindowPosition { Offset = 0, Length = 0 }; WindowPosition pos = new WindowPosition { Offset = 0, Length = 0 };
if (win_begin == win_end) if (win_begin == win_end)
return pos; return pos;
if (m_input[win_end-1] == m_input[buf_begin])
{
pos.Offset = 1;
var match_end = Mismatch (buf_begin+1, buf_end, win_end);
pos.Length = (ushort)(match_end - (win_end-1));
if (MaxMatchSize == pos.Length)
return pos;
}
SortedSet<int> found; SortedSet<int> found;
if (m_dict.TryGetValue (m_input[buf_begin], out found)) if (m_dict.TryGetValue (m_input[buf_begin], out found))
{ {
@ -389,7 +381,7 @@ namespace GameRes.Formats.DRS
{ {
pos.Offset = (ushort)distance; pos.Offset = (ushort)distance;
pos.Length = (ushort)weight; pos.Length = (ushort)weight;
if (MaxMatchSize == weight && distance < 0x100) if (MaxMatchSize == weight)
break; break;
} }
} }