aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/AssetLoader/Filesystem
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework/AssetLoader/Filesystem')
-rw-r--r--OpenSim/Framework/AssetLoader/Filesystem/AssetLoaderFileSystem.cs21
1 files changed, 12 insertions, 9 deletions
diff --git a/OpenSim/Framework/AssetLoader/Filesystem/AssetLoaderFileSystem.cs b/OpenSim/Framework/AssetLoader/Filesystem/AssetLoaderFileSystem.cs
index a394b1a..9497a2e 100644
--- a/OpenSim/Framework/AssetLoader/Filesystem/AssetLoaderFileSystem.cs
+++ b/OpenSim/Framework/AssetLoader/Filesystem/AssetLoaderFileSystem.cs
@@ -43,18 +43,15 @@ namespace OpenSim.Framework.AssetLoader.Filesystem
43 { 43 {
44 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 44 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
45 45
46 protected static AssetBase CreateAsset(string assetIdStr, string name, string path, bool isImage) 46 protected static AssetBase CreateAsset(string assetIdStr, string name, string path, sbyte type)
47 { 47 {
48 AssetBase asset = new AssetBase( 48 AssetBase asset = new AssetBase(new UUID(assetIdStr), name, type);
49 new UUID(assetIdStr),
50 name
51 );
52 49
53 if (!String.IsNullOrEmpty(path)) 50 if (!String.IsNullOrEmpty(path))
54 { 51 {
55 //m_log.InfoFormat("[ASSETS]: Loading: [{0}][{1}]", name, path); 52 //m_log.InfoFormat("[ASSETS]: Loading: [{0}][{1}]", name, path);
56 53
57 LoadAsset(asset, isImage, path); 54 LoadAsset(asset, path);
58 } 55 }
59 else 56 else
60 { 57 {
@@ -64,8 +61,14 @@ namespace OpenSim.Framework.AssetLoader.Filesystem
64 return asset; 61 return asset;
65 } 62 }
66 63
67 protected static void LoadAsset(AssetBase info, bool image, string path) 64 protected static void LoadAsset(AssetBase info, string path)
68 { 65 {
66 bool image =
67 (info.Type == (sbyte)AssetType.Texture ||
68 info.Type == (sbyte)AssetType.TextureTGA ||
69 info.Type == (sbyte)AssetType.ImageJPEG ||
70 info.Type == (sbyte)AssetType.ImageTGA);
71
69 FileInfo fInfo = new FileInfo(path); 72 FileInfo fInfo = new FileInfo(path);
70 long numBytes = fInfo.Length; 73 long numBytes = fInfo.Length;
71 if (fInfo.Exists) 74 if (fInfo.Exists)
@@ -138,10 +141,10 @@ namespace OpenSim.Framework.AssetLoader.Filesystem
138 { 141 {
139 string assetIdStr = source.Configs[i].GetString("assetID", UUID.Random().ToString()); 142 string assetIdStr = source.Configs[i].GetString("assetID", UUID.Random().ToString());
140 string name = source.Configs[i].GetString("name", String.Empty); 143 string name = source.Configs[i].GetString("name", String.Empty);
141 sbyte type = (sbyte) source.Configs[i].GetInt("assetType", 0); 144 sbyte type = (sbyte)source.Configs[i].GetInt("assetType", 0);
142 string assetPath = Path.Combine(dir, source.Configs[i].GetString("fileName", String.Empty)); 145 string assetPath = Path.Combine(dir, source.Configs[i].GetString("fileName", String.Empty));
143 146
144 AssetBase newAsset = CreateAsset(assetIdStr, name, assetPath, false); 147 AssetBase newAsset = CreateAsset(assetIdStr, name, assetPath, type);
145 148
146 newAsset.Type = type; 149 newAsset.Type = type;
147 assets.Add(newAsset); 150 assets.Add(newAsset);