public UUID AddDynamicTextureData(UUID simID, UUID primID, UUID oldAssetID, string contentType, string data, string extraParams, int updateTimer, bool SetBlending, int disp, byte AlphaValue, int face) { if (RenderPlugins.ContainsKey(contentType)) { DynamicTextureUpdater updater = new DynamicTextureUpdater { SimUUID = simID, PrimID = primID, ContentType = contentType, BodyData = data, UpdateTimer = updateTimer, UpdaterID = UUID.Random(), Params = extraParams, BlendWithOldTexture = SetBlending, FrontAlpha = AlphaValue, Face = face, Url = "Local image", Disp = disp, LastAssetID = oldAssetID }; lock (Updaters) { if (!Updaters.ContainsKey(updater.UpdaterID)) { Updaters.Add(updater.UpdaterID, updater); } } RenderPlugins [contentType].AsyncConvertData(updater.UpdaterID, data, extraParams); return(updater.UpdaterID); } return(UUID.Zero); }
/// <summary> /// Called by code which actually renders the dynamic texture to supply texture data. /// </summary> /// <param name="id"></param> /// <param name="data"></param> public void ReturnData(UUID id, byte [] data) { DynamicTextureUpdater updater = null; lock (Updaters) { if (Updaters.ContainsKey(id)) { updater = Updaters [id]; } } if (updater != null) { updater.DataReceived(data, m_scene); if (updater.UpdateTimer == 0) { lock (Updaters) { if (!Updaters.ContainsKey(updater.UpdaterID)) { Updaters.Remove(updater.UpdaterID); } } } } }
public UUID AddDynamicTextureURL(UUID simID, UUID primID, string contentType, string url, string extraParams, bool SetBlending, int disp, byte AlphaValue, int face) { if (RenderPlugins.ContainsKey(contentType)) { DynamicTextureUpdater updater = new DynamicTextureUpdater(); updater.SimUUID = simID; updater.PrimID = primID; updater.ContentType = contentType; updater.Url = url; updater.UpdaterID = UUID.Random(); updater.Params = extraParams; updater.BlendWithOldTexture = SetBlending; updater.FrontAlpha = AlphaValue; updater.Face = face; updater.Disp = disp; lock (Updaters) { if (!Updaters.ContainsKey(updater.UpdaterID)) { Updaters.Add(updater.UpdaterID, updater); } } RenderPlugins[contentType].AsyncConvertUrl(updater.UpdaterID, url, extraParams); return(updater.newTextureID); } return(UUID.Zero); }
public UUID AddDynamicTextureData(UUID simID, UUID primID, string contentType, string data, string extraParams, int updateTimer, bool SetBlending, int disp, byte AlphaValue, int face) { if (RenderPlugins.ContainsKey(contentType)) { DynamicTextureUpdater updater = new DynamicTextureUpdater(); updater.SimUUID = simID; updater.PrimID = primID; updater.ContentType = contentType; updater.BodyData = data; updater.UpdateTimer = updateTimer; updater.UpdaterID = UUID.Random(); updater.Params = extraParams; updater.BlendWithOldTexture = SetBlending; updater.FrontAlpha = AlphaValue; updater.Face = face; updater.Url = "Local image"; updater.Disp = disp; lock (Updaters) { if (!Updaters.ContainsKey(updater.UpdaterID)) { Updaters.Add(updater.UpdaterID, updater); } } RenderPlugins[contentType].AsyncConvertData(updater.UpdaterID, data, extraParams); return(updater.UpdaterID); } return(UUID.Zero); }
public UUID AddDynamicTextureURL(UUID simID, UUID primID, string contentType, string url, string extraParams, int updateTimer, bool SetBlending, byte AlphaValue) { if (RenderPlugins.ContainsKey(contentType)) { //m_log.Debug("dynamic texture being created: " + url + " of type " + contentType); DynamicTextureUpdater updater = new DynamicTextureUpdater(); updater.SimUUID = simID; updater.PrimID = primID; updater.ContentType = contentType; updater.Url = url; updater.UpdateTimer = updateTimer; updater.UpdaterID = UUID.Random(); updater.Params = extraParams; updater.BlendWithOldTexture = SetBlending; updater.FrontAlpha = AlphaValue; lock (Updaters) { if (!Updaters.ContainsKey(updater.UpdaterID)) { Updaters.Add(updater.UpdaterID, updater); } } RenderPlugins[contentType].AsyncConvertUrl(updater.UpdaterID, url, extraParams); return(updater.UpdaterID); } return(UUID.Zero); }
/// <summary> /// Called by code which actually renders the dynamic texture to supply texture data. /// </summary> /// <param name="updaterId"></param> /// <param name="texture"></param> public void ReturnData(UUID updaterId, IDynamicTexture texture) { DynamicTextureUpdater updater = null; if (Updaters.TryGetValue(updaterId, out updater)) { Scene scene; if (RegisteredScenes.TryGetValue(updater.SimUUID, out scene)) { UUID newTextureID = updater.DataReceived(texture.Data, scene); if (ReuseTextures && !updater.BlendWithOldTexture && texture.IsReuseable && (ReuseLowDataTextures || IsDataSizeReuseable(texture))) { m_reuseableDynamicTextures[GenerateReusableTextureKey(texture.InputCommands, texture.InputParams)] = newTextureID; } } } if (updater.UpdateTimer == 0) { Updaters.Remove(updater.UpdaterID); } }
/// <summary> /// Called by code which actually renders the dynamic texture to supply texture data. /// </summary> /// <param name="updaterId"></param> /// <param name="texture"></param> public void ReturnData(UUID updaterId, IDynamicTexture texture) { DynamicTextureUpdater updater = null; lock (Updaters) { if (Updaters.ContainsKey(updaterId)) { updater = Updaters[updaterId]; } } if (updater != null) { if (RegisteredScenes.ContainsKey(updater.SimUUID)) { Scene scene = RegisteredScenes[updater.SimUUID]; UUID newTextureID = updater.DataReceived(texture.Data, scene); if (ReuseTextures && !updater.BlendWithOldTexture && texture.IsReuseable && (ReuseLowDataTextures || IsDataSizeReuseable(texture))) { m_reuseableDynamicTextures.Store( GenerateReusableTextureKey(texture.InputCommands, texture.InputParams), newTextureID); } } } if (updater.UpdateTimer == 0) { lock (Updaters) { if (!Updaters.ContainsKey(updater.UpdaterID)) { Updaters.Remove(updater.UpdaterID); } } } }
public UUID AddDynamicTextureData(UUID simID, UUID primID, string contentType, string data, string extraParams, int updateTimer, bool SetBlending, int disp, byte AlphaValue, int face) { if (RenderPlugins.ContainsKey(contentType)) { DynamicTextureUpdater updater = new DynamicTextureUpdater(); updater.SimUUID = simID; updater.PrimID = primID; updater.ContentType = contentType; updater.BodyData = data; updater.UpdateTimer = updateTimer; updater.UpdaterID = UUID.Random(); updater.Params = extraParams; updater.BlendWithOldTexture = SetBlending; updater.FrontAlpha = AlphaValue; updater.Face = face; updater.Url = "Local image"; updater.Disp = disp; lock (Updaters) { if (!Updaters.ContainsKey(updater.UpdaterID)) { Updaters.Add(updater.UpdaterID, updater); } } RenderPlugins[contentType].AsyncConvertData(updater.UpdaterID, data, extraParams); return updater.UpdaterID; } return UUID.Zero; }
public UUID AddDynamicTextureURL(UUID simID, UUID primID, UUID oldAssetID, string contentType, string url, string extraParams, int updateTimer, bool SetBlending, int disp, byte AlphaValue, int face) { if (RenderPlugins.ContainsKey(contentType)) { DynamicTextureUpdater updater = new DynamicTextureUpdater { SimUUID = simID, PrimID = primID, ContentType = contentType, Url = url, UpdateTimer = updateTimer, UpdaterID = UUID.Random(), Params = extraParams, BlendWithOldTexture = SetBlending, FrontAlpha = AlphaValue, Face = face, Disp = disp, LastAssetID = oldAssetID }; lock (Updaters) { if (!Updaters.ContainsKey(updater.UpdaterID)) { Updaters.Add(updater.UpdaterID, updater); } } RenderPlugins[contentType].AsyncConvertUrl(updater.UpdaterID, url, extraParams); return updater.UpdaterID; } return UUID.Zero; }
public UUID AddDynamicTextureData(UUID simID, UUID primID, string contentType, string data, string extraParams, bool SetBlending, int disp, byte AlphaValue, int face) { if (!RenderPlugins.ContainsKey(contentType)) { return(UUID.Zero); } Scene scene; RegisteredScenes.TryGetValue(simID, out scene); if (scene == null) { return(UUID.Zero); } SceneObjectPart part = scene.GetSceneObjectPart(primID); if (part == null) { return(UUID.Zero); } // If we want to reuse dynamic textures then we have to ignore any request from the caller to expire // them. if (ReuseTextures) { disp = disp & ~DISP_EXPIRE; } DynamicTextureUpdater updater = new DynamicTextureUpdater(); updater.SimUUID = simID; updater.PrimID = primID; updater.ContentType = contentType; updater.BodyData = data; updater.UpdaterID = UUID.Random(); updater.Params = extraParams; updater.BlendWithOldTexture = SetBlending; updater.FrontAlpha = AlphaValue; updater.Face = face; updater.Url = "Local image"; updater.Disp = disp; object objReusableTextureUUID = null; if (ReuseTextures && !updater.BlendWithOldTexture) { string reuseableTextureKey = GenerateReusableTextureKey(data, extraParams); objReusableTextureUUID = m_reuseableDynamicTextures.Get(reuseableTextureKey); if (objReusableTextureUUID != null) { // If something else has removed this temporary asset from the cache, detect and invalidate // our cached uuid. if (scene.AssetService.GetMetadata(objReusableTextureUUID.ToString()) == null) { m_reuseableDynamicTextures.Invalidate(reuseableTextureKey); objReusableTextureUUID = null; } } } // We cannot reuse a dynamic texture if the data is going to be blended with something already there. if (objReusableTextureUUID == null) { lock (Updaters) { if (!Updaters.ContainsKey(updater.UpdaterID)) { Updaters.Add(updater.UpdaterID, updater); } } // m_log.DebugFormat( // "[DYNAMIC TEXTURE MODULE]: Requesting generation of new dynamic texture for {0} in {1}", // part.Name, part.ParentGroup.Scene.Name); RenderPlugins[contentType].AsyncConvertData(updater.UpdaterID, data, extraParams); } else { // m_log.DebugFormat( // "[DYNAMIC TEXTURE MODULE]: Reusing cached texture {0} for {1} in {2}", // objReusableTextureUUID, part.Name, part.ParentGroup.Scene.Name); // No need to add to updaters as the texture is always the same. Not that this functionality // apppears to be implemented anyway. updater.UpdatePart(part, (UUID)objReusableTextureUUID); } return(updater.newTextureID); }
public UUID AddDynamicTextureURL(UUID simID, UUID primID, string contentType, string url, string extraParams, int updateTimer, bool SetBlending, int disp, byte AlphaValue, int face) { if (RenderPlugins.ContainsKey(contentType)) { DynamicTextureUpdater updater = new DynamicTextureUpdater(); updater.SimUUID = simID; updater.PrimID = primID; updater.ContentType = contentType; updater.Url = url; updater.UpdateTimer = updateTimer; updater.UpdaterID = UUID.Random(); updater.Params = extraParams; updater.BlendWithOldTexture = SetBlending; updater.FrontAlpha = AlphaValue; updater.Face = face; updater.Disp = disp; try { Updaters.Add(updater.UpdaterID, updater); } catch { } RenderPlugins[contentType].AsyncConvertUrl(updater.UpdaterID, url, extraParams); return updater.UpdaterID; } return UUID.Zero; }
public UUID AddDynamicTextureURL(UUID simID, UUID primID, string contentType, string url, string extraParams, int updateTimer, bool SetBlending, byte AlphaValue) { if (RenderPlugins.ContainsKey(contentType)) { //m_log.Debug("dynamic texture being created: " + url + " of type " + contentType); DynamicTextureUpdater updater = new DynamicTextureUpdater(); updater.SimUUID = simID; updater.PrimID = primID; updater.ContentType = contentType; updater.Url = url; updater.UpdateTimer = updateTimer; updater.UpdaterID = UUID.Random(); updater.Params = extraParams; updater.BlendWithOldTexture = SetBlending; updater.FrontAlpha = AlphaValue; lock (Updaters) { if (!Updaters.ContainsKey(updater.UpdaterID)) { Updaters.Add(updater.UpdaterID, updater); } } RenderPlugins[contentType].AsyncConvertUrl(updater.UpdaterID, url, extraParams); return updater.UpdaterID; } return UUID.Zero; }