Example #1
0
 // Token: 0x06002090 RID: 8336 RVA: 0x0013F074 File Offset: 0x0013D274
 public AppMain.NNS_PRIMLIST_GL_DESC Assign(AppMain.NNS_PRIMLIST_GL_DESC desc)
 {
     this.Mode            = desc.Mode;
     this.pCounts         = desc.pCounts;
     this.DataType        = desc.DataType;
     this.pIndices        = desc.pIndices;
     this.nPrim           = desc.nPrim;
     this.IndexBufferSize = desc.IndexBufferSize;
     this.pIndexBuffer    = desc.pIndexBuffer;
     this.BufferName      = desc.BufferName;
     return(this);
 }
        public static AppMain.NNS_PRIMLIST_GL_DESC Read(BinaryReader reader, long data0Pos)
        {
            AppMain.NNS_PRIMLIST_GL_DESC nnsPrimlistGlDesc = new AppMain.NNS_PRIMLIST_GL_DESC();
            nnsPrimlistGlDesc.Mode = reader.ReadUInt32();
            uint num1      = reader.ReadUInt32();
            long position1 = reader.BaseStream.Position;

            reader.BaseStream.Seek(data0Pos + (long)num1, SeekOrigin.Begin);
            nnsPrimlistGlDesc.pCounts    = new int[1];
            nnsPrimlistGlDesc.pCounts[0] = reader.ReadInt32();
            reader.BaseStream.Seek(position1, SeekOrigin.Begin);
            nnsPrimlistGlDesc.DataType = reader.ReadUInt32();
            uint num2 = reader.ReadUInt32();

            nnsPrimlistGlDesc.nPrim           = reader.ReadInt32();
            nnsPrimlistGlDesc.IndexBufferSize = reader.ReadInt32();
            uint num3      = reader.ReadUInt32();
            long position2 = reader.BaseStream.Position;

            reader.BaseStream.Seek(data0Pos + (long)num3, SeekOrigin.Begin);
            byte[] numArray = new byte[nnsPrimlistGlDesc.IndexBufferSize];
            reader.Read(numArray, 0, nnsPrimlistGlDesc.IndexBufferSize);
            nnsPrimlistGlDesc.pIndexBuffer = ByteBuffer.Wrap(numArray);
            reader.BaseStream.Seek(position2, SeekOrigin.Begin);
            nnsPrimlistGlDesc.pIndices = new UShortBuffer[nnsPrimlistGlDesc.nPrim];
            long position3 = reader.BaseStream.Position;

            reader.BaseStream.Seek(data0Pos + (long)num2, SeekOrigin.Begin);
            for (int index = 0; index < nnsPrimlistGlDesc.nPrim; ++index)
            {
                uint num4 = reader.ReadUInt32();
                nnsPrimlistGlDesc.pIndices[index] = (nnsPrimlistGlDesc.pIndexBuffer + ((int)num4 - (int)num3)).AsUShortBuffer();
            }
            reader.BaseStream.Seek(position3, SeekOrigin.Begin);
            nnsPrimlistGlDesc.BufferName = reader.ReadUInt32();
            return(nnsPrimlistGlDesc);
        }
Example #3
0
        // Token: 0x0600208F RID: 8335 RVA: 0x0013EEFC File Offset: 0x0013D0FC
        public static AppMain.NNS_PRIMLIST_GL_DESC Read(BinaryReader reader, long data0Pos)
        {
            AppMain.NNS_PRIMLIST_GL_DESC nns_PRIMLIST_GL_DESC = new AppMain.NNS_PRIMLIST_GL_DESC();
            nns_PRIMLIST_GL_DESC.Mode = reader.ReadUInt32();
            uint num      = reader.ReadUInt32();
            long position = reader.BaseStream.Position;

            reader.BaseStream.Seek(data0Pos + ( long )(( ulong )num), 0);
            nns_PRIMLIST_GL_DESC.pCounts    = new int[1];
            nns_PRIMLIST_GL_DESC.pCounts[0] = reader.ReadInt32();
            reader.BaseStream.Seek(position, 0);
            nns_PRIMLIST_GL_DESC.DataType = reader.ReadUInt32();
            uint num2 = reader.ReadUInt32();

            nns_PRIMLIST_GL_DESC.nPrim           = reader.ReadInt32();
            nns_PRIMLIST_GL_DESC.IndexBufferSize = reader.ReadInt32();
            uint num3 = reader.ReadUInt32();

            position = reader.BaseStream.Position;
            reader.BaseStream.Seek(data0Pos + ( long )(( ulong )num3), 0);
            byte[] array = new byte[nns_PRIMLIST_GL_DESC.IndexBufferSize];
            reader.Read(array, 0, nns_PRIMLIST_GL_DESC.IndexBufferSize);
            nns_PRIMLIST_GL_DESC.pIndexBuffer = ByteBuffer.Wrap(array);
            reader.BaseStream.Seek(position, 0);
            nns_PRIMLIST_GL_DESC.pIndices = new UShortBuffer[nns_PRIMLIST_GL_DESC.nPrim];
            position = reader.BaseStream.Position;
            reader.BaseStream.Seek(data0Pos + ( long )(( ulong )num2), 0);
            for (int i = 0; i < nns_PRIMLIST_GL_DESC.nPrim; i++)
            {
                uint num4 = reader.ReadUInt32();
                nns_PRIMLIST_GL_DESC.pIndices[i] = (nns_PRIMLIST_GL_DESC.pIndexBuffer + ( int )(num4 - num3)).AsUShortBuffer();
            }
            reader.BaseStream.Seek(position, 0);
            nns_PRIMLIST_GL_DESC.BufferName = reader.ReadUInt32();
            return(nns_PRIMLIST_GL_DESC);
        }