Skip to content

Commit

Permalink
Fix TLK sorting when saving
Browse files Browse the repository at this point in the history
  • Loading branch information
Mgamerz committed May 3, 2020
1 parent d06c6ce commit 92b65bb
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Xml;
Expand All @@ -16,6 +17,7 @@ class HuffmanCompressionME2ME3
private List<HuffmanNode> _huffmanTree = new List<HuffmanNode>();
private Dictionary<char, BitArray> _huffmanCodes = new Dictionary<char, BitArray>();

[DebuggerDisplay("TLKEntry {StringID} {data}")]
public class TLKEntry : IComparable
{
public int StringID;
Expand Down Expand Up @@ -85,8 +87,7 @@ public void SaveToTlkFile(string fileName, List<TLKEntry> stringRefs = null)
File.Delete(fileName);
if (stringRefs != null)
{
_inputData = stringRefs;
_inputData.Sort();
_inputData = stringRefs.OrderBy(x => x.StringID).ToList();
PrepareHuffmanCoding();
}
/* converts Huffmann Tree to binary form */
Expand Down

0 comments on commit 92b65bb

Please sign in to comment.