예제 #1
0
        public ListTables(byte[] tableStream, int lstOffset, int lfoOffset)
        {
            // get the list data
            int length = LittleEndian.GetShort(tableStream, lstOffset);

            lstOffset += LittleEndianConsts.SHORT_SIZE;
            int levelOffset = lstOffset + (length * LIST_DATA_SIZE);

            for (int x = 0; x < length; x++)
            {
                ListData lst = new ListData(tableStream, lstOffset);
                _listMap.Add(lst.GetLsid(), lst);
                lstOffset += LIST_DATA_SIZE;

                int num = lst.numLevels();
                for (int y = 0; y < num; y++)
                {
                    ListLevel lvl = new ListLevel(tableStream, levelOffset);
                    lst.SetLevel(y, lvl);
                    levelOffset += lvl.GetSizeInBytes();
                }
            }

            // now get the list format overrides. The size is an int unlike the LST size
            length     = LittleEndian.GetInt(tableStream, lfoOffset);
            lfoOffset += LittleEndianConsts.INT_SIZE;
            int lfolvlOffset = lfoOffset + (LIST_FORMAT_OVERRIDE_SIZE * length);

            for (int x = 0; x < length; x++)
            {
                ListFormatOverride lfo = new ListFormatOverride(tableStream, lfoOffset);
                lfoOffset += LIST_FORMAT_OVERRIDE_SIZE;
                int num = lfo.numOverrides();
                for (int y = 0; y < num; y++)
                {
                    while (tableStream[lfolvlOffset] == 255)
                    {
                        lfolvlOffset++;
                    }
                    ListFormatOverrideLevel lfolvl = new ListFormatOverrideLevel(tableStream, lfolvlOffset);
                    lfo.SetOverride(y, lfolvl);
                    lfolvlOffset += lfolvl.GetSizeInBytes();
                }
                _overrideList.Add(lfo);
            }
        }
예제 #2
0
        public ListTables(byte[] tableStream, int lstOffset, int lfoOffset)
        {
            // get the list data
            int length = LittleEndian.GetShort(tableStream, lstOffset);
            lstOffset += LittleEndianConsts.SHORT_SIZE;
            int levelOffset = lstOffset + (length * LIST_DATA_SIZE);

            for (int x = 0; x < length; x++)
            {
                ListData lst = new ListData(tableStream, lstOffset);
                _listMap.Add(lst.GetLsid(), lst);
                lstOffset += LIST_DATA_SIZE;

                int num = lst.numLevels();
                for (int y = 0; y < num; y++)
                {
                    ListLevel lvl = new ListLevel(tableStream, levelOffset);
                    lst.SetLevel(y, lvl);
                    levelOffset += lvl.GetSizeInBytes();
                }
            }

            // now get the list format overrides. The size is an int unlike the LST size
            length = LittleEndian.GetInt(tableStream, lfoOffset);
            lfoOffset += LittleEndianConsts.INT_SIZE;
            int lfolvlOffset = lfoOffset + (LIST_FORMAT_OVERRIDE_SIZE * length);
            for (int x = 0; x < length; x++)
            {
                ListFormatOverride lfo = new ListFormatOverride(tableStream, lfoOffset);
                lfoOffset += LIST_FORMAT_OVERRIDE_SIZE;
                int num = lfo.numOverrides();
                for (int y = 0; y < num; y++)
                {
                    while (tableStream[lfolvlOffset] == 255)
                    {
                        lfolvlOffset++;
                    }
                    ListFormatOverrideLevel lfolvl = new ListFormatOverrideLevel(tableStream, lfolvlOffset);
                    lfo.SetOverride(y, lfolvl);
                    lfolvlOffset += lfolvl.GetSizeInBytes();
                }
                _overrideList.Add(lfo);
            }
        }