示例#1
0
        ModelPart ReadBB(LineSplitter ls)
        {
            ModelPart result = new ModelPart();

            string type = ls.Next();
            int    H    = ls.NextInt();
            int    W    = ls.NextInt();
            Color  c;

            string[] rgb;
            rgb = ls.Next().Split(':');
            c   = new Microsoft.Xna.Framework.Color(int.Parse(rgb[0]), int.Parse(rgb[1]), int.Parse(rgb[2]));
            TestParts.PartLight p = new TestParts.PartLight(c);
            p.Width  = W;
            p.Height = H;
            result   = p;

            return(result);
        }
示例#2
0
        int[] ReadMesh()
        {
            LineSplitter ls      = new LineSplitter(lines[state.LineNumber].Replace(',', ' '));
            List <int>   indices = new List <int>();

            //keep going until end mesh command
            while (ls.Next() != "#endmesh")
            {
                //rewind because of next
                ls.Reset();

                while (!ls.EOL) //read the rest of the line as ints
                {
                    indices.Add(ls.NextInt());
                }
                //prepare for next line
                state.LineNumber++;
                ls = new LineSplitter(lines[state.LineNumber].Replace(',', ' '));
            }
            return(indices.ToArray());
        }