Esempio n. 1
0
        private void ReadSourceVtxVertices(Stream stream, long stripGroupOffset, SourceVtxStripGroup stripGroup)
        {
            if (stripGroup.vertexCount > 0 && stripGroup.vertexOffset != 0)
            {
                stream.Position           = stripGroupOffset + stripGroup.vertexOffset;
                stripGroup.theVtxVertices = new SourceVtxVertex[stripGroup.vertexCount];
                for (int i = 0; i < stripGroup.theVtxVertices.Length; i++)
                {
                    stripGroup.theVtxVertices[i] = new SourceVtxVertex();
                    stripGroup.theVtxVertices[i].boneWeightIndex = new byte[VVDParser.MAX_NUM_BONES_PER_VERT];
                    for (int j = 0; j < stripGroup.theVtxVertices[i].boneWeightIndex.Length; j++)
                    {
                        stripGroup.theVtxVertices[i].boneWeightIndex[j] = DataParser.ReadByte(stream);
                    }

                    stripGroup.theVtxVertices[i].boneCount = DataParser.ReadByte(stream);
                    stripGroup.theVtxVertices[i].originalMeshVertexIndex = DataParser.ReadUShort(stream);

                    stripGroup.theVtxVertices[i].boneId = new byte[VVDParser.MAX_NUM_BONES_PER_VERT];
                    for (int j = 0; j < stripGroup.theVtxVertices[i].boneId.Length; j++)
                    {
                        stripGroup.theVtxVertices[i].boneId[j] = DataParser.ReadByte(stream);
                    }
                }
            }
        }
Esempio n. 2
0
 private void ReadSourceVtxIndices(Stream stream, long stripGroupOffset, SourceVtxStripGroup stripGroup)
 {
     if (stripGroup.indexCount > 0 && stripGroup.indexOffset != 0)
     {
         stream.Position          = stripGroupOffset + stripGroup.indexOffset;
         stripGroup.theVtxIndices = new ushort[stripGroup.indexCount];
         for (int i = 0; i < stripGroup.theVtxIndices.Length; i++)
         {
             stripGroup.theVtxIndices[i] = DataParser.ReadUShort(stream);
         }
     }
 }
Esempio n. 3
0
 private void ReadSourceVtxStrips(Stream stream, long stripGroupOffset, SourceVtxStripGroup stripGroup)
 {
     if (stripGroup.stripCount > 0 && stripGroup.stripOffset != 0)
     {
         stream.Position         = stripGroupOffset + stripGroup.stripOffset;
         stripGroup.theVtxStrips = new SourceVtxStrip[stripGroup.stripCount];
         for (int i = 0; i < stripGroup.theVtxStrips.Length; i++)
         {
             stripGroup.theVtxStrips[i]                       = new SourceVtxStrip();
             stripGroup.theVtxStrips[i].indexCount            = DataParser.ReadInt(stream);
             stripGroup.theVtxStrips[i].indexMeshIndex        = DataParser.ReadInt(stream);
             stripGroup.theVtxStrips[i].vertexCount           = DataParser.ReadInt(stream);
             stripGroup.theVtxStrips[i].vertexMeshIndex       = DataParser.ReadInt(stream);
             stripGroup.theVtxStrips[i].boneCount             = DataParser.ReadShort(stream);
             stripGroup.theVtxStrips[i].flags                 = DataParser.ReadByte(stream);
             stripGroup.theVtxStrips[i].boneStateChangeCount  = DataParser.ReadInt(stream);
             stripGroup.theVtxStrips[i].boneStateChangeOffset = DataParser.ReadInt(stream);
         }
     }
 }