private static EXTSST CreateEXTSST(SST sst, int sstOffset)
        {
            EXTSST extSST = new EXTSST();
            extSST.NumStrings = 8;

            int counter = 0;
            int totalLength = sstOffset + 0x0C;
            int relativeLength = 0x0C;
            foreach (string text in sst.StringList)
            {
                int stringLength = Record.GetStringDataLength(text);
                if (relativeLength + stringLength > Record.MaxContentLength + 4)
                {
                    totalLength += 4;
                    relativeLength = 4;
                }
                if (counter == 0)
                {
                    StringOffset stringOffset = new StringOffset();
                    stringOffset.AbsolutePosition = (uint)totalLength;
                    stringOffset.RelativePosition = (ushort)relativeLength;
                    extSST.Offsets.Add(stringOffset);
                }
                counter++;
                if (counter == extSST.NumStrings)
                {
                    counter = 0;
                }
                totalLength += stringLength;
                relativeLength += stringLength;
            }

            return extSST;
        }
예제 #2
0
        private static EXTSST CreateEXTSST(SST sst, int sstOffset)
        {
            EXTSST extSST = new EXTSST();

            extSST.NumStrings = 8;

            int counter        = 0;
            int totalLength    = sstOffset + 0x0C;
            int relativeLength = 0x0C;

            foreach (string text in sst.StringList)
            {
                int stringLength = Record.GetStringDataLength(text);
                if (relativeLength + stringLength > Record.MaxContentLength + 4)
                {
                    totalLength   += 4;
                    relativeLength = 4;
                }
                if (counter == 0)
                {
                    StringOffset stringOffset = new StringOffset();
                    stringOffset.AbsolutePosition = (uint)totalLength;
                    stringOffset.RelativePosition = (ushort)relativeLength;
                    extSST.Offsets.Add(stringOffset);
                }
                counter++;
                if (counter == extSST.NumStrings)
                {
                    counter = 0;
                }
                totalLength    += stringLength;
                relativeLength += stringLength;
            }

            return(extSST);
        }