Beispiel #1
0
        internal static unsafe MpqBlockTable FromMemory(uint* table, ushort* highTable, long tableLength, out uint fileCount)
        {
            var entries = new MpqBlockEntry[tableLength];

            fileCount = 0;

            if (highTable == null)
                for (int i = 0; i < entries.Length; i++) // Fill MpqHashTable object
                    entries[i] = new MpqBlockEntry(*table++, *table++, *table++, *table++, ref fileCount);
            else
                for (int i = 0; i < entries.Length; i++) // Fill MpqHashTable object
                    entries[i] = new MpqBlockEntry(*table++ | ((long)*highTable++ << 32), *table++, *table++, *table++, ref fileCount);

            return new MpqBlockTable(entries);
        }
Beispiel #2
0
        internal static unsafe MpqBlockTable FromMemory(uint *table, ushort *highTable, long tableLength, out uint fileCount)
        {
            var entries = new MpqBlockEntry[tableLength];

            fileCount = 0;

            if (highTable == null)
            {
                for (int i = 0; i < entries.Length; i++)                 // Fill MpqHashTable object
                {
                    entries[i] = new MpqBlockEntry(*table++, *table++, *table++, *table++, ref fileCount);
                }
            }
            else
            {
                for (int i = 0; i < entries.Length; i++)                 // Fill MpqHashTable object
                {
                    entries[i] = new MpqBlockEntry(*table++ | ((long)*highTable++ << 32), *table++, *table++, *table++, ref fileCount);
                }
            }

            return(new MpqBlockTable(entries));
        }
Beispiel #3
0
 private MpqBlockTable(MpqBlockEntry[] entries)
 {
     this.Entries = entries;
 }