add cache for not existing textures

master
Christopher 2020-06-28 16:04:17 +02:00
parent 6ac1e6eaf9
commit 789d658f4a
1 changed files with 9 additions and 2 deletions

View File

@ -22,6 +22,8 @@ namespace OpenSim.Modules.TextureFetcher
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
Scene m_scene = null; Scene m_scene = null;
List<UUID> m_textureBlackList = new List<UUID>();
public string Name public string Name
{ {
get { return "TextureFetcher"; } get { return "TextureFetcher"; }
@ -132,6 +134,8 @@ namespace OpenSim.Modules.TextureFetcher
for(uint i = 0; i < allSides; i++) for(uint i = 0; i < allSides; i++)
{ {
TextureEntryFace face = textures.GetFace(i); TextureEntryFace face = textures.GetFace(i);
if(!m_textureBlackList.Contains(face.TextureID))
allTextures.Add(face.TextureID); allTextures.Add(face.TextureID);
} }
@ -143,7 +147,10 @@ namespace OpenSim.Modules.TextureFetcher
bool[] existing = m_scene.AssetService.AssetsExist(_assetIDs); bool[] existing = m_scene.AssetService.AssetsExist(_assetIDs);
for (int i = 0; i < existing.Length; i++) for (int i = 0; i < existing.Length; i++)
if (existing[i] == false) if (existing[i] == false)
{
m_textureBlackList.Add(allTextures[i]);
allTextures[i] = UUID.Zero; allTextures[i] = UUID.Zero;
}
//Convert texture uuid list to inventar items. //Convert texture uuid list to inventar items.
foreach (UUID texture in allTextures) foreach (UUID texture in allTextures)