コード例 #1
0
            public Track(EndianBinaryReader er, int Id)
            {
                er.BaseStream.Position = TrackHeaderAddress + Id * 0x30;
                Header = new TrackHeader(er);
                er.BaseStream.Position = Header.DLOffset;
                DL = MIO0.Decompress(er.ReadBytes((int)(Header.DLEnd - Header.DLOffset)));
                er.BaseStream.Position = Header.TrackDataOffset;
                byte[] VtxData = MIO0.Decompress(er.ReadBytes((int)(Header.VertexDataMIO0Length & 0xFFFFFF)));
                VertexData = new VertexDataEntry[Header.VertexDataNrEntries];
                for (int i = 0; i < Header.VertexDataNrEntries; i++)
                {
                    VertexData[i] = new VertexDataEntry(VtxData, i * 0xE);
                }
                LevelScript            = er.ReadBytes((int)(Header.TrackDataEnd - Header.TrackDataOffset - (Header.VertexDataMIO0Length & 0xFFFFFF)));
                er.BaseStream.Position = Header.TexTableOffset;
                List <TexTableEntry> texes = new List <TexTableEntry>();

                while (true)
                {
                    var v = new TexTableEntry(er);
                    if (v.GPUTexAddress == 0)
                    {
                        break;
                    }
                    texes.Add(v);
                }
                TexTable = texes.ToArray();
            }
コード例 #2
0
                public TexTableEntry(EndianBinaryReader er)
                {
                    GPUTexAddress    = er.ReadUInt32();
                    CompressedSize   = er.ReadUInt32();
                    DecompressedSize = er.ReadUInt32();
                    Unknown2         = er.ReadUInt32();

                    if (GPUTexAddress == 0)
                    {
                        return;
                    }

                    long curpos = er.BaseStream.Position;

                    er.BaseStream.Position = TexBaseAddress + (GPUTexAddress & 0xFFFFFF);
                    TexData = MIO0.Decompress(er.ReadBytes((int)CompressedSize));
                    er.BaseStream.Position = curpos;
                }