Пример #1
0
        public override void OnPopulate()
        {
            RWARTableBlock *table = Header->Table;
            RWARDataBlock * d     = Header->Data;

            for (int i = 0; i < table->_entryCount; i++)
            {
                new RWAVNode().Initialize(this, d->GetEntry(table->Entries[i].waveFileRef), 0);
            }
        }
Пример #2
0
        public override void OnRebuild(VoidPtr address, int length, bool force)
        {
            RWAR *header = (RWAR *)address;

            header->_header._version     = 0x100;
            header->_header._tag         = RWAR.Tag;
            header->_header.Endian       = Endian.Big;
            header->_header._length      = length;
            header->_header._firstOffset = 0x20;
            header->_header._numEntries  = 2;
            header->_tableOffset         = 0x20;

            RWARTableBlock *tabl = (RWARTableBlock *)(address + 0x20);

            tabl->_header._tag    = RWARTableBlock.Tag;
            tabl->_header._length = (12 + Children.Count * 12).Align(0x20);
            tabl->_entryCount     = (uint)Children.Count;

            header->_tableLength = tabl->_header._length;
            header->_dataOffset  = 0x20 + header->_tableLength;

            RWARDataBlock *data = (RWARDataBlock *)(address + 0x20 + tabl->_header._length);

            data->_header._tag = RWARDataBlock.Tag;

            VoidPtr addr = (VoidPtr)data + 0x20;

            foreach (RWAVNode n in Children)
            {
                tabl->Entries[n.Index].waveFileRef = (uint)(addr - data);
                //Memory.Move(addr, n.WorkingSource.Address, (uint)n.WorkingSource.Length);
                n.MoveRaw(addr, n.WorkingUncompressed.Length);
                addr += tabl->Entries[n.Index].waveFileSize = (uint)n.WorkingUncompressed.Length;
            }

            data->_header._length = addr - data;
            header->_dataLength   = data->_header._length;
        }