本文整理汇总了C#中System.IO.StreamReader.Import_VBUF方法的典型用法代码示例。如果您正苦于以下问题:C# StreamReader.Import_VBUF方法的具体用法?C# StreamReader.Import_VBUF怎么用?C# StreamReader.Import_VBUF使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.IO.StreamReader
的用法示例。
在下文中一共展示了StreamReader.Import_VBUF方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Import_VBUF_Geos
meshExpImp.ModelBlocks.Vertex[] Import_VBUF_Geos(StreamReader r, MLOD mlod, MLOD.Mesh mesh, int geoStateIndex, VRTF vrtf, bool isDefaultVRTF)
{
//w.WriteLine(string.Format("vbuf {0} {1} {2}", geoStateIndex, mesh.GeometryStates[geoStateIndex].MinVertexIndex, mesh.GeometryStates[geoStateIndex].VertexCount));
string tagLine = r.ReadTag();
string[] split = tagLine.Split(new char[] { ' ', }, StringSplitOptions.RemoveEmptyEntries);
if (split.Length != 4)
throw new InvalidDataException(string.Format("Invalid tag line read for geoState {0} 'vbuf'.", geoStateIndex));
if (split[0] != "vbuf")
throw new InvalidDataException("Expected line tag 'vbuf' not found.");
int lineIndex;
if (!int.TryParse(split[1], out lineIndex))
throw new InvalidDataException(string.Format("geoState {0} 'vbuf' line has invalid geoStateIndex.", geoStateIndex));
if (lineIndex != geoStateIndex)
throw new InvalidDataException(string.Format("geoState {0} 'vbuf' line has incorrect geoStateIndex value {1}.", geoStateIndex, lineIndex));
int minVertexIndex;
if (!int.TryParse(split[2], out minVertexIndex))
throw new InvalidDataException(string.Format("geoState {0} 'vbuf' line has invalid MinVertexIndex.", geoStateIndex));
int vertexCount;
if (!int.TryParse(split[3], out vertexCount))
throw new InvalidDataException(string.Format("geoState {0} 'vbuf' line has invalid VertexCount.", geoStateIndex));
if (minVertexIndex + vertexCount <= mesh.MinVertexIndex + mesh.VertexCount)
{
mesh.GeometryStates[geoStateIndex].MinVertexIndex = minVertexIndex;
mesh.GeometryStates[geoStateIndex].VertexCount = vertexCount;
return null;
}
if (minVertexIndex != mesh.GeometryStates[geoStateIndex].MinVertexIndex)
throw new InvalidDataException(string.Format("geoState {0} 'vbuf' line has unexpected MinVertexIndex {1}; expected {2}.", geoStateIndex, minVertexIndex, mesh.GeometryStates[geoStateIndex].MinVertexIndex));
return r.Import_VBUF(mpb, vertexCount, vrtf);
}
示例2: Import_VBUF_Main
ModelBlocks.Vertex[] Import_VBUF_Main(StreamReader r, MLOD mlod, MLOD.Mesh mesh, VRTF vrtf, bool isDefaultVRTF)
{
string tagLine = r.ReadTag();
string[] split = tagLine.Split(new char[] { ' ', }, StringSplitOptions.RemoveEmptyEntries);
if (split.Length != 2)
throw new InvalidDataException("Invalid tag line read for 'vbuf'.");
if (split[0] != "vbuf")
throw new InvalidDataException("Expected line tag 'vbuf' not found.");
int count;
if (!int.TryParse(split[1], out count))
throw new InvalidDataException("'vbuf' line has invalid count.");
//Wes's MilkShape plug-in sends back the first line in all subsequent lines of a dropShadow.
return r.Import_VBUF(mpb, count, vrtf, (mesh.Flags & MeshFlags.ShadowCaster) == 0);
}