diff options
Update svn properties, add copyright header, formatting cleanup.
Diffstat (limited to 'OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs | 64 |
1 files changed, 30 insertions, 34 deletions
diff --git a/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs b/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs index dedd37f..f9059e0 100644 --- a/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs | |||
@@ -66,18 +66,17 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture | |||
66 | /// <param name="data"></param> | 66 | /// <param name="data"></param> |
67 | public void ReturnData(UUID id, byte[] data) | 67 | public void ReturnData(UUID id, byte[] data) |
68 | { | 68 | { |
69 | DynamicTextureUpdater updater = null; | ||
69 | 70 | ||
70 | DynamicTextureUpdater updater = null; | 71 | lock (Updaters) |
71 | |||
72 | lock(Updaters) | ||
73 | { | 72 | { |
74 | if (Updaters.ContainsKey(id)) | 73 | if (Updaters.ContainsKey(id)) |
75 | { | 74 | { |
76 | updater = Updaters[id]; | 75 | updater = Updaters[id]; |
77 | } | 76 | } |
78 | } | 77 | } |
79 | 78 | ||
80 | if(updater != null) | 79 | if (updater != null) |
81 | { | 80 | { |
82 | if (RegisteredScenes.ContainsKey(updater.SimUUID)) | 81 | if (RegisteredScenes.ContainsKey(updater.SimUUID)) |
83 | { | 82 | { |
@@ -86,27 +85,26 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture | |||
86 | } | 85 | } |
87 | } | 86 | } |
88 | 87 | ||
89 | if(updater.UpdateTimer == 0) | 88 | if (updater.UpdateTimer == 0) |
90 | { | 89 | { |
91 | lock(Updaters) | 90 | lock (Updaters) |
92 | { | 91 | { |
93 | if (!Updaters.ContainsKey(updater.UpdaterID)) | 92 | if (!Updaters.ContainsKey(updater.UpdaterID)) |
94 | { | 93 | { |
95 | Updaters.Remove(updater.UpdaterID); | 94 | Updaters.Remove(updater.UpdaterID); |
96 | } | 95 | } |
97 | } | 96 | } |
98 | } | 97 | } |
99 | |||
100 | } | 98 | } |
101 | 99 | ||
102 | public UUID AddDynamicTextureURL(UUID simID, UUID primID, string contentType, string url, | 100 | public UUID AddDynamicTextureURL(UUID simID, UUID primID, string contentType, string url, |
103 | string extraParams, int updateTimer) | 101 | string extraParams, int updateTimer) |
104 | { | 102 | { |
105 | return AddDynamicTextureURL(simID, primID, contentType, url, extraParams, updateTimer, false, 255); | 103 | return AddDynamicTextureURL(simID, primID, contentType, url, extraParams, updateTimer, false, 255); |
106 | } | 104 | } |
107 | 105 | ||
108 | public UUID AddDynamicTextureURL(UUID simID, UUID primID, string contentType, string url, | 106 | public UUID AddDynamicTextureURL(UUID simID, UUID primID, string contentType, string url, |
109 | string extraParams, int updateTimer, bool SetBlending, byte AlphaValue) | 107 | string extraParams, int updateTimer, bool SetBlending, byte AlphaValue) |
110 | { | 108 | { |
111 | if (RenderPlugins.ContainsKey(contentType)) | 109 | if (RenderPlugins.ContainsKey(contentType)) |
112 | { | 110 | { |
@@ -123,12 +121,12 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture | |||
123 | updater.BlendWithOldTexture = SetBlending; | 121 | updater.BlendWithOldTexture = SetBlending; |
124 | updater.FrontAlpha = AlphaValue; | 122 | updater.FrontAlpha = AlphaValue; |
125 | 123 | ||
126 | lock(Updaters) | 124 | lock (Updaters) |
127 | { | 125 | { |
128 | if (!Updaters.ContainsKey(updater.UpdaterID)) | 126 | if (!Updaters.ContainsKey(updater.UpdaterID)) |
129 | { | 127 | { |
130 | Updaters.Add(updater.UpdaterID, updater); | 128 | Updaters.Add(updater.UpdaterID, updater); |
131 | } | 129 | } |
132 | } | 130 | } |
133 | 131 | ||
134 | RenderPlugins[contentType].AsyncConvertUrl(updater.UpdaterID, url, extraParams); | 132 | RenderPlugins[contentType].AsyncConvertUrl(updater.UpdaterID, url, extraParams); |
@@ -138,13 +136,13 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture | |||
138 | } | 136 | } |
139 | 137 | ||
140 | public UUID AddDynamicTextureData(UUID simID, UUID primID, string contentType, string data, | 138 | public UUID AddDynamicTextureData(UUID simID, UUID primID, string contentType, string data, |
141 | string extraParams, int updateTimer) | 139 | string extraParams, int updateTimer) |
142 | { | 140 | { |
143 | return AddDynamicTextureData(simID, primID, contentType, data, extraParams, updateTimer, false, 255); | 141 | return AddDynamicTextureData(simID, primID, contentType, data, extraParams, updateTimer, false, 255); |
144 | } | 142 | } |
145 | 143 | ||
146 | public UUID AddDynamicTextureData(UUID simID, UUID primID, string contentType, string data, | 144 | public UUID AddDynamicTextureData(UUID simID, UUID primID, string contentType, string data, |
147 | string extraParams, int updateTimer, bool SetBlending, byte AlphaValue) | 145 | string extraParams, int updateTimer, bool SetBlending, byte AlphaValue) |
148 | { | 146 | { |
149 | if (RenderPlugins.ContainsKey(contentType)) | 147 | if (RenderPlugins.ContainsKey(contentType)) |
150 | { | 148 | { |
@@ -159,12 +157,12 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture | |||
159 | updater.BlendWithOldTexture = SetBlending; | 157 | updater.BlendWithOldTexture = SetBlending; |
160 | updater.FrontAlpha = AlphaValue; | 158 | updater.FrontAlpha = AlphaValue; |
161 | 159 | ||
162 | lock(Updaters) | 160 | lock (Updaters) |
163 | { | 161 | { |
164 | if (!Updaters.ContainsKey(updater.UpdaterID)) | 162 | if (!Updaters.ContainsKey(updater.UpdaterID)) |
165 | { | 163 | { |
166 | Updaters.Add(updater.UpdaterID, updater); | 164 | Updaters.Add(updater.UpdaterID, updater); |
167 | } | 165 | } |
168 | } | 166 | } |
169 | 167 | ||
170 | RenderPlugins[contentType].AsyncConvertData(updater.UpdaterID, data, extraParams); | 168 | RenderPlugins[contentType].AsyncConvertData(updater.UpdaterID, data, extraParams); |
@@ -173,7 +171,6 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture | |||
173 | return UUID.Zero; | 171 | return UUID.Zero; |
174 | } | 172 | } |
175 | 173 | ||
176 | |||
177 | public void GetDrawStringSize(string contentType, string text, string fontName, int fontSize, | 174 | public void GetDrawStringSize(string contentType, string text, string fontName, int fontSize, |
178 | out double xSize, out double ySize) | 175 | out double xSize, out double ySize) |
179 | { | 176 | { |
@@ -307,7 +304,6 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture | |||
307 | part.ScheduleFullUpdate(); | 304 | part.ScheduleFullUpdate(); |
308 | 305 | ||
309 | scene.CommsManager.AssetCache.ExpireAsset(oldID); | 306 | scene.CommsManager.AssetCache.ExpireAsset(oldID); |
310 | |||
311 | } | 307 | } |
312 | 308 | ||
313 | private byte[] BlendTextures(byte[] frontImage, byte[] backImage, bool setNewAlpha, byte newAlpha) | 309 | private byte[] BlendTextures(byte[] frontImage, byte[] backImage, bool setNewAlpha, byte newAlpha) |