Example #1
0
        public FileSeeker(OpenTkProjectWindow mGameWindow)
        {
            this.gameWindow = mGameWindow;

            string root = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);

            List<string> files = GetFileList(root, true);

            foreach (var file in files)
            {
                string relativePath = file.Substring(root.Length + 1);
                string extention = System.IO.Path.GetExtension(file);

                switch (extention)
                {
                    case ".obj":
                        mGameWindow.log("found object file: " + relativePath);
                        mGameWindow.meshLoader.fromObj(relativePath);
                        break;
                    case ".dae":
                        mGameWindow.log("found object file: " + relativePath);
                        mGameWindow.meshLoader.fromCollada(relativePath);
                        break;
                    case ".xmd":
                        mGameWindow.log("found object definition file: " + relativePath);
                        mGameWindow.meshLoader.fromXml(relativePath);
                        break;
                    case ".png":
                        mGameWindow.log("found image file: " + relativePath);
                        mGameWindow.textureLoader.fromPng(relativePath);
                        break;
                    case ".dds":
                        mGameWindow.log("found image file: " + relativePath);
                        mGameWindow.textureLoader.fromDds(relativePath);
                        break;
                    case ".xmf":
                        mGameWindow.log("found material file: " + relativePath);
                        mGameWindow.materialLoader.fromXmlFile(relativePath);
                        break;
                    case ".xsp":
                        mGameWindow.log("found shaderpair file: " + relativePath);
                        mGameWindow.shaderLoader.fromXmlFile(relativePath);
                        break;
                    case ".snip":
                        mGameWindow.log("found shader snipet: " + relativePath);
                        mGameWindow.shaderLoader.loadSnippet(relativePath);
                        break;
                    case ".xtmp":
                        mGameWindow.log("found template file: " + relativePath);
                        mGameWindow.templateLoader.fromXmlFile(relativePath);
                        break;
                    default:
                        break;
                }
            }
        }
Example #2
0
        public FileSeeker(OpenTkProjectWindow mGameWindow)
        {
            this.gameWindow = mGameWindow;

            string root = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);

            List<string> files = GetFileList(root, true);

            foreach (var file in files)
            {
                string relativePath = file.Substring(root.Length + 1);
                string extention = System.IO.Path.GetExtension(file);
                if (extention == ".obj")
                {
                    mGameWindow.log("found object file: " + relativePath);
                    mGameWindow.meshLoader.fromObj(relativePath);
                }
                if (extention == ".png")
                {
                    mGameWindow.log("found image file: " + relativePath);
                    mGameWindow.textureLoader.fromFile(relativePath,true);
                }
                if (extention == ".xmf")
                {
                    mGameWindow.log("found material file: " + relativePath);
                    mGameWindow.materialLoader.fromXmlFile(relativePath);
                }
                if (extention == ".xsp")
                {
                    mGameWindow.log("found shaderpair file: " + relativePath);
                    mGameWindow.shaderLoader.fromXmlFile(relativePath);
                }
                if (extention == ".xtmp")
                {
                    mGameWindow.log("found template file: " + relativePath);
                    mGameWindow.templateLoader.fromXmlFile(relativePath);
                }
            }
        }
Example #3
0
        public FileSeeker(OpenTkProjectWindow mGameWindow)
        {
            this.gameWindow = mGameWindow;

            string root = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);

            List <string> files = GetFileList(root, true);

            foreach (var file in files)
            {
                string relativePath = file.Substring(root.Length + 1);
                string extention    = System.IO.Path.GetExtension(file);

                switch (extention)
                {
                case ".obj":
                    mGameWindow.log("found object file: " + relativePath);
                    mGameWindow.meshLoader.fromObj(relativePath);
                    break;

                case ".dae":
                    mGameWindow.log("found object file: " + relativePath);
                    mGameWindow.meshLoader.fromCollada(relativePath);
                    break;

                case ".xmd":
                    mGameWindow.log("found object definition file: " + relativePath);
                    mGameWindow.meshLoader.fromXml(relativePath);
                    break;

                case ".png":
                    mGameWindow.log("found image file: " + relativePath);
                    mGameWindow.textureLoader.fromPng(relativePath);
                    break;

                case ".dds":
                    mGameWindow.log("found image file: " + relativePath);
                    mGameWindow.textureLoader.fromDds(relativePath);
                    break;

                case ".xmf":
                    mGameWindow.log("found material file: " + relativePath);
                    mGameWindow.materialLoader.fromXmlFile(relativePath);
                    break;

                case ".xsp":
                    mGameWindow.log("found shaderpair file: " + relativePath);
                    mGameWindow.shaderLoader.fromXmlFile(relativePath);
                    break;

                case ".snip":
                    mGameWindow.log("found shader snipet: " + relativePath);
                    mGameWindow.shaderLoader.loadSnippet(relativePath);
                    break;

                case ".xtmp":
                    mGameWindow.log("found template file: " + relativePath);
                    mGameWindow.templateLoader.fromXmlFile(relativePath);
                    break;

                default:
                    break;
                }
            }
        }