public List <OgreConfigNode> ReadConfigData()       //Read Config Data to list
        {
            List <OgreConfigNode> settings = new List <OgreConfigNode>();

            string secName;

            Mogre.ConfigFile cf = new Mogre.ConfigFile();

            cf.Load(filename, "\t:=", true);
            Mogre.ConfigFile.SectionIterator seci = cf.GetSectionIterator();
            while (seci.MoveNext())
            {
                secName = seci.CurrentKey;
                OgreConfigNode configNode = new OgreConfigNode();
                configNode.Section = secName;
                Mogre.ConfigFile.SettingsMultiMap settings2 = seci.Current;;

                foreach (KeyValuePair <string, string> pv in settings2)
                {
                    configNode.Settings[pv.Key] = pv.Value;
                }
                settings.Add(configNode);
            }
            ogreconfigs = settings;
            return(settings);
        }
Exemple #2
0
        private static void SetupMogreResources()
        {
            // Configure resource paths from : "resources.cfg" file
            Mogre.ConfigFile cf = new Mogre.ConfigFile();
            cf.Load("resources.cfg", "\t:=", true);

            // Go through all sections & settings in the file
            Mogre.ConfigFile.SectionIterator seci = cf.GetSectionIterator();
            while (seci.MoveNext())
            {
                string secName = seci.CurrentKey;

                Mogre.ConfigFile.SettingsMultiMap settings = seci.Current;
                foreach (var pair in settings)
                {
                    string typeName = pair.Key;
                    string archName = pair.Value;
                    Mogre.ResourceGroupManager.Singleton.AddResourceLocation(archName, typeName, secName);
                }
            }
        }