diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Framework/WearableCacheItem.cs | 39 |
1 files changed, 12 insertions, 27 deletions
diff --git a/OpenSim/Framework/WearableCacheItem.cs b/OpenSim/Framework/WearableCacheItem.cs index e060f22..f832ff9 100644 --- a/OpenSim/Framework/WearableCacheItem.cs +++ b/OpenSim/Framework/WearableCacheItem.cs | |||
@@ -128,31 +128,27 @@ namespace OpenSim.Framework | |||
128 | return arr; | 128 | return arr; |
129 | } | 129 | } |
130 | 130 | ||
131 | public static OSDArray BakedToOSD(WearableCacheItem[] pcacheItems) | 131 | public static OSDArray BakedToOSD(WearableCacheItem[] pcacheItems, int start, int end) |
132 | { | 132 | { |
133 | if (pcacheItems.Length < AvatarAppearance.BAKE_INDICES[AvatarAppearance.BAKE_INDICES.Length - 1]) | ||
134 | return null; | ||
135 | |||
136 | OSDArray arr = new OSDArray(); | 133 | OSDArray arr = new OSDArray(); |
134 | if(start < 0) | ||
135 | start = 0; | ||
136 | if (end < 0 || end > AvatarAppearance.BAKE_INDICES.Length) | ||
137 | end = AvatarAppearance.BAKE_INDICES.Length; | ||
138 | if (start > end) | ||
139 | return null; | ||
137 | 140 | ||
138 | for (int i = 0; i < AvatarAppearance.BAKE_INDICES.Length; i++) | 141 | for (int i = start; i < end; i++) |
139 | { | 142 | { |
140 | int idx = AvatarAppearance.BAKE_INDICES[i]; | 143 | int idx = AvatarAppearance.BAKE_INDICES[i]; |
141 | 144 | if(idx >= pcacheItems.Length) | |
145 | continue; | ||
142 | WearableCacheItem item = pcacheItems[idx]; | 146 | WearableCacheItem item = pcacheItems[idx]; |
143 | 147 | ||
144 | OSDMap itemmap = new OSDMap(); | 148 | OSDMap itemmap = new OSDMap(); |
145 | itemmap.Add("textureindex", OSD.FromUInteger(item.TextureIndex)); | 149 | itemmap.Add("textureindex", OSD.FromUInteger(item.TextureIndex)); |
146 | itemmap.Add("cacheid", OSD.FromUUID(item.CacheId)); | 150 | itemmap.Add("cacheid", OSD.FromUUID(item.CacheId)); |
147 | itemmap.Add("textureid", OSD.FromUUID(item.TextureID)); | 151 | itemmap.Add("textureid", OSD.FromUUID(item.TextureID)); |
148 | /* | ||
149 | if (item.TextureAsset != null) | ||
150 | { | ||
151 | itemmap.Add("assetdata", OSD.FromBinary(item.TextureAsset.Data)); | ||
152 | itemmap.Add("assetcreator", OSD.FromString(item.TextureAsset.CreatorID)); | ||
153 | itemmap.Add("assetname", OSD.FromString(item.TextureAsset.Name)); | ||
154 | } | ||
155 | */ | ||
156 | arr.Add(itemmap); | 152 | arr.Add(itemmap); |
157 | } | 153 | } |
158 | return arr; | 154 | return arr; |
@@ -167,22 +163,11 @@ namespace OpenSim.Framework | |||
167 | foreach (OSDMap item in itemarray) | 163 | foreach (OSDMap item in itemarray) |
168 | { | 164 | { |
169 | int idx = item["textureindex"].AsInteger(); | 165 | int idx = item["textureindex"].AsInteger(); |
170 | if (idx < 0 || idx > pcache.Length) | 166 | if (idx < 0 || idx >= pcache.Length) |
171 | continue; | 167 | continue; |
172 | pcache[idx].CacheId = item["cacheid"].AsUUID(); | 168 | pcache[idx].CacheId = item["cacheid"].AsUUID(); |
173 | pcache[idx].TextureID = item["textureid"].AsUUID(); | 169 | pcache[idx].TextureID = item["textureid"].AsUUID(); |
174 | /* | 170 | pcache[idx].TextureAsset = null; |
175 | if (item.ContainsKey("assetdata")) | ||
176 | { | ||
177 | AssetBase asset = new AssetBase(item["textureid"].AsUUID(), "BakedTexture", (sbyte)AssetType.Texture, UUID.Zero.ToString()); | ||
178 | asset.Temporary = true; | ||
179 | asset.Local = true; | ||
180 | asset.Data = item["assetdata"].AsBinary(); | ||
181 | pcache[idx].TextureAsset = asset; | ||
182 | } | ||
183 | else | ||
184 | */ | ||
185 | pcache[idx].TextureAsset = null; | ||
186 | } | 171 | } |
187 | } | 172 | } |
188 | return pcache; | 173 | return pcache; |