コード例 #1
0
        protected override void OnParse(VoidPtr address)
        {
            //Get header values
            _hdr = *(sDataMisc *)address;

            //Parse all misc entries.
            //If an offset is 0, the entry will be set to null.
            _unknown0       = Parse <EntryList <IndexValue> >(_hdr[0], 4);
            _finalSmashAura = Parse <EntryList <MiscFinalSmashAura> >(_hdr[1], 0x14, _hdr[2]);
            _hurtBoxes      = Parse <EntryList <MiscHurtBox> >(_hdr[3], 0x20, _hdr[4]);
            _ledgeGrabs     = Parse <EntryList <MiscLedgeGrab> >(_hdr[5], 0x10, _hdr[6]);
            _unknown7       = Parse <EntryList <MiscUnk7Entry> >(_hdr[7], 0x20, _hdr[8]);
            _boneRefs       = Parse <EntryList <BoneIndexValue> >(_hdr[9], 4, 10);
            _unknown10      = Parse <MiscUnk10>(_hdr[10]);
            _soundData      = Parse <MiscSoundData>(_hdr[11]);
            _unknown12      = Parse <MiscUnk12>(_hdr[12]);
            _multiJump      = Parse <MiscMultiJump>(_hdr[13]);
            _glide          = Parse <MiscGlide>(_hdr[14]);
            _crawl          = Parse <MiscCrawl>(_hdr[15]);
            _collisionData  = Parse <CollisionData>(_hdr[16]);
            _tether         = Parse <MiscTether>(_hdr[17]);
            if (_hdr[18] > 0)
            {
                sListOffset *o = (sListOffset *)Address(_hdr[18]);
                _unknown18 = Parse <EntryList <IndexValue> >(o->_startOffset, 4, (int)o->_listCount);
            }
        }
コード例 #2
0
        protected override void OnWrite(VoidPtr address)
        {
            bint *  offsets  = (bint *)address;
            VoidPtr dataAddr = address;

            if (_entries.Count > 0)
            {
                foreach (CollisionDataEntry o in _entries)
                {
                    if (!o.External)
                    {
                        o.Write(dataAddr);
                        Lookup(o.LookupAddresses);
                        dataAddr += o._calcSize;
                    }
                }
                offsets = (bint *)dataAddr;
                foreach (CollisionDataEntry o in _entries)
                {
                    Lookup(&offsets);
                    *offsets++ = o.RebuildOffset;
                }
            }

            RebuildAddress = offsets;
            sListOffset *header = (sListOffset *)offsets;

            header->_listCount = _entries.Count;
            if (_entries.Count > 0)
            {
                header->_startOffset = Offset(dataAddr);
                Lookup(header->_startOffset.Address);
            }
        }
コード例 #3
0
        protected override void OnParse(VoidPtr address)
        {
            hdr = *(DataCommonHeader *)address;
            bint *v      = (bint *)address;
            int   offset = 0;

            //Calculate the sizes of each section using their offsets,
            //in order of appearance
            int[] sizes = SakuraiArchiveNode.CalculateSizes(_root._dataSize, v, 26, false);

            //Parse all script-related data first
            ParseScripts(v, sizes);

            //These ICs need to be sorted into int and float arrays
            //Right now they're just a mess of values
            //The indices in the IC variable storage class
            _globalICs    = Parse <RawParamList>(v[0], 188);
            _globalsseICs = Parse <RawParamList>(v[1], 188);
            _ICs          = Parse <RawParamList>(v[2], 2204);
            _sseICs       = Parse <RawParamList>(v[3], 2204);
            //Entry action script offsets
            //Exit action script offsets
            //Flash overlay script offsets/flags
            _unk7          = Parse <EntryList <CommonUnk7Entry> >(v[7], 12);
            _unk8          = Parse <RawParamList>(v[8], 0x1A4);
            _itemSwingData = Parse <RawParamList>(v[9], 0x64);
            _unk10         = Parse <RawParamList>(v[10], 0x10);
            if ((offset = v[11]) > 0)
            {
                sListOffset *list = (sListOffset *)Address(offset);
                _unk11 = Parse <EntryList <Unknown11EntryNode> >(list->_startOffset, 12, (int)list->_listCount);
            }
            _unk12 = Parse <RawParamList>(v[12], 0x80);
            _unk13 = Parse <RawParamList>(v[13], 0x80);
            _unk14 = Parse <RawParamList>(v[14], 0x40);
            _unk15 = Parse <RawParamList>(v[15], 0x24);
            _unk16 = Parse <RawParamList>(v[16], 0x48);
            _ppMul = Parse <CmnPatternPowerMulNode>(v[17]);
            _unk18 = Parse <RawParamList>(v[18], 0x10);

            //Screen tint script offsets
            _legBones = Parse <CmnLegBonesNode>(v[21]);

            if ((offset = v[23]) > 0)
            {
                _unk23 = Parse <RawParamList>(*(bint *)Address(offset), 0xA8);
            }

            _unk24 = Parse <RawParamList>(v[24], 4);

            //Notes:

            //Unk12 and Unk13 are copies of the same parameters
            //with some different values

            //Unk23 is one value (0) in Global IC-Basics - offset to data at start of section child data
            //Params24 is one value (32) in IC-Basics
        }
コード例 #4
0
        protected override void OnParse(VoidPtr address)
        {
            base.OnParse(address);
            _entries = new List <EntryList <IndexValue> >();
            sListOffset *offsets = (sListOffset *)Address(StartOffset);

            for (int i = 0; i < Count; i++, offsets++)
            {
                _entries.Add(Parse <EntryList <IndexValue> >(offsets->_startOffset, 4, (int)offsets->_listCount));
            }
        }
コード例 #5
0
 protected unsafe void WriteEntryList <T>(EntryList <T> e, sListOffset *o) where T : SakuraiEntryNode
 {
     if (e.Count > 0 && e._calcSize > 0)
     {
         o->_listCount   = e.Count;
         o->_startOffset = Write(e);
         Lookup(o->_startOffset.Address);
     }
     else
     {
         o->_listCount   = 0;
         o->_startOffset = 0;
     }
 }
コード例 #6
0
        protected override void OnParse(VoidPtr address)
        {
            _bones = new List <BoneIndexValue>();

            sListOffset *hdr = (sListOffset *)address;

            _dataOffset = hdr->_startOffset;
            _count      = hdr->_listCount;

            VoidPtr addr = BaseAddress + _dataOffset;

            for (int i = 0; i < Count; i++)
            {
                _bones.Add(Parse <BoneIndexValue>(addr + i * 4));
            }
        }
コード例 #7
0
        protected override void OnParse(VoidPtr address)
        {
            _children = new List <ModelVisGroup>();

            sListOffset *hdr = (sListOffset *)address;

            _dataOffset = hdr->_startOffset;
            _count      = hdr->_listCount;

            VoidPtr addr = BaseAddress + _dataOffset;

            for (int i = 0; i < _count; i++)
            {
                _children.Add(Parse <ModelVisGroup>(addr + i * 8));
            }
        }
コード例 #8
0
        protected override void OnParse(VoidPtr address)
        {
            _left  = new List <string>();
            _right = new List <string>();

            sListOffset *hdr  = (sListOffset *)address;
            bint *       addr = (bint *)Address(hdr[0]._startOffset);

            for (int i = 0; i < hdr[0]._listCount; i++)
            {
                _left.Add(new String((sbyte *)(Address(addr[i]))));
            }
            addr = (bint *)Address(hdr[1]._startOffset);
            for (int i = 0; i < hdr[1]._listCount; i++)
            {
                _right.Add(new String((sbyte *)(Address(addr[i]))));
            }
        }
コード例 #9
0
        protected override void OnWrite(VoidPtr address)
        {
            int sndOff = 0, mainOff = 0;

            foreach (EntryListOffset <IndexValue> r in _entries)
            {
                mainOff += 8;
                sndOff  += r._entries.Count * 4;
            }

            //indices
            //sound list offsets
            //header

            bint *       indices  = (bint *)address;
            sListOffset *sndLists = (sListOffset *)(address + sndOff);
            sListOffset *header   = (sListOffset *)((VoidPtr)sndLists + mainOff);

            RebuildAddress = header;

            if (_entries.Count > 0)
            {
                header->_startOffset = Offset(sndLists);
                _lookupOffsets.Add(&header->_startOffset);
            }

            header->_listCount = _entries.Count;

            foreach (EntryListOffset <IndexValue> r in _entries)
            {
                if (r._entries.Count > 0)
                {
                    sndLists->_startOffset = Offset(indices);
                    _lookupOffsets.Add(&sndLists->_startOffset);
                }

                (sndLists++)->_listCount = r._entries.Count;
                foreach (IndexValue b in r._entries)
                {
                    b.RebuildAddress = indices;
                    *indices++ = b.ItemIndex;
                }
            }
        }
コード例 #10
0
ファイル: General.cs プロジェクト: soopercool101/brawltools2
        protected override void OnWrite(VoidPtr address)
        {
            for (int i = 0; i < _entries.Count; i++)
            {
                _entries[i].Write(address[i, _stride]);
            }

            sListOffset *o = (sListOffset *)(_rebuildAddr = address + _entries.Count * _stride);

            if (_entries.Count > 0)
            {
                o->_startOffset = Offset(address);
                o->_listCount   = _entries.Count;
                _lookupOffsets.Add(&o->_startOffset);
            }
            else
            {
                o->_startOffset = 0;
                o->_listCount   = 0;
            }
        }
コード例 #11
0
        protected override void OnWrite(VoidPtr address)
        {
            bint *addr = (bint *)address;

            foreach (IndexValue b in _indices)
            {
                b.RebuildAddress = addr;
                *addr++ = b.ItemIndex;
            }

            sListOffset *header = (sListOffset *)addr;

            RebuildAddress = addr;

            if (_indices.Count > 0)
            {
                header->_startOffset = Offset(address);
                _lookupOffsets.Add(header->_startOffset.Address);
            }

            header->_listCount = _indices.Count;
        }
コード例 #12
0
        protected override void OnParse(VoidPtr address)
        {
            sListOffset *offset = (sListOffset *)address;

            _entries = Parse <EntryList <Unknown11EntryNode> >(offset->_startOffset, offset->_listCount);
        }