Beispiel #1
0
 public void RebuildNode(VoidPtr header, U8EntryNode node, ref U8Entry *entry, VoidPtr sTableStart, ref VoidPtr dataAddr, U8StringTable sTable, bool force)
 {
     entry->_type = (byte)((node is U8FolderNode) ? 1 : 0);
     entry->_stringOffset.Value = (int)sTable[node.Name] - (int)sTableStart;
     if (entry->_type == 1)
     {
         if (node.Parent != this && node.Parent != null)
         {
             entry->_dataOffset = (uint)(node.Parent as U8EntryNode).index;
         }
         (entry++)->_dataLength = (uint)(node.index + node.Children.Count + 1);
         foreach (ResourceNode b in node.Children)
         {
             if (b is U8EntryNode)
             {
                 RebuildNode(header, b as U8EntryNode, ref entry, sTableStart, ref dataAddr, table, force);
             }
         }
     }
     else
     {
         node.Rebuild(dataAddr, node._calcSize, force);
         entry->_dataOffset     = (uint)dataAddr - (uint)header;
         (entry++)->_dataLength = (uint)node._calcSize.Align(0x10);
         dataAddr += node._calcSize.Align(0x20);
     }
 }
Beispiel #2
0
        private void RebuildNode(VoidPtr header, U8EntryNode node, ref U8Entry *entry, VoidPtr sTableStart, ref VoidPtr dataAddr, bool force)
        {
            entry->_type = (byte)((node is U8FolderNode) ? 1 : 0);
            entry->_stringOffset.Value = (uint)_stringTable[node.Name] - (uint)sTableStart;
            if (entry->_type == 1)
            {
                int index = node.Index + 1, parentIndex = 0, endIndex = _entrySize / 12;

                if (node.Parent != this && node.Parent != null)
                {
                    parentIndex = ((U8EntryNode)node.Parent)._u8Index;
                }
                if (index < node.Parent.Children.Count)
                {
                    endIndex = (node.Parent.Children[index] as U8EntryNode)._u8Index;
                }

                entry->_dataLength = (uint)endIndex;
                entry->_dataOffset = (uint)parentIndex;
                entry++;

                foreach (ResourceNode b in node.Children)
                {
                    if (b is U8EntryNode)
                    {
                        RebuildNode(header, b as U8EntryNode, ref entry, sTableStart, ref dataAddr, force);
                    }
                }
            }
            else
            {
                entry->_dataOffset = (uint)dataAddr - (uint)header;
                entry->_dataLength = (uint)node._calcSize;
                entry++;

                node.Rebuild(dataAddr, node._calcSize, force);
                dataAddr += node._calcSize.Align(0x20);
            }
        }