diff options
author | lbsa71 | 2008-01-02 07:13:34 +0000 |
---|---|---|
committer | lbsa71 | 2008-01-02 07:13:34 +0000 |
commit | 20653830fbd0c0104a62e9c1b71744284b77b754 (patch) | |
tree | 0212d34f7a9802a71ea3ea3ba6404e50de8d00a3 /OpenSim/Framework/AssetLoader | |
parent | * Added using as per mail to see if that does anything for Ursulas build issu... (diff) | |
download | opensim-SC-20653830fbd0c0104a62e9c1b71744284b77b754.zip opensim-SC-20653830fbd0c0104a62e9c1b71744284b77b754.tar.gz opensim-SC-20653830fbd0c0104a62e9c1b71744284b77b754.tar.bz2 opensim-SC-20653830fbd0c0104a62e9c1b71744284b77b754.tar.xz |
* Refactored out function to load specified AssetSet Xml
This commit dedicated to 'Mohawk - Bad Girls (Need Love Too)'
Diffstat (limited to 'OpenSim/Framework/AssetLoader')
-rw-r--r-- | OpenSim/Framework/AssetLoader/Filesystem/AssetLoaderFileSystem.cs | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/OpenSim/Framework/AssetLoader/Filesystem/AssetLoaderFileSystem.cs b/OpenSim/Framework/AssetLoader/Filesystem/AssetLoaderFileSystem.cs index 46e6ae1..d6ce0c5 100644 --- a/OpenSim/Framework/AssetLoader/Filesystem/AssetLoaderFileSystem.cs +++ b/OpenSim/Framework/AssetLoader/Filesystem/AssetLoaderFileSystem.cs | |||
@@ -79,18 +79,23 @@ namespace OpenSim.Framework.AssetLoader.Filesystem | |||
79 | //info.loaded=true; | 79 | //info.loaded=true; |
80 | } | 80 | } |
81 | 81 | ||
82 | public void ForEachXmlAsset(Action<AssetBase> action) | 82 | public void ForEachDefaultXmlAsset(Action<AssetBase> action) |
83 | { | 83 | { |
84 | List<AssetBase> assets = new List<AssetBase>(); | 84 | string assetSetFilename = Path.Combine(Util.assetsDir(), "AssetSets.xml"); |
85 | string assetSetsPath = Path.Combine(Util.assetsDir(), "AssetSets.xml"); | 85 | |
86 | 86 | ForEachDefaultXmlAsset(assetSetFilename, action); | |
87 | if (File.Exists(assetSetsPath)) | 87 | } |
88 | |||
89 | public void ForEachDefaultXmlAsset(string assetSetFilename, Action<AssetBase> action) | ||
90 | { | ||
91 | List<AssetBase> assets = new List<AssetBase>(); | ||
92 | if (File.Exists(assetSetFilename)) | ||
88 | { | 93 | { |
89 | string assetSetPath = "ERROR"; | 94 | string assetSetPath = "ERROR"; |
90 | 95 | ||
91 | try | 96 | try |
92 | { | 97 | { |
93 | XmlConfigSource source = new XmlConfigSource(assetSetsPath); | 98 | XmlConfigSource source = new XmlConfigSource(assetSetFilename); |
94 | 99 | ||
95 | for (int i = 0; i < source.Configs.Count; i++) | 100 | for (int i = 0; i < source.Configs.Count; i++) |
96 | { | 101 | { |
@@ -111,9 +116,9 @@ namespace OpenSim.Framework.AssetLoader.Filesystem | |||
111 | "Asset set control file assets/AssetSets.xml does not exist! No assets loaded."); | 116 | "Asset set control file assets/AssetSets.xml does not exist! No assets loaded."); |
112 | } | 117 | } |
113 | 118 | ||
114 | assets.ForEach(action); | 119 | assets.ForEach(action); |
115 | } | 120 | } |
116 | 121 | ||
117 | /// <summary> | 122 | /// <summary> |
118 | /// Use the asset set information at path to load assets | 123 | /// Use the asset set information at path to load assets |
119 | /// </summary> | 124 | /// </summary> |