Exemplo n.º 1
0
        public IResource Load(FileSystemNode n)
        {
            reader = new StreamReader(n.getStream());
            string[] line;
            model = new Md5Model();

            while ((line = ReadLineTokens()) != null)
            {
                switch (line[0])
                {
                case "numJoints":
                    model.Joints = new Md5Joint[int.Parse(line[1])];
                    break;

                case "numMeshes":
                    model.Meshes = new Md5Mesh[int.Parse(line[1])];
                    break;

                case "joints":
                    LoadJoints();
                    break;

                case "mesh":
                    LoadMesh();
                    break;

                case "MD5Version":
                    model.Header.Version = int.Parse(line[1]);
                    if (model.Header.Version != 10)
                    {
                        Console.WriteLine("md5 warning: version is not 10.");
                    }
                    break;

                case "commandline":
                    //HACK
                    break;
                }
            }

            return(model);
        }
Exemplo n.º 2
0
        public IResource Load(FileSystemNode n)
        {
            reader = new StreamReader(n.getStream());
            string[] line;
            model = new Md5Model();

            while ((line = ReadLineTokens()) != null)
            {
                switch (line[0])
                {
                    case "numJoints":
                        model.Joints = new Md5Joint[int.Parse(line[1])];
                        break;
                    case "numMeshes":
                        model.Meshes = new Md5Mesh[int.Parse(line[1])];
                        break;
                    case "joints":
                        LoadJoints();
                        break;
                    case "mesh":
                        LoadMesh();
                        break;
                    case "MD5Version":
                        model.Header.Version = int.Parse(line[1]);
                        if (model.Header.Version != 10)
                            Console.WriteLine("md5 warning: version is not 10.");
                        break;
                    case "commandline":
                        //HACK
                        break;
                }
            }

            return model;
        }