예제 #1
0
        public static void LoadContentLists()
        {
            try
            {
                ClearLists();

                #region Paths
                string[] Paths = new string[] { Settings.Paths.EngineContentPath, Settings.Paths.GameDataPath };

                string[] MaterialsConfigs       = new string[] { Settings.Paths.ContentFiles.EngineMaterials, Settings.Paths.ContentFiles.Materials };
                string[] MeshesConfigs          = new string[] { Settings.Paths.ContentFiles.EngineMeshes, Settings.Paths.ContentFiles.Meshes };
                string[] ShadersConfigs         = new string[] { Settings.Paths.ContentFiles.EngineShaders, Settings.Paths.ContentFiles.Shaders };
                string[] TexturesConfigs        = new string[] { Settings.Paths.ContentFiles.EngineTextures, Settings.Paths.ContentFiles.Textures };
                string[] CubemapTexturesConfigs = new string[] { Settings.Paths.ContentFiles.EngineCubemapTextures, Settings.Paths.ContentFiles.CubemapTextures };

                string[] MapsPaths            = new string[] { Settings.Paths.EngineMaps, Settings.Paths.Maps };
                string[] MeshesPaths          = new string[] { Settings.Paths.EngineMeshes, Settings.Paths.Meshes };
                string[] ShadersPaths         = new string[] { Settings.Paths.EngineShaders, Settings.Paths.Shaders };
                string[] TexturesPaths        = new string[] { Settings.Paths.EngineTextures, Settings.Paths.Textures };
                string[] CubemapTexturesPaths = new string[] { Settings.Paths.EngineCubemapTextures, Settings.Paths.CubemapTextures };
                #endregion

                #region Load Lists
                ClearLists();

                for (int i = 0; i < Paths.Length; i++)
                {
                    bool EngineContent = false;
                    if (i == 0)
                    {
                        EngineContent = true;
                    }

                    Textures.LoadTexturesList(TexturesConfigs[i], TexturesPaths[i], EngineContent);
                }

                for (int i = 0; i < Paths.Length; i++)
                {
                    bool EngineContent = false;
                    if (i == 0)
                    {
                        EngineContent = true;
                    }

                    Textures.LoadCubemapTexturesList(CubemapTexturesConfigs[i], CubemapTexturesPaths[i], EngineContent);
                }

                for (int i = 0; i < Paths.Length; i++)
                {
                    bool EngineContent = false;
                    if (i == 0)
                    {
                        EngineContent = true;
                    }

                    Shaders.LoadShadersList(ShadersConfigs[i], ShadersPaths[i], EngineContent);
                }

                for (int i = 0; i < Paths.Length; i++)
                {
                    bool EngineContent = false;
                    if (i == 0)
                    {
                        EngineContent = true;
                    }

                    Materials.LoadMaterialsList(MaterialsConfigs[i], EngineContent);
                }

                for (int i = 0; i < Paths.Length; i++)
                {
                    bool EngineContent = false;
                    if (i == 0)
                    {
                        EngineContent = true;
                    }

                    Meshes.LoadMeshesList(MeshesConfigs[i], MeshesPaths[i], EngineContent);
                }

                for (int i = 0; i < Paths.Length; i++)
                {
                    bool EngineContent = false;
                    if (i == 0)
                    {
                        EngineContent = true;
                    }

                    Maps.LoadMapList(MapsPaths[i], EngineContent);
                }
                #endregion
            }
            catch (Exception e)
            {
                Log.WriteLineRed("Engine.LoadContentLists() Exception.");
                Log.WriteLineYellow(e.Message);
            }
        }