CSPspEmu.Core.Gpu.Formats.PspWavefrontObjWriter.EndPrimitive C# (CSharp) Method

EndPrimitive() public method

public EndPrimitive ( ) : void
return void
        public void EndPrimitive()
        {
            switch (this.CurrentPrimitiveType)
            {
                case State.GuPrimitiveType.Sprites:
                    WavefrontObjWriter.AddFaces(4, PrimitiveIndices);
                    break;
                case State.GuPrimitiveType.Triangles:
                    WavefrontObjWriter.AddFaces(3, PrimitiveIndices);
                    break;
                case State.GuPrimitiveType.TriangleStrip:
                    {
                        var Indices = PrimitiveIndices.ToArray();
                        int TriangleCount = Indices.Length - 2;
                        for (int n = 0; n < TriangleCount; n++)
                        {
                            WavefrontObjWriter.AddFace(Indices[n + 0], Indices[n + 1], Indices[n + 2]);
                        }
                    }
                    break;
                default:
                    WavefrontObjWriter.StartComment("Can't handle primitive type: " + this.CurrentPrimitiveType);
                    break;
            }
            WavefrontObjWriter.StartComment("End: " + this.CurrentPrimitiveType);
            //throw new NotImplementedException();
        }